Autonomic Systems Series Editors: Frances M.T. Brazier (TU Delft, Delft, The Netherlands) Omer F. Rana (Cardiff University, Cardiff, UK) John C. Strassner (POSTECH, Pohang, South Korea)
Editorial Board: Richard Anthony (University of Greenwich, UK) Vinny Cahill (Trinity College Dublin, Ireland) Monique Calisti (Whitestein Information Technology Group, Switzerland) Simon Dobson (University of St. Andrews, UK) Joel Fleck (Hewlett-Packard, Palo Alto, USA) José Fortes (University of Florida, USA) Salim Hariri (University of Arizona, USA) Jeff Kephart (IBM Thomas J. Watson Research Center, Hawthorne, USA) Manish Parashar (Rutgers University, New Jersey, USA) Katia Sycara (Carnegie Mellon University, Pittsburgh, USA) Sven van der Meer (Waterford Institute of Technology, Ireland) James Won-Ki Hong (Pohang University, South Korea)
The AUTONOMIC SYSTEMS book series provides a platform of communication between academia and industry by publishing research monographs, outstanding PhD theses, and peerreviewed compiled contributions on the latest developments in the field of autonomic systems. It covers a broad range of topics from the theory of autonomic systems that are researched by academia and industry. Hence, cutting-edge research, prototypical case studies, as well as industrial applications are in the focus of this book series. Fast reviewing provides a most convenient way to publish latest results in this rapid moving research area. The topics covered by the series include (among others): • • • • •
self-* properties in autonomic systems (e.g. self-management, self-healing) architectures, models, and languages for building autonomic systems trust, negotiation, and risk management in autonomic systems theoretical foundations of autonomic systems applications and novel computing paradigms of autonomic systems
For further volumes: http://www.springer.com/series/8123
Reliable and Autonomous Computational Science International Conference, RACS 2010, Atlanta, GA, USA, October 27-30, 2010 Sung Y. Shin Rex Gantenbein Tei-Wei Kuo Jiman Hong Editors
Editors Sung Y. Shin EE & Computer Science Department South Dakota State University Brookings, SD 57007 USA
[email protected] Tei-Wei Kuo Department of Computer Science and Information Engineering National Taiwan University Taipei, 10617 Taiwan R.O.C.
[email protected]
Rex Gantenbein Medical Education and Public Health University of Wyoming 1000 E. University Ave. Laramie, WY 82071 USA
[email protected] Jiman Hong School of Computing Soongsil University Seoul 156-743 South Korea
[email protected]
1998 ACM Computing Classification: D [Software] 2010 Mathematics Subject Classification: 68Nxx
ISBN 978-3-0348-0030-3 e-ISBN 978-3-0348-0031-0 DOI 10.1007/978-3-0348-0031-0 Library of Congress Control Number: 2010936134 c Springer Basel AG 2011
This work is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifi cally the rights of translation, reprinting, re-use of illustrations, recitation, broadcasting, reproduction on microfi lms or in other ways, and storage in data banks. For any kind of use, permission of the copyright owner must be obtained. Cover design: deblik, Berlin Printed on acid-free paper Springer Basel AG is part of Springer Science+Business Media www.birkhauser-science.com
Preface
Increasing size and complexity of software and hardware systems has resulted in the difficulty of reliability guarantees. At the same time, the designs of autonomous computing systems become more critical as we rely on software systems more and more in our daily life. The complexity in system operations becomes even more critical with the emerging of the ubiquitous computing systems of embedded devices and other pervasive systems. Such trends make it necessary to provide software engineers supports of a set of techniques and tools for the development of reliable and autonomous software. To cope with the growing complexity of such systems, the International Conference on Reliable and Autonomous Computational Science (RACS) provide a forum for the exchanging of highly original ideas about reliable and autonomous computing systems. The RACS 2010 is to bring together engineers and scientists from diverse communities who are interested in building reliable and autonomous computing technologies and to discuss and exchange experimental or theoretical results, novel designs, work-in-progress, experiences, case studies, and trend-setting ideas. This volume contains the papers selected for the presentation at the International conference on Reliable and Autonomous Computational Science (RACS), that is organized at the Southern Polytechnic State University, GA, USA, October 27th 30th, 2010. They were 87 submissions, and only 21 papers are published in this proceedings volume. Each paper was reviewed by at least three members of the Technical Program Committee. The Technical Program Committee of RACS 2010 was lead by the TPC Chairs, Dr. Rex E. Gantenbein and Dr. Tei-Wei Kuo, and TPC Vice Chair, Dr. Jiman Hong. We wish to thank the TPC members for the time and thought that they gave in creating the excellent program. Without their help and contributions, this program would not be possible. We also want to thank the Organizing Committee for the superior jobs. Our special thanks go to Dr. Sung Y. Shin (Steering Committee Chair), Dr. Sartaj Sahni (Honorable Conference
VI
Preface
Chair), Dr. Yookun Cho (Honorable Program Chair), Dr. Vahid Tarokh (the General Chair), Dr. Chih-Cheng Hung (Local Arrangement Chair), and Dr. Gwangil Jeon (Publication Chair) for their leadership and excellent work in the conference organization. We are grateful for the generous support given by the Southern Polytechnic State University. We would like to thank to all of the authors who contributed to this volume and entrusted their work to us and to everyone who attended RACS 2010. Finally, we are grateful to Dr. Frances M. T. Brazier, Dr. Omer F. Rana, and Dr. John C. Strassner, Editors of Autonomic Systems series, and Manuela Ramstein at Springer Basel AG for the support and cooperation during the preparation of this volume.
October 2010
Vahid Tarokh Tei-Wei Kuo Rex E. Gantenbein Jiman Hong Sung Y. Shin
Organizing Committee Honorable Conference Chair Sartaj Sahni, University of Florida, USA Honorable Program Chair Yookun Cho, Seoul National University, Korea Conference Chair Vahid Tarokh, Harvard University, USA Program Chairs Rex E. Gantenbein, University of Wyoming, USA Tei-Wei Kuo, National Taiwan University, Taiwan Program Vice-Chair Jiman Hong, Soongsil University, Korea Publication Chair Gwangil Jeon, Korea Polytechnic University, Korea Publicity Chairs Eric Wong, University of Texas, Dallas, USA Hyunseung Choo, Sungkyunkwan University, Korea Jinsuk Kim, University of Seoul, Korea Lei Li, Hosei University, Japan Richard Chbeir, Bourgogne University, France Local Arrangement Chair Chih-Cheng Hung, Southern Polytechnic State University, USA Steering Committee Sung Y. Shin, South Dakota State University, USA Yookun Cho, Seoul National University, Korea Vahid Tarokh, Harvard University, USA Tei-Wei Kuo, National Taiwan University, Taiwan
Technical Program Committee Agostinho Rosa, LaSEEB-ISR-IST, Portugal Alexey Podlasov, National University of Singapore, Singapore Dongkyun Kim, Kyungpook National University, Korea Ernesto Cuadros-Vargas, University of Sao Paolo, Brazil Ernesto Damiani, University of Milan, Italy Eunjee Song, Baylor University, USA Francisco Dominguez Mateos, University of Rey Juan Carlos, Spain Hao Yang, Nokia Research, USA Hiroyuki Okamura, Hiroshima University, Japan Iain Bate, University of York, UK I. Y. Song, Drexel University, USA Jiannong Cao, Hong Kong Polytechnic University, Hong Kong Jongmoo Choi, Dankook University, Korea Joonsang Baek, Institute of Infocomm Research, Singapore Jordi Forne, Technical University of Catalonia (UPC), Spain
VIII
Technical Program Committee
Julian Proenza, University of Balearic Islands, Spain Junghoon Lee, Jeju National University, Korea Junyoung Heo, Hansung University, Korea Kishor S.Trivedi, Duke University, USA Kuai Xu, Arizona State University, USA Li-Pin Chang, National Chiao-Tung University, ROC Lucia Lo Bello, University of Catania, Italy Madjid Merabti, Liverpool John Moores University, UK Michael Grottke, University of Erlangen-Nurember, Germany Michael Cukier, University of Maryland, College Park, USA Neeraj Suri, Darmstadt University of Technology, Germany Nicolas Navet, INRIA, France Omer F. Rana, Cardiff University, UK Pangu Kim, Chosun University, Korea Pasi Franti, University of Joensuu, Finland Paul Scheunders, University of Antwerp, Belgium Peijun Li, Peking University, China Rafael Accorsi, University of Freiburg, Germany Richard Zurawski, ISA Group, USA Roberto Di Pietro, University of Rome, Italy Sangho Yi, INRIA, France Simon Thompson, University Of Kent, UK Stelios Sidiroglou, MIT, USA Tarek Abdelzaher, UIUC, USA Thomas Nolte, Malardalen University, Sweden Vibhore Kumar, IBM T.J. Watson Research Center, USA Wen-Jiin Tasi, National Chiao Tung University, Taiwan Willy Susilo, University of Wollongong, Australia Xiaoyun Zhu, VMware, USA Xue Liu, McGill University, Canada Ya-Shu Chen, National Taiwan University of Science and Technology, Taiwan Yeongkwun Kim, Western Illinois University, USA Youakim Badr, University of Lyon, France Young-Joon Byun, California State University, USA Yuan-Hao Chang, National Taipei University of Technology, Taiwan Yuriy Brun, University of Washington, USA Zhigeng Pan, Zhejiang University, China
Contents
Part I Embedded & Computer Systems A Distributed Two-Version Multi-Granularity Locking Protocol for Multi-Controller Storage Systems Chih-Chung Tsai, Ya-Shu Chen, Tei-Wei Kuo . . . . . . . . . . . . . . . . . . . . . . .
3
A Medical Device Safety Supervision over Wireless Cheolgi Kim, Mu Sun, Heechul Yun, Lui Sha . . . . . . . . . . . . . . . . . . . . . . . . 21 A Novel Memory-Aware CPU Allocation Policy for Multicore NUMA Architecture Dongwoo Kang, Heekwon Park, Jongmoo Choi . . . . . . . . . . . . . . . . . . . . . . . 41 Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms Xuefeng Piao, Heeheon Kim, Yookun Cho, Sangchul Han, Minkyu Park, Monju Park, Seongje Cho . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Thermalaware Register File based on Heat Transfer Jungwook Kim, Seong Tae Jhang, Chu Shik Jhon . . . . . . . . . . . . . . . . . . . . 81 Analysis of Autonomous Bandwidth-Delay-Balancing Characteristic in the Decay Usage Scheduler Kyeongho Park, Ju Hyun Lee, Hoyoung Hwang, Chang-Gun Lee, Sang Lyul Min, Hyo-Joong Suh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 A Reliable Nested Transaction Model with Extension of Real-Time Characteristics Seung-Jin Moon, Sanghoon Lee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Part II Network Computing & Security
X
Contents
PDF: A Novel Probability-based Data Forwarding Scheme in Lossy Wireless Sensor Networks Dang Tu Nguyen, Wook Choi,, Hyunseung Choo . . . . . . . . . . . . . . . . . . . . 145 A New Green-Scheduling Approach to Maximize Wireless Multimedia Networking Lifetime via Packet and Path Diversity Wei Wang, Sung Shin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167 Design of a reliability enhancement scheme for the grid-topology mesh network Junghoon Lee, Gyung-Leen Park . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181 A Reliable Watchdog Protocol with Two-way Mutual Confirmation in Wireless Multi-Hop Networks Dongseung Shin, Dongkyun Kim and Jinwook Lee . . . . . . . . . . . . . . . . . . . . 201 Energy Efficient Power Management for Multi-Mode Wireless Network Devices Bongjae Kim, Boncheol Gu, Jeongki Kim, Chaedeok Lim, Jiman Hong . 223 An Efficient and Reliable flooding in MANETs Jinman Jung, Yookun Cho, Yeongkwun Kim, Sangho Yi, Hyungbae Park 245 A Fast Agreement Protocol for Underwater Wireless Sensor Networks Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon 265 Autonomous traffic management for CDMA-based real-time services in in-building environments Woon-Young Yeo, Hyukjun Oh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285 Protection against Buffer Overflow Attacks via Dynamic Binary Translation Chun-Chung Chen, Shih-Hao Hung, Chen-Pang Lee . . . . . . . . . . . . . . . . . 305
Part III Applications XA2C Framework for XML Alteration/Adaptation Gilbert Tekli, Richard Chbeir, Jacques Fayolle . . . . . . . . . . . . . . . . . . . . . . . 327 An Automatic Method for WordNet Concept Enrichment using Wikipedia Titles Myunggwon Hwang, Dongjin Choi, Byeongkyu Ko, Junho Choi, Pankoo Kim . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
Contents
XI
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks Using Successive Tuning Method Keon-Jun Park, Sung-Kwun Oh, Yong-Kab Kim . . . . . . . . . . . . . . . . . . . . . 367
Part IV Multimedia Improving Image Segmentation Algorithms with Differential Evolution Chih-Cheng Hung, Ziwei Ren, Wenfan Li, Qing Yang . . . . . . . . . . . . . . . . 381 TOF Camera based 3D Fingertip Location Estimation Yangkeun Ahn, Minwook Kim, Kwangmo Jung, Taehyoung Kim, Jaehoon Ahn, Sukil Hong . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
List of Contributors
Jaehoon Ahn Soongsil University
[email protected]
Jongmoo Choi Dankook University
[email protected]
Yangkeun Ahn Korea Electronics Technology Institute
[email protected]
Junho Choi Chosun University
[email protected]
Richard Chbeir Bourgogne University
[email protected] Chun-Chung Chen National Taiwan University
[email protected] Ya-Shu Chen National Taiwan University
[email protected]
Wook Choi Hankuk University of Foreign Studies
[email protected] Hyunseung Choo Sungkyunkwan University
[email protected] Sangil Eo Seoul National University
[email protected]
Seongje Cho Dankook University
[email protected]
Jacques Fayolle Jean Monnet University
[email protected]
Yookun Cho Seoul National University
[email protected]
Boncheol Gu Seoul National University
[email protected]
Dongjin Choi Chosun University
[email protected]
Sangchul Han Konkuk University
[email protected]
XIV
List of Contributors
Junyoung Heo Hansung University
[email protected]
Jinman Jung Seoul National University
[email protected]
Jiman Hong Soongsil University
[email protected]
Kwangmo Jung Korea Electronics Technology Institute
[email protected]
Sukil Hong Soongsil University
[email protected]
Dongwoo Kang Dankook University
[email protected]
Chih-Cheng Hung Southern Polytechnic State University
[email protected]
Bongjae Kim Seoul National University
[email protected]
Shih-Hao Hung National Taiwan University
[email protected] Hoyoung Hwang Hansung University
[email protected] Myunggwon Hwang Chosun Univ.
[email protected]
Cheolgi Kim University of Illinois
[email protected] Dongkyun Kim Kyungpook National University
[email protected] Heeheon Kim Seoul National University
[email protected] Jeongki Kim ETRI
[email protected]
Joonhyouk Jang Seoul National University
[email protected]
Jungwook Kim Seoul National University
[email protected]
Gwangil Jeon Korea Polytechnic University
[email protected]
Minwook Kim Korea Electronics Technology Institute
[email protected]
Seong Tae Jhang The University of Suwon
[email protected] Chu Shik Jhon Seoul National University
[email protected]
Pankoo Kim Chosun University
[email protected] Taehyoung Kim Soongsil University
[email protected]
List of Contributors
Yeongkwun Kim Western Illinois University
[email protected]
Chaedeok Lim ETRI
[email protected]
Yong-Kab Kim Wonkwang University
[email protected]
Hong Min Seoul National University
[email protected]
Byeongkyu Ko Chosun University
[email protected] Tei-Wei Kuo National Taiwan University
[email protected] Chang-Gun Lee Seoul National University
[email protected] Chen-Pang Lee National Taiwan University
[email protected] Jinwook Lee Samsung Electronics, Co., Ltd.
[email protected] Ju Hyun Lee Seoul National University
[email protected] Junghoon Lee Jeju National University
[email protected] Sanghoon Lee The University of Suwon
[email protected] Wenfan Li Southern Polytechnic State University
[email protected]
XV
Sang Lyul Min Seoul National University
[email protected] Seung-Jin Moon The University of Suwon
[email protected] Dang Tu Nguyen Sungkyunkwan University
[email protected] Hyukjun Oh Kwangwoon University hj
[email protected] Sung-Kwun Oh University of Suwon
[email protected] Gyung-Leen Park Jeju National University
[email protected] Heekwon Park Dankook University
[email protected] Hyungbae Park University of Missouri-Kansas City
[email protected] Keon-Jun Park University of Suwon
[email protected] Kyeongho Park Seoul National University
[email protected]
XVI
List of Contributors
Minkyu Park Konkuk University
[email protected]
Mu Sun University of Illinois
[email protected]
Monju Park University of Incheon
[email protected]
Gilbert Tekli Jean Monnet University
[email protected]
Xuefeng Piao Seoul National University
[email protected]
Chih-Chung Tsai National Taiwan University
[email protected]
Ziwei Ren Southern Polytechnic State University
[email protected]
Wei Wang South Dakota State University
[email protected]
Lui Sha University of Illinois
[email protected]
Qing Yang Auburn University
[email protected]
Dongseung Shin Kyungpook National University
[email protected]
Woon-Young Yeo Sejong University
[email protected]
Sung Shin South Dakota State University
[email protected]
Sangho Yi INRIA Grenoble Rhone-Alpes
[email protected]
Hyo-Joong Suh The Catholic University of Korea
[email protected]
Heechul Yun University of Illinois
[email protected]
Part I
Embedded & Computer Systems
A Distributed Two-Version Multi-Granularity Locking Protocol for Multi-Controller Storage Systems Chih-Chung Tsai1 , Ya-Shu Chen2 and Tei-Wei Kuo3 1
2
3
Department of Computer Science and Information Engineering, National Taiwan University, Taipei, Taiwan, ROC,
[email protected] Department of Electrical Engineering, National Taiwan University of Science and Technology, Taipei, Taiwan, ROC,
[email protected] Department of Computer Science and Information Engineering, National Taiwan University, Taipei, Taiwan, ROC,
[email protected]
Summary. The processing parallelism of I/O requests has been widely explored in studying the performance difference between microprocessors and I/O devices. In this paper, a two-version multi-granularity protocol is proposed to maximize the controller concurrency of storage systems and to improve system performance. The concept of multi-granularity is explored in this paper by considering the hierarchical structure of such systems using stripes, blocks, etc. Synchronization based on two versions of data is adopted to favor read operations. The proposed protocol is evaluated over realistic traces with different configurations, such as using varying number of controllers and different disk performance model.
1 Introduction Advances in VLSI technology have resulted in a growing gap between the computing power of microprocessors and the performance of I/O devices. In order to close this gap, a number of excellent solutions have been proposed by several researchers and manufacturers in the past decade. Among the most well-known solutions, the widely used exemplar is the Redundant Arrays of Inexpensive Disks [Patterson88, Peter93]. In this solution, besides the deployment of multiple disks, multiple controllers are also introduced not only to maximize the processing parallelism of I/O requests but also to provide more reliable services. However, such development further complicates the synchronization behavior of multi-disk systems, especially as controllers are usually associated with cache. The synchronization problem of controllers is closely related to concurrency control problems of database systems [Chu85, Bhargava90, Shin91, Franklin91, Franklin92, Franklin93, Panagos97, Kuo03, Desai03, Guo05, Bern-
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 1, © Springer Basel AG 2011
4
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
stein06, Lin09]. In particular, past research results consider performance optimization and/or fault tolerance for distributed database systems, e.g., [Chu85, Bhargava90, Shin91, Desai03], while some other researchers explore cache consistency for client-server database systems, e.g., e.g., [Franklin91, Franklin92, Franklin93, Panagos97]. In those research works, when multiple copies of data are possible, flexibility is explored in the reordering of read and write operations. In particular, dynamic adjustment methodologies for serialized orders were proposed for real-time database systems, e.g., [Lin90,Lam97,Lam98,Kuo03,Guo05,Bernstein06,Lin09]. Nevertheless, though excellent methodologies have been proposed for database systems, they could not be directly applied to solve the synchronization problem of multi-controller storage systems (with multiple disks). In this paper, we explore synchronization protocols for multi-controller storage systems. When considering the characteristics of such systems, we explore multi-granularity in synchronization for controllers, in particular, with respect to maximizing concurrency in operations due to the hierarchical structure of such systems. Multiple version based concurrency control are also exploited to dynamically adjust the order of operations so that operations with a higher service priority can be completed as soon as possible. In particular, a two-version multi-granularity protocol based on the above ideas is proposed in this paper so that system concurrency is maximized. A series of experiments based on realistic traces have been performed as evaluation considering the concepts of multi-granularity and two-version in the design of multi-controller storage systems. The rest of this paper is organized as follows. Section 2 presents the system model and the problem definition. Section 3 proposes a two-version multigranularity protocol and proves its properties. Section 4 reports the performance evaluation of the proposed approach. Section 5 presents the conclusion.
2 System Model A RAID storage system, as shown in Figure 1, is composed of controllers, a backplane, and disks or other peripherals. All disks are shared between controllers via the backplane. Each controller has two interfaces to communicate with the client (host) by fiber channel and the backplane, and each of them have two separate caches for reading/writing data. When a controller receives a write-request from a client, the controller writes the request data to the write-cache, and the disk in that order. Conversely, when a controller receives a read-request from a client, the controller attempts to return the request data from the read cache. If the request data is not in the read-cache, the controller sends the read-request to the disk. To improve performance, most RAID storage systems adopt a striping technique, i.e. splitting up files into small pieces for multiple disks. Before we proceed, some terminologies are defined as follows. A volume is composed of a
A Distributed Two-Version Multi-Granularity Locking Protocol
Client
Client
Fibre channel
Fibre channel Controller cN
Controller c1 Write memory
Read memory
…
Write memory
Process
Backplane
Disks
Read memory
Process
Expander
Disk
5
Expander
Disk
Disk
Disk
Fig. 1. Architecture of a RAID Storage System
set of disks, and the volume can be configured at a RAID level, such as RAID 0, 1 or 5. Each disk in a volume is logically partitioned into blocks of equal sizes, and each block is referred to as a stripe unit. The size of a stripe unit is a multiple of the disk sector size, and the size is configured when the volume is created. A stripe is a set of stripe units which are in the same physical location on disks. Consequently, the size of a stripe is the size of the stripe units multiplied by the number of disks. A cache buffer is the allocation unit of memory on a controller. As shown in Figure 2, there exists a volume with four disks (each stripe is composed of four stripe unit), and the size of each stripe unit is four times of the size of a cache buffer. For example, if the size of cache buffer is 64k, and then the size of a stripe unit is 256k as shown in this figure. In this paper, we are concerned with how to maintain cache coherency among multiple controllers to provide correctness for read/write requests from multiple clients on shared, multiple disks. The objective is to maximize concurrency in the operation of RAID systems for improving system performance. To resolve this problem, we first define some terms and operations used in this paper. There are a set of data objects and a set of controllers c = {c1 , c2 , . . . , cN } in the RAID system. Each data object Ok could be a cache buffer, a stripe
6
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
Fig. 2. Relationship of volumes, stripes and cache buffers
unit or a stripe in the system. Each request from a controller ci is denoted as a task τij . A RAID system supports six kinds of locks for data collision management, namely read-lock, write-lock, certify-lock, intention read-lock, intention write-lock, and intention certify-lock. For simplicity, we denote the six kinds of locks as R lock, W lock, C lock, IR lock, IW lock and IC lock, respectively. A task must obtain the read-lock, write-lock and certify-lock before it executes the read, write and certify operations. By the definition of RAID 0, a read operation for a data object will read the data object Ok from the read-memory, which is the consistent version of the data object Ok . A write operation for a data object will write the data object Ok to the write-memory that is the working version of the data object Ok . A certify operation for a data object will move the data object from write-memory to read-memory, and transform the version of the data object from the working version to the consistent version. If the request for a lock is not granted, the task is blocked until the lock request is granted. When a task completes, all of its locks are released. For a hierarchical RAID system (such as the striping technology as shown in above), if one task acquires a read/write/certify-lock on a data object Ok , the task can successfully execute the read/write/certify operation for the data object and all its descendants. For example, when a task acquires the read-lock on a stripe, then it can successfully read all stripe units on the corresponding stripe. When an intention read/write/certify-lock is issued by the task τij on a data object Ok , then the lock prevents other tasks from acquiring any exclusive locks (e.g., write-lock) or share locks (e.g., read-lock) on Ok ’s ancestors. For example, when a task acquires the intention write-lock on a stripe unit, then there is no other task that can write the corresponding stripe which is composed by the stripe unit.
A Distributed Two-Version Multi-Granularity Locking Protocol
7
By the definition of RAID 0, all tasks in the system can be classified into two categories: read-tasks and write-tasks. A task τij is a read-task, if the task does not modify nor write any data objects. On the other hand, a task τij is a write-task, if the task does not read any data objects before any write operation. Consequently, a read-task will only need IR and R locks to execute a read operation. A write-task requires IW , W , IC and C locks to complete a write operation.
3 Distributed Two-Version Multi-Granularity locking protocol In this section, we propose a Distributed Two-Version Multi-Granularity locking protocol (D2VMGT) for the distributed RAID storage environment. The goal of this protocol is to minimize the blocking time of each task so that we may improve the concurrency of operations. Firstly, we show how to adapt multi-granularity of database systems [Gray76] to the RAID system. By using multi-granularity locking, the number of locks needed by a task can be reduced, and simultaneous locking at various granularities by different tasks are allowed. As a result, the blocking time of tasks requesting a lock can be minimized. Then, considering the properties of read and write operations, we minimize the blocking time of read-task by adopting a two-version concurrency control [Bayer80]. The properties of deadlock-free and serializable of the proposed protocol are then proven. To reduce the number of locks needed by a task, we adapt the multigranularity of database systems [Gray76] to the RAID system as follows. We redesign the hierarchical levels of data objects in a RAID system into four levels: stripes, stripe units, pages, and blocks. The stripes and stripe units are as the same as discussed above in a stripe technology. A page is a cache buffer, and a block is the smallest unit of the cache buffer. The main property of multi-granularity under our protocol is: each lock acquired by a task shall be in hierarchy. For example, a block is locked by locking one page containing the blocks, because the page is an ancestor of the block. Inversely, the block is a descendant of the page. A page and stripe unit is locked by locking the corresponding stripe unit and stripe, respectively. A task can successfully acquire a R lock on a data object Ok , only when the task or the corresponding controller acquires IR locks on all ancestors of Ok . Similarly, a task acquires a W lock on a data object Ok , only when the task or the corresponding controller acquires IW locks on all ancestors of Ok . Our protocol, D2VMGT, considers the properties of read and write operations and adapts a different granularity for the two operations. Under D2VMGT, a task can execute a read operation for a data object only when it acquires the read-lock on the corresponding page. Nevertheless, a task can execute a write operation for a data object if it acquires the write-lock on the corresponding block. This is because that when a task acquires a write-lock,
8
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
it has to exclusive access to the locked unit. As a result, we design small write granularity and achieve high concurrency. Moreover, a data object can be shared among tasks when tasks are only executing read operations. The protocol (D2VMGT) uses two-version concurrency control to dynamically adjust task serializability in order to reduce the blocking time of read-tasks. Under D2VMGT, a write-task precedes a read-task only when no data object in the consistent version can be read. To maintain the data correctness under dynamic adjustment of executing orders, all of the new requested locks by tasks under D2VMGT obey the compatibility of locks as shown Table 1 [Bodorik99]. request/locked IR R IW W IC C
IR Y Y Y Y Y N
R Y Y Y Y N N
IW Y Y Y N Y N
W Y Y N N N N
IC Y N Y N Y N
C N N N N N N
Table 1. The Compatibility of Locks
Following the above definitions of multi-granularity and two-version, we now propose the read and write-task scheduling algorithms under our D2VMGT. The read-task scheduling algorithm is as shown in Algorithm 1. By following multi-granularity concurrency control, a read-task τij is first scheduled to acquire IR locks on all ancestors of the needed data object Ok and to acquire the R lock on the data object Ok . However, the data object Ok may be not in the read-memory of the controller ci . In order to reduce search time and the mechanism complexity, the basic data object search order is local controller, other controllers then disks. When the data object is not in the memory of the local controller, the read-task may be blocked by a write-task if they request the same data object. The rationale is that a write-task will lock all copies of the data object. To minimize blocking time of the read-task, the read-task may precede the write-task if the serializability order is maintained. Therefore, there are three cases to be considered: (1) If the data object Ok is not in any controllers, the task τij will be blocked. (2) If the previously scheduled write-task acquired the write-lock, the task τij will continues to be executed. (3) If the previously scheduled write-task acquired the certify-lock, the task τij will be blocked. Notably, if the previous scheduled task is a read-task, then the current read-task τij would not be blocked, because the data object could be shared between the two tasks. We shall give some examples to illustrate these situations in more detail. After reading the data object Ox , the readtask must release all locks on the data object from descendants to ancestors, and no new lock can be acquired before it releases all locks.
A Distributed Two-Version Multi-Granularity Locking Protocol
9
The write-task scheduling algorithm is shown in Algorithm 2. A write-task τij is first scheduled to acquire IW locks on all ancestors of data object Ok and to acquire W locks on all copies of data object Ok . In order to increase concurrency, a write-task only locks the corresponding blocks. To avoid a deadlock when acquiring locks on all copies, the locking order is from the controller with small index to large one (e.g., c1 , c2 , c3 until cN ). After acquiring all necessary locks, a write-task τi writes the data object in working version of the controller ci and the corresponding disk in order. After the write operation is Algorithm 1 Read-Task Scheduling Algorithm 1. A read-task τij is scheduled to acquire IR locks on all ancestors of the needed data object Ok , and to acquire the R lock on data object Ok in the corresponding page. The locks requested by the task must be compatible with any existing lock as shown in Table 1, and follow the hierarchy from ancestor to descendant. 2. After it acquires all locks, task τij is scheduled to find the data object: • If the data object Ok is in the read-memory of the local controller ci , then controller ci returns the data object Ok to the client. • If the data object Ok is not in the read-memory of the local controller ci , a read miss has occurred. – The search order for other controllers is from the controller with small index to large one. When the data object is in the readmemory of controller cj , then cj copies the data object to the local controller ci . – If the data object Ok is not in any of the controllers, then controller ci copies the data object from the corresponding disks to the readmemory. – The other controllers or disks issue an acknowledgement to the local controller ci , after they return the data object to the local controller ci . Before the acknowledgement is received, any task executed on the corresponding controller or disk is blocked. 3. On the condition when a read miss has occurred, and simultaneously there is a previously scheduled write-task that requires the same data object Ok : • If the data object Ok is not in any controllers, τij is blocked until the previously scheduled write-task is completed. • If the previously scheduled write-task acquired a write-lock, τij continues to be executed. • If the previously scheduled write-task acquired a certify-lock, τij is blocked until the write-task is completed. 4. After completing the read operation, τij releases all R and IR locks on the data object Ok and its ancestor. The locks release order is from descendant to ancestor. Task τij is not allowed to acquire a new lock before it releases all locks.
10
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
Algorithm 2 Write-Task Scheduling Algorithm 1. A write-task τij is scheduled to acquire IW locks on all ancestors of the data object Ok , and to acquire W locks on all copies of the data object Ok in the corresponding blocks. The locks requested by the task must be compatible with any existing lock as shown in Table 1, and follow the hierarchy from ancestor to descendant. 2. The task τij requests W locks on all copies of the data object Ok by searching all controllers. The locking order is from the controller with small index to large one, e.g., c1 , c2 , c3 until cN . When a locking request fails, then τij releases all locks and is blocked. 3. A locking request is completed only when the local controller ci receives acknowledgement from the corresponding controller. The task is blocked until all acknowledgements are received. 4. After it acquires all locks, task τij writes data to working version of the controller ci and the corresponding disk, in order. 5. After the write operation is finished, the write-task τij shall convert all IW locks to IC locks and W locks to C locks for committing the data object Ok . At the same time, if any task τpq acquires a R lock on the same data object Ok after τij acquired IW /W locks, τij is blocked until τpq releases the R lock. 6. After completing the write operation, τij releases all locks on the data object Ok and its ancestors. The lock release order is done from descendant to ancestor. Task τij is not allowed to acquire a new lock before it releases all old locks.
finished, the write-task τij shall convert all IW locks to IC locks and W locks to C locks for committing the data object. According to the second condition of rule 3 of Algorithm 1, some read-tasks may acquire a read-lock when τij is writing. Therefore, τij might be blocked until the read-task completes. When the task completes all operations, the task must release all locks on the data object from descendants to ancestors, and no new lock can be acquired before it releases all locks. To illustrate D2VMGT more clearly, an example is shown in Figure 3. There are three controllers c1 , c2 and c3 and one disk. Two tasks τ11 and τ21 are executed in controllers c1 and c2 , respectively. τ11 and τ21 are executed for reading and writing the same data object Ox , respectively. Data object Ox is stored in read-memory of the controller c3 and the disk. The read and write operations caused by a task τij for a data object Ox are denoted as Rij [Ox ] and Wij [Ox ], respectively. At time 0, τ21 arrives, and it sends requests to all other controllers (i.e., c1 and c3 ) to acquire all locks on copies of data object Ox . At time 2, τ21 acquires all locks on Ox successfully and starts to write Ox . The operation is denoted as W21 [Ox ]. At time 4, τ11 arrives. Following that, there is a read miss, because there is no copy of Ox in c1 . According to rule 2 of
A Distributed Two-Version Multi-Granularity Locking Protocol
11
Algorithm 1, τ11 searches Ox from other controllers c2 and c3 in order. At time 6, τ11 acquires the R lock on Ox successfully. Due to the previously scheduled write-task τ21 only acquires W lock, according to the second condition of rule 3 in Algorithm 1, τ11 continues to be executed. Therefore, c3 copies the data object Ox to the local controller c1 for τ11 . The operation is denoted as R11 [Ox ]. At time 14, c3 finishes its copy work and send acknowledgement to c1 , then c1 reads the data object Ox to the client. At time 18, τ21 finishes its write operation and tries to commit. However, τ11 is reading the data object Ox on controller c1 . According to rule 5 of Algorithm 2, τ21 is blocked by τ11 for data correctness. At time 22, τ11 releases the R lock on Ox , and then τ21 is unblocked. τ21 acquires the C lock on Ox , and moves Ox from the working version into the consistent version. At time 28, τ21 releases all locks on Ox .
Fig. 3. Serializability order for R → W
For comparison, we illustrate the other example as shown in Figure 4 for the case of write operations preceding read operations in dynamic adjustment. There are three controllers, one disk and two tasks. τ11 and τ21 are executed, in c1 and c2 , for reading and writing the data object Ox , respectively. In this example, the data object Ox only exists in the disk. At time 0, τ21 arrives, and it sends requests to all controllers to acquire locks on all copies of data object Ox . At time 2, τ21 acquires all W locks successfully and starts to write. At time 4, τ11 arrives, and then searches the data object from other controllers
12
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
Fig. 4. Serializability order for W → R
c2 and c3 in order. At time 6, τ11 finds no data object in the any controllers. According to the first condition of rule 3 in Algorithm 1, τ11 is blocked until the previously scheduled task τ21 completes its write operation. At time 8, τ21 writes the data object to the disk. At time 20, τ21 acquires the C lock to move Ox from the working version to the consistent version. At time 26, the controller c2 copies the data object Ox from local memory to that of controller c1 . At time 32, controller c1 reads Ox to the client. At time 40, controller τ11 finishes its work and releases all locks. Theorem 3.1 D2VMGT is deadlock-free. Proof. In this system, deadlock can only happen between two write-tasks, because read-tasks only need one copy of data. According to rule 2 in Algorithm 2, all tasks will acquire locks in order from the controller with small index to large index. When a lock request is failed, then the task releases all locks. Therefore, there is no deadlock due to hold and wait condition avoidance, as shown in [OS]. Theorem 3.2 All D2VMGT schedules are serializable. Proof. All D2VMGT schedules are serializable if the execution order of a task set exists a total order. According to rule 3 of Algorithm 1, there is only one execution order for each pair of conflicting operations of tasks. Therefore, all D2VMGT schedules are serializable.
A Distributed Two-Version Multi-Granularity Locking Protocol
13
4 Performance Evaluation 4.1 Experiment Setting
CPU Memory OS Fibre Channel Controller SAS Controller Hard Disk
PowerPC SP440 512MB, DDR2, 533MHz Linux Kernel 2.6.14 Agilent Tachyon DX4+,133 MHz PCI-X LSISAS1068 133MHz PCI-X Seagate ST3250624NS
Table 2. Simulation Specifications
This section details the performance evaluation of D2VMGT in terms of the schedulability of tasks, compared to two-phase locking (2PL), two-version concurrency control without granularity (2V) [Bayer80], and multi-granularity (MGT) without two versions [Gray76]. Three performance metrics are evaluated in this paper: tasks per second (TPS), average read response time, and average write response time. Tasks per second (TPS) denotes an average number of requests (tasks) scheduled per second. Each request consists of positioning (logical block address) of the data object and read/write operations with the corresponding data size. Average read (write) response time is used to show a request interval time for this system. The specification of the RAID storage system called RF2 produced by Quanta Computer Incorporation [Quanta] is adopted in the experiments, as shown in Table 2. We use SystemC [SystemC] to model the system architecture, because SystemC provides an environment to enable a synchronous timing model for multi-tasks. Several threads run concurrently to model the controllers, disks and clients in our simulator. In the experimental system model, the number of disks is 4, the stripe unit size is 64 KB, and the cache buffer size is 64 KB. The time parameters for cache miss and disk accessing are measured by the RF2 platform, as shown in Table 3. To simulate a real system more accurately, we test the peak (best), sustained (average) and the worst case of disk seek time and latency time in our simulator. The peak, sustained and the worst case of disk latency time is 500 us, 4160 us and 8000 us, respectively. The peak, sustained and worst case of disk seek time is 500 us, 2660 us and 8000 us, respectively. The workloads in the experiments are generated by the first 200,000 records of the trace collected by Online Transaction Processing (OLTP) at two financial institutions [OLTP]. The trace accessed 1,213,005 logical block address (LBA’s), and the length of read and write ranged from 512B to 48K and 512B to 256K, respectively. The arrival time of each request ranged from 0 to 1669 (second), and the ratio of requests for read operations to that for write operations is 83/17. Each controller of outstanding I/O is 12.
14
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
Read cache hit Read cache miss Write cache hit Write cache miss Write certification Disk latency (Peak/Sustained/Worst) Disk seek (Peak/Sustained/Worst) Inter-controller transfer speed Fibre channel speed Data transfer
27us 54us 40us 60us 60us 500/4160/8000us 500/2660/8000us 500MB 1 Gbps 5us per sector
Table 3. Simulation Parameter
4.2 Experiment Result Figure 5, Figure 6 and Figure 7 show the performance of OLTP trace scheduled by our protocol D2VMGT. They also show the performance results of two-phase locking (2PL); two-version locking concurrency (2V) without multigranularity [Bayer80]; and multi-granularity (MGT) without two-version locking concurrency [Gray76], with different disk performance model. The number of controllers is either 1,2,4 or 8. Figure 5 shows the comparison of tasks per second under various configurations. The horizontal axis is the number of controllers. The vertical axis is the tasks per second (TPS). Figure 5(a) shows the result of the peak case in the disk performance model. The results show that MGT outperformed than 2PL by up to 81%, and outperformed than 2V by up to 66%. This is because that the conflicting of locking was effectively reduced by locking in hierarchical order. D2VMGT outperformed all other algorithms because the two version approach increases utilization of the system resources by reducing blocking time for locks. Disks could not process large requests efficiently and hance the improvement of D2VMGT over others is limited when the number of controllers is larger than 4. Figure 5(b) and Figure 5(c) show the result of the sustained and worst case in the disk performance model. Comparing these three figures, it can be noted that the performance gap decreases as the disk performance declines. This is because that the performance of TPS is dominated by disk seek time and latency time. The reduced blocking time by concurrency improvement is not significant when compare with system performance. However, D2VMGT still outperformed other algorithms in each case. Figure 6 illustrates the comparison of the read response time under various configuration. The horizontal axis is the number of controllers. The vertical axis is the read response time. These experiments showed that both 2V and D2VMGT provided short read response time. It is because they allow for scheduling read-tasks out of order (proceeding before the write-tasks), when
A Distributed Two-Version Multi-Granularity Locking Protocol ˄ˉ˃˃˃ ˄ˇ˃˃˃ ˄˅˃˃˃
˧ˣ˦
˄˃˃˃˃
˅ˣ˟ ˅˩
ˋ˃˃˃
ˠ˚˧ ˉ˃˃˃
˗˅˩ˠ˚˧
ˇ˃˃˃ ˅˃˃˃ ˃ ˄
˅
ˇ ˉ ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
ˋ
(a) Peak Case ˆˈ˃˃ ˆ˃˃˃
˧ˣ˦
˅ˈ˃˃
˅ˣ˟
˅˃˃˃
˅˩
˄ˈ˃˃
ˠ˚˧
˄˃˃˃
˗˅˩ˠ˚˧
ˈ˃˃ ˃ ˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆ (b) Sustained Case ˄ˇ˃˃ ˄˅˃˃
˧ˣ˦
˄˃˃˃
˅ˣ˟
ˋ˃˃
˅˩
ˉ˃˃
ˠ˚˧ ˗˅˩ˠ˚˧
ˇ˃˃ ˅˃˃ ˃ ˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
(c) Worst Case Fig. 5. The task per second for different disk performance model
15
˧˻˸ʳ˔̉˸̅˴˺˸ʳ˥˸˴˷ʳ˥˸̆̃̂́̆˸ʳ˧˼̀˸ʻ̈̆ʼ
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo ˈ˃˃˃ ˇˈ˃˃ ˇ˃˃˃ ˆˈ˃˃ ˆ˃˃˃ ˅ˈ˃˃ ˅˃˃˃ ˄ˈ˃˃ ˄˃˃˃ ˈ˃˃ ˃
˅ˣ˟ ˅˩ ˠ˚˧ ˗˅˩ˠ˚˧
˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
˧˛˸ʳ˔̉˸̅˴˺˸ʳ˥˸˴˷ʳ˥˸̆̃̂́̆˸ʳ˧˼̀˸ʻ̈̆ʼ
(a) Peak Case ˄ˋ˃˃˃ ˄ˉ˃˃˃ ˄ˇ˃˃˃ ˄˅˃˃˃
˅ˣ˟
˄˃˃˃˃
˅˩
ˋ˃˃˃
ˠ˚˧
ˉ˃˃˃
˗˅˩ˠ˚˧
ˇ˃˃˃ ˅˃˃˃ ˃ ˄
˅
ˇ ˉ ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
ˋ
(b) Sustained Case ˧˻˸ʳ˔̉˸̅˴˺˸ʳ˥˸˴˷ʳ˥˸̆̃̂́̆˸ʳ˧˼̀˸ʻ̈̆ʼ
16
ˈ˃˃˃˃ ˇˈ˃˃˃ ˇ˃˃˃˃ ˆˈ˃˃˃
˅ˣ˟
ˆ˃˃˃˃
˅˩
˅ˈ˃˃˃
ˠ˚˧
˅˃˃˃˃
˗˅˩ˠ˚˧
˄ˈ˃˃˃ ˄˃˃˃˃ ˈ˃˃˃ ˃ ˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
(c) Worst Case Fig. 6. The read response time for different disk performance model
˧˻˸ʳ˔̉˸̅˴˺˸ʳ˪̅˼̇˸ʳ˥˸̆̃̂́̆˸ʳ˧˼̀˸ʻ̈̆ʼ
A Distributed Two-Version Multi-Granularity Locking Protocol ˈ˃˃˃˃ ˇˈ˃˃˃ ˇ˃˃˃˃ ˆˈ˃˃˃
˅ˣ˟
ˆ˃˃˃˃
˅˩
˅ˈ˃˃˃
ˠ˚˧
˅˃˃˃˃
˗˅˩ˠ˚˧
˄ˈ˃˃˃ ˄˃˃˃˃ ˈ˃˃˃ ˃
˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
˧˻˸ʳ˔̉˸̅˴˺˸ʳ˪̅˼̇˸ʳ˥˸̆̃̂́̆˸ʳ˧˼̀˸ʻ̈̆ʼ
(a) Peak Case ˄ˋ˃˃˃˃ ˄ˉ˃˃˃˃ ˄ˇ˃˃˃˃ ˄˅˃˃˃˃
˅ˣ˟
˄˃˃˃˃˃
˅˩
ˋ˃˃˃˃
ˠ˚˧
ˉ˃˃˃˃
˗˅˩ˠ˚˧
ˇ˃˃˃˃ ˅˃˃˃˃ ˃ ˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
˧˻˸ʳ˔̉˸̅˴˺˸ʳ˪̅˼̇˸ʳ˥˸̆̃̂́̆˸ʳ˧˼̀˸ʻ̈̆ʼ
(b) Sustained Case ˉ˃˃˃˃˃ ˈ˃˃˃˃˃ ˇ˃˃˃˃˃
˅ˣ˟ ˅˩
ˆ˃˃˃˃˃
ˠ˚˧ ˗˅˩ˠ˚˧
˅˃˃˃˃˃ ˄˃˃˃˃˃ ˃ ˄
˅
ˇ
ˉ
ˋ
ˡ̈̀˵˸̅ʳ̂˹ʳ˖̂́̇̅̂˿˿˸̅̆
(c) Worst Case Fig. 7. The write response time for different disk performance model
17
18
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
the serializable order is maintained. The D2MGT still outperformed 2V because of the multi-granularity concurrency control of D2MGT. Figure 7 illustrates the comparison of the write response time under various configurations. The horizontal axis is the number of controllers. The vertical axis is the write response time. The experiments show that both D2VMGT and 2V had longer average write response time. Comparing Figure 6 and Figure 7, the performance gap of read response times between D2VMGT and MGT was larger than the performance gap of write response time between D2VMGT and MGT. Moreover, the requests on read operations are much larger than that on write operations in a real system, i.e. the ratio of requests of read operations to that of write operations is 83/17. Therefore, D2VMGT outperformed other algorithms in terms of overall system performance (e.g., TPS).
5 Conclusion This paper is motivated by the need of parallelism for I/O requests in storage systems. This paper proposes a distributed two-version multi-granularity protocol to maximize the controller concurrency of storage systems, so that it improves the system performance. We first extend multi-granularity of database systems to RAID storage systems by utilizing a hierarchical structure with stripes, stripe units, cache buffers, and blocks to reduce the number of locks and allow simultaneous locking at various granularities by different tasks. Synchronization based on two versions of data is adopted to favor read operations. The proposed protocol is evaluated over realistic traces with different configurations, and the results showed our proposed algorithms can significantly improve system performance. For future research, we will extend the priority concept into RAID storage systems for urgency requests. We also will explore the multi-version concurrency control for a RAID system to promote utilization of system resources.
References [Bayer80]
R. Bayer, H. Heller, and A. Reiser, “Parallelism and recovery in database systems,” ACM Transaction Database System, vol. 5, no. 2, pp. 139-156, 1980. [Bernstein06] Philip A. Bernstein, Alan Fekete, Hongfei Guo, Raghu Ramakrishnan, and Pradeep Tamma, “Relaxed-currency serializability for middle-tier caching and replication,” In Proceedings of the ACM SIGMOD international conference on Management of data, 2006. [Bhargava90] Bharat Bhargave, Karl Fresen, Abdelsalm Helal, and John Riedl, “Adaptability experiments in the RAID distributed database system,” In Proceedings of the Symposium on Reliable Distributed Systems, 1990.
A Distributed Two-Version Multi-Granularity Locking Protocol [Bodorik99]
[Chu85]
[Desai03]
[Franklin91]
[Franklin92]
[Franklin93]
[Gray76]
[Guo05]
[Iometer] [Kuo03]
[Lam97]
[Lam98]
[Lin90]
[Lin09]
[OLTP]
19
Peter Bodorik, Jacob Slonim, Dawn N. Jutla, and A. Agarwal, “Locking with Different Granularities for Reads and Writes in an MVM System,” In Proceedings of the International Symposium on Database Engineering and Applications, 1999. W. C. Chu and J. Hellerstein, “The exclusive-writer approach to updating replicated files in distributed processing systems,” IEEE Transaction Computers, vol.34, pp. 489-500, 1985. Nirmit Desai and Frank Mueller, “A Log(n) Multi-Mode Locking Protocol for Distributed Systems,” In Proceedings of the International Parallel and Distributed Processing Symposium, 2003. M. J. Carey, M. J. Franklin, Miron Livny, and Engene Shekita, “Data Caching Tradeoffs in Client-Server DBMS Architecture,” In Proceedings of the ACM SIGMOD International Conference on the Management of Data, 1991. M. J. Franklin and M. J. Carey, “Client-Server Caching Revisited,” In Proceedings of the International Workshop on Distributed Object Management, 1992. M. J. Franklin, “Caching and Memory Managernent in Client-Server Database Systems,” Ph.d. Thesis, Department of Computer Science, University of Wisconsin, July, 1993. J. N. Gray, R. A. Lorie, G. R. Putzolu, and I. L. Traiger, “Granularity of locks and degrees of consistency in a shared data base,” In Proceedings of the IFIP Working Conferance on Modeling in DBMSs, 1976. Hongfei Guo, Per-A’ke Larson, Raghu Ramakrishnan, “Caching with ’Good Enough’ Currency, Consistency, and Completeness,” In Proceedings of the international conference on Very large data bases, pp. 457-468, 2005. Iometer Project, http://www.digit-life.com/articles/hddide2k1feb/ iometer.html T. W. Kuo, Y. T. Kao, and C. F. Kuo, “Two-version Based Concurrency Control and Recovery in Real-Time Client/Server Databases,” IEEE Transactions on Computers, vol.52, no.4, pp. 506-524, 2003. K.W. Lam, V.C.S. Lee, and S.L. Hung, “Scheduling Real-Time ReadOnly Transactions,” In Proceedings of the International Workshop Real-Time Computing Systems and Applications, 1997. K.W. Lam, S.H. Son, V.C.S. Lee, and S.L. Hung, “Using Separate Algorithms to Process Read-Only Transactions in Real-Time Systems,” In Proceedings of the IEEE Real-Time Systems Symposium, 1998. Y. Lin and S.H. Son, “Concurrency Control in Real-Time Databases by Dynamic Adjustment of Serialization Order,” In Proceedings of the IEEE Real-Time Systems Symposium, 1990. Yi Lin, Bettina Kemme, Ricardo Jime’nez-Peris, Marta Patin oMarti’nez, Jose’ Enrique Armenda’riz-In igo: “Snapshot isolation and integrity constraints in replicated databases,” ACM Transaction Database System 34(2), 2009. OLTP trace, http://traces.cs.umass.edu/index.php/ Storage/Storage
20 [OS]
Chih-Chung Tsai, Ya-Shu Chen and Tei-Wei Kuo
Abraham Silberschatz, Peter B. Galvin, and Greg Gagne, Operating System Concepts, John Wiley and Sons, 2004. [Panagos97] Euthimios Panagos and Alexandros Biliris, “Synchronization and Recovery in a Client-Server Storage System,” VLDB Journal 6(3), pp. 209-223, 1997. [Patterson88] David A. Patterson, Garth A. Gibson, and Randy H. Katz, “A Case for Redundant Arrays of Inexpensive Disk(RAID),” In Proceedings of the ACM SIGMOD International Conference on Management of Data, 1988. [Peter93] Peter M. Chen, Edward K. Lee, Garth A. Gibson, Randy H.Katz, and David A.Patterson, “RAID:High-Performance, Reliable Secondary Storage,” Technical Report:CSD-93-778, 1993. [Quanta] Quanta Computer Incorporation, http://www. quanta.com.tw/Quanta/chinese/Default.aspx [Shin91] K. G. Shin and C.J. Hou, “Design and evaluation of effective load sharing in distributed real-time systems,” In Proceedings of the IEEE Symposium of Parallel and Distributed Processing, 1991. [SystemC] Open SystemC Initiaive, http://www.systemc.org
A Medical Device Safety Supervision over Wireless Cheolgi Kim1 , Mu Sun2 , Heechul Yun3 , and Lui Sha4 1 2 3 4
University University University University
of of of of
Illinois, Illinois, Illinois, Illinois,
Urbana, Urbana, Urbana, Urbana,
IL IL IL IL
61801, 61801, 61801, 61801,
USA USA USA USA
[email protected] [email protected] [email protected] [email protected]
Summary. Interoperability of medical devices is a growing need in modern healthcare systems, not just for convenience, but also to preclude potential human errors during medical procedures. Caregivers, as end users, strongly prefer the use of wireless networks for such interconnections between clinical devices due to its seamless connectivity and ease of use/maintenance. In [KSM+ 10], we introduced a Network-Aware Safety Supervisior framework to integrate medical devices into clinical supervisory systems using finite state machine (FSM). In this paper, we simplify FSM into Boolean Logic to minimize safety logic overhead and introduce a generic method, called pre-verified safety control (PVSC) framework to integrate medical devices into clinical management systems using wireless technologies that have their safety properties verified in a formal manner. Our method provides (i) a PVSC safety layer that automatically generates the safety engine to guarantee given safety requirements and (ii) an abstracted application development environment so that applications can be developed independent of underlying complications of wireless communication. To mitigate negative effects due to packet losses, the PVSC framework employs a pipelined “pre-planning” of the device controls. The key motivation of the work in this paper is to preserve safety and the application development environment, as is, even after adding unreliable communication media, such as wireless, along with a pre-planning mechanism.
1 Introduction The medical device supervision paradigm recently has a significant transformation in patient monitoring and administration. The importance of medication automation has been increased because of the high cost of health care and high rate of medical accidents. a recent report [Gra07] suggested that of the 284,798 deaths that occurred among patients who developed one or more patient safety incidents between 2003 – 2005, 247,662 were potentially preventable. Hence, there is a need to increase the use of devices that can automaticlly check for safety constraints.
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 2, © Springer Basel AG 2011
22
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
However, automation of medication has another potential problem. The reliability of automation relies on software. Because of its complexity, making software bug free is known to be very challenging work. Since the reliability in such medical system is directly related to human life, the bug in such system is even more critical. Thereby, most medical devices today operate in a stand-alone fashion in the era of communication to avoid complexity. Therefore, we need safety assurance software framework to connect medical devices over networks to decouple safety from the medical devices. Recent initiatives have been launched to increase interoperability of medical devices to reduce medical accidents caused by human errors [Hig09]. One such initiative is the work on the Integrated Clinical Environment (ICE) draft standard [Gol08]. The ICE standard aims to provide integration of data and devices to enable real-time decision support and safety interlocks, thus ensuring patient safety. Wireless technology has recently been proposed, and used, as a communication mechanism to implement medical device interoperability [BH08]. Most of the developments though, have been in the area of medical sensors [cod] (pulse oximeters, EKG monitors, etc.) and also in critical systems such as infusion pumps and pacemakers. The latter set of devices, though comprising of safety-critical aspects, mostly limit themselves to using wireless technology for transmission of non-critical data and for offline analysis. The use of wireless technology in real-time safety-critical applications is complicated by various factors. First, the fact that wireless technologies cannot provide guarantees that transmitted packets will actually be delivered, on time. If some control messages between two devices are lost en route then it could endanger the life of a patient. Second, the safety of the physical system must be guaranteed in a rigorous manner in spite of the failure of the wireless communication mechanism. Third, when using wireless technology in conjunction with medical devices, the quality of medical service must be good enough; a few packet losses should not incur a discontinuity of the medical procedure. Finally, the framework should incorporate abstraction to aid in the process of the development of clinical applications. The complexity of using wireless technology as the underlying communication mechanism should not propagate to the upper layers where clinical control applications are being designed and developed. If the actual communication mechanism is not abstracted away then system architects cannot concentrate on the design of the clinical application logic, thus degrading the overall system. To address these issues, we present a new Pre-Verified Safety Control (PVSC) framework. We proposed such a framework called NASS framework [KSM+ 10] in the form of finite state machine (FSM), but PVSC simplifies the approach by employing Boolean logic instead of FSM. PVSC proposes a reliable control messaging framework and a system-wide protocol for wireless communication that can be used in conjunction with integrated clinical control systems (ICCSs), where the medical device controls are performed through the closed loop, but the safety of the patient can be secured in an
A Medical Device Safety Supervision over Wireless
23
open loop situation. The application logic have no knowledge of the complications of using wireless communication handled by the framework. The basic idea is to deliver messages that set the pre-verified safety controls for a long period of time in the future. Hence, even if messages are lost, the system will be in a predictable state. Furthermore, verifying safety under the general asynchronous environment of wireless communication is non-trivial. An unverifiable system cannot be considered a safe one. Thus, we simplify the analysis by imposing a synchronous control messaging system structure on the system. Furthermore, we describe the standard preverified software architecture blocks that can be automatically generated and deployed for the medical safety. To the best of our knowledge, this is the first such framework that systematically provides the ability to use wireless communication that preserves safety and is grounded in formal guarantees. The main contributions of the PVSC framework are: 1. Preserving Safety: Safety requirements written for an ideal clinical environment (with robust communication scheme) are automatically transformed to the safety validation engine for PVSC framework in wireless networks, thus preserving safety. These are explained in further detail in Section 4. 2. Abstraction: Clinical control applications built on top of the PVSC framework can be developed independent of the underlying complications of wireless communication. The PVSC framework hides these complications from the application logic, as explained in Section 3. The degradation of the quality of service caused by packet drops is unavoidable, but, the PVSC framework is able to minimize such losses. We are also able to achieve a decoupling between the safety and the application logic. Hence, the clinical application development life-cycle becomes shorter while still preserving the safety and real-time constraints. This paper is organized as follows. Section 2 presents the background, benefits and overview of PVSC using an example. Section 3 shows how to hide the complications of wireless communications from the application logic. The safety preserving method by automatic generation of safety validation engine is presented in Section 4. Section 5 briefly introduces our prototype system, and Section 6 presents the related work while Section 7 concludes the paper.
2 Airway-Laser Interlock Example Laser cutters are often used in operating rooms these days. During surgery to the airway5 , if such a laser is used, then there is the potential for fatal burns to the patient if the concentration of oxygen in the airway is high. Hence, 5
The passage by which air reaches a person’s lung
24
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
during such surgery, it is recommended that the oxygen pump connected to the ventilator6 be blocked. Unfortunately, this guideline is sometimes overlooked, and serious, perhaps fatal, injuries occur. The 2006 American Society of Anesthesiologists meeting estimated that roughly 100 such fires occur each year in U.S. hospitals, causing roughly 20 serious injuries and one or two deaths [Mar07]. To prevent such problems, an airway-laser interlock must be enforced by use of an automated ICCS that maintains mutual exclusion between the activities of a ventilator and an airway laser. Hence, whenever an ‘airway laser’ is used, (1) the air path from the oxygen concentrate at the ventilator must be minimized and (2) the oxygen proportion in the airway must be guaranteed to be lower than a predetermined safety threshold. On the other hand, the safety of the patient should not be compromised due to the reduced oxygen flow. A pulse oximeter7 is used to measure the SpO2 (Saturated Peripheral O2 ) during this surgical procedure to track the amount of oxygen in the blood. If the SpO2 readings are below a predefined “watch level,” then the oximeter produces an alarm. The surgeon can then stop using the laser instrument and restore the flow of oxygen between the oxygen concentrate and the ventilator, manually. If the medical personnel ignore such alarms and the SpO2 reaches the lower threshold and is in danger of dropping further, then an automated controller should disable the use of the laser and restart the flow of oxygen again. Hence, the safety requirements of the airway laser interlock are: S1 The airway laser and the oxygen concentrate should not be activated together. S2 The airway laser should not be activated if the proportion of oxygen in the airway is higher than a predetermined threshold (e.g. 25% [Gol09]). S3 If patient’s SpO2 is lower than the lower threshold value, then the oxygen concentrate must be activated through a ventilator. 2.1 PVSC Framework Overview Let us recall the airway-laser example to better understand the control flow of the PVSC framework. The operational sequence of the system in a round is as follows: ① at the end of the previous round acknowledgement packets from participating devices (a PCA pump, an oximeter and a capnometer) have been received by the ICCS manager and delivered up to the virtual devices. These virtual devices update their state information based on the information contained in the packets. According to our measurement results, ② the patient state estimator is not only able to gauge the patient’s current states but also μ future states of control rounds. The patient state estimator generates two kinds of future patient states: strict worst case states for the safety layer, and 6 7
An appliance for artificial respiration An instrument measuring the oxygenated hemoglobin in the blood
A Medical Device Safety Supervision over Wireless
ventilator
| ···]
0 1 … μ PVSCs
se r
(las)
ck
(oxygen)
[pk,k
state report
la
oxygen
(oxy)
ck
state report
PVSCs
PVSC safety layer
at round k...
ICCS manager virtual patient ventilator estimator
(laser)
(laser)
(laser)
virtual laser application
logic
PVSC app. engine
0 1 … μ [pk,k
25
(laser)
| pk,k+1 | · · · | pk,k+µ ] [ak,k
(laser)
(laser)
| ak,k+1 | · · · | ak,k+µ ]
Fig. 1. Control flow example of airway laser interlock
realistic states for the application logic. How to generate them is the out of scope of this paper. Then, ③ each virtual actuator, virtual airway laser in this example, prepares application-planned controls for each rounds k (current round) to k + μ where μ denotes the number of future rounds for which the framework provides (laser) (laser) (laser) (laser) back-up plans, i.e., [ak,k , ak,k+1 , · · · ak,k+μ ]. ak,l denotes an applicationplanned control for the usage allowance of the airway laser for the future (or current) round k generated at round l. The number of future rounds decided at each round, μ, is supposed to be given by system designer based on the system communication characteristics and the system requirements. Application-planned controls are generated by the PVSC application engine that exploits the application logic in which the airway laser’s logical operations are implemented. Recall that application logic is not aware of the planning mechanism of the framework. It is developed so as to operate round-by-round in monotonic time sequence. However, in order to provide back-up plans, the PVSC application engine has to virtually perform setting back a clock at each round. How the PVSC application engine provides an abstracted view of the system to the application logic is discussed in Section 3. Once such application-planned controls are generated ④ the PVSC safety layer verifies their safety properties. The safety-checked sequence of controls (laser) (laser) (laser) are called pre-verified safety controls, denoted by [pk,k , pk,k+1 , · · · , pk,k+μ ] to represent the usage allowance of the airway laser. If the application-planned controls satisfy the safety invariants they are delivered to the device without modification by the safety layer. Otherwise, the layer modifies the necessary control value(s) to ensure safety. The details of how to produce the PVSC safety layer from the invariants and how to enforce safety into the applicationplanned controls are presented in Section 4. A command packet delivers these pre-verified safety controls to a device⑤, the airway-laser or the ventilator in this example. Then, ⑥ the device executes these safety controls thus maximizing the effectiveness of the system for each round. The selection mechanism is explained in Section 3 along with the PVSC application engine.
26
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
3 Provision of Abstraction to Application Logic When the PVSC application engine produces application-planned controls exploiting the application logic, there are two main issues to be addressed. The first one is to hide the planning mechanism from the application logic. To support the planning mechanism, the application engine has to set back a clock at the beginning of each round. When the PVSC application engine generates back-up plans at round k, it produces the plans for the rounds from k to (k + μ). At the next round, the plan generation starts from round (k + 1), setting back a clock from round (k +μ) to round (k +1). However, it should be hidden from the application logic for the simpler development environment. To enable setting back a clock, the PVSC application engine takes a snapshot of the active object of the application logic whenever a control for a round (laser) is generated. At round k, the engine generates ak,k as the first applicationplanned control. Then, it takes a snapshot of the running algorithm, and (laser) requests the next round control, ak,k+1 by running application logic again (laser)
to virtually have the next round. The snapshot of the algorithm after ak,k+1 (laser)
generation is taken, too. This iteration is repeated until ak,k+μ is generated. Because the engine has the full snapshots of the application logic, setting back a clock is obviously realized by recalling an appropriate snapshot. Each snapshot is kept until it becomes useless (i.e. after projected execution round is expired). Another issue is to ensure a single flow of the logic executed by a device. Suppose that a medicine infusion is controlled by an ICCS. The infusion pump always applies the most recently received pre-verified safety control for the infusion, and the application logic proceeds based on the most up-to-date snapshot of the system. Infusion is supposed to be controlled by occasional pumping events rather than a continuous infusion rate. At round 1, the application logic generates application-planned controls, planning the next infusion of the medicine at round 6. This plan is repeated until round 4 by the logic. However, the application logic changes its mind at round 5 to make the next infusion of the medicine at round 7 instead of round 6. Thus, all applicationplanned controls generated from round 6 are changed to have this new plan. However, the infusion pump infused the medicine at round 6 because it has not received the updated decision due to the series of packet losses. Then, it finally received the new plan at round 7, and infused the medicine again according to the updated control. Consequently, the infusion was doubled unintentionally because the pump followed the application-planned controls without checking if the series of decisions are from a single flow of the logic. Algorithm 3 and Algorithm 4 are the pseudo codes for the PVSC application engine and the device control selection to fulfill the single flow requirement, respectively. An application-planned control, a pre-verified safety (·) (·) (·) control and an executed control are denoted by aj,k , pj,k and ck , respectively, where j is the plan generation round, k is (projected) execution round
A Medical Device Safety Supervision over Wireless
27
Algorithm 3 Pseudo code of PVSC application engine Require: Round k has just started (·) Require: px,k−1 is the pre-validated safety control executed by device at round (k − 1). (.) Require: sx,y is application logic snapshot for round-y execution, generated at round x. (·) (·) Ensure: application-planned controls, [ak,k , · · · , ak,k+μ ], are ready for PVSC safety layer if ack. packet at round (k − 1) is delivered then (·) s := sx,k−1 (·)
else s := sk−1,k−1 end if (·) ak,k := s.nextRound(); (mor)
sk,k := s.snapshot(); for i = 1 to μ do (·) (·) ak,k+i := sk,k+i−1 .nextRound(); (·)
(·)
sk,k+i := sk,k+i−1 .snapshot(); end for Algorithm 4 Pseudo code in a device for PSVC selection (·)
Require: Timer for command packet is expired at round k, px,k−1 was executed at last round (·) Ensure: Ack. packet returns x to notify px,k is executed. (·)
(·)
if command packet is delivered and pk,k is generated from the flow of px,k−1 then (·) (·) (·) execute pk,k , which is ck := pk,k x := k (·) (·) (·) else execute px,k , which is ck := px,k end if
and (·) is reserved for a control identification. For more intuitive explanation, let us trace an example execution flow presented in Fig. 2. Each sequence of application-planned controls generated at the same round is grouped by a looped curve, and the controls for the same round executions are vertically aligned by rounds. μ is two, and all controls satisfy the safety requirements, (·) (·) such that pj,k = aj,k . The bold circled application-planned controls are the controls that the device ran at the execution round. (·) At round 1, the device executed a1,1 , after the successful reception of command packet. The acknowledgement packet of round 1 notifies the execution (·) of a1,1 back to the PVSC application engine. Thus at round 2, the PVSC application engine generates the sequence of application-planned controls from
28
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha generated at round 2 (·)
(·)
a3,3
(·)
manager packet delivery device
(·)
a4,4
(·)
3
x
a6,7 (·)
a6,6 (·)
(·)
a3,5
4
(·)
a7,7
a5,6 (·)
a1,3
x
(·)
a5,5
(·)
2
(·)
a4,5
a3,4
controls executed at the device
1
(·)
a4,6 (·)
a2,3
a1,2
execution round
(·)
a2,4
flow relationship generated tree of at round 1 applicationplanned (·) a1,1 a(·) controls 2,2
5
a5,7
6
7
x x
Fig. 2. An example behavior of the PVSC application engine and the related device (·)
the snapshot of a1,1 . The command packet delivery was failed, so the device (·)
executed a1,2 . Unfortunately, this consequence of the command packet failure also failed to be notified back through the acknowledgement packet. As a result, the PVSC engine was not aware of the application-planned control which (·) (·) the device had executed at round 2. As a result, a3,3 was generated from a2,2 (·)
as a default action, which does not match the real executed control, a1,2 . Because of this information gap between the manager and the device, the device (·) (·) reject applying the up-to-date control, a3,3 and used the old one, a1,3 for the single flow requirement. This circumstance was informed back to the manager through the acknowledgement. So the manager produced application-planned (·) control from a1,3 for the next round. Now, the information gap between the manager and the device was filled up. By having this sequence of operations, a single flow of application logic is fulfilled over wireless communications.
4 Auto Generation of Safety Verifier To understand the proposed verifier, readers are referred to [KSM+ 10] for detail of NASS framework. In this section, FSM of NASS framework is transformed into Boolean logic. The section describes and justifies the safety verifier. Control information, planned by application designers and generated by the NASS application engine, flows down to the NASS safety layer for the safety assurance. As mentioned previously, the safety requirements are expressed as Boolean-invariants. The NASS safety layer that guarantees the safety of the controls, regardless of packet losses or network disconnections, is automatically generated from these invariants. Consider the safety requirements from S1–S3 given in Section 2. These requirements can be formally expressed by safety invariants as
A Medical Device Safety Supervision over Wireless (laser)
ck
(oxygen)
∧ ck
= false
(1)
(laser) (oxygen) ck ⇒ lowk (SpO ) (oxygen) ¬safek 2 ⇒ ck (laser)
29
(2) (3) (oxygen)
where ck is the allowance of the laser activation ck is the enabling (oxygen) is the Boolean indicator if the of the oxygen concentrate pathway lowk concentration of oxygen in the airway is lower than the given threshold, and (SpO ) safek 2 is the Boolean indicator if patient’s SpO2 level is higher than the warning level at round k Eq. (1), (2) and (3) represent S1, S2 and S3, respectively. 4.1 Safety Invariants The safety invariants are composed of a set of control propositions A and a set of environmental event propositions E. In the airway-laser example, (SpO ) (oxygen) (laser) (oxygen) , ck ∈ A and lowk , safek 2 ∈ E. We abstract we have ck (SpO ) (oxygen) and safek 2 Boolean propositions from continuous values; e.g. lowk are abstracted from continuous values of oxygen concentration, and measured SpO2 . It is well known from logic that a set of Boolean sentences can be transformed into one sentence in conjunctive normal form (CNF). For example, CNF of Eq. (1)–(3) is given by (laser) (oxygen) ∨ ¬ck φlaser (A, E) ¬ck (4) (SpO ) (laser) (oxygen) (oxygen) ∧ ck ∧ ¬ck ∨ lowk ∨ safek 2 Let φ denote the sentence in CNF transformed from safety invariants. A sentence φ in CNF can be represented by a conjunction set (Φ) having disjunctions as the elements. The safety sentence φ in CNF, and its conjunction set Φ has the relationship of θ(A, E). φ(A, E) ⇔ θ∈Φ(A,E)
We have the conjunction powerset of φlaser given in Eq. (4): (laser) (oxygen) (laser) (oxygen) ∨ ¬ck , ¬ck ∨ lowk , Φlaser (A, E) = ¬ck (SpO ) (oxygen) ∨ safek 2 ck
(5)
4.2 Finding an Open-Loop Safe State The first step of the safety verifier generation is to find the open-loop safe states of the system. If a system does not have an open-loop safe state, the
30
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
safety cannot be guaranteed when the network of the system is totally disconnected. Finding open-loop safe states is finding the safety bias of each control. (laser) In the airway laser example, the safety bias of airway laser ck is false be(laser) from Eq. (5), which means no disjunccause no disjunction in Φlaser has ck (laser) = false. However, tion becomes more restrictive by the assignment of ck the oxygen concentrate cannot have safety bias from conjunction set Φlaser (SpO ) (oxygen) (oxygen) because disjunction ck ∨ safek 2 has ck while another disjunc(laser) (oxygen) (oxygen) (laser) tion ¬ck ∨ ¬ck has ¬ck . Suppose that we have ck = false. (laser) (oxygen) (laser) ∨ ¬ck is cleared by ck . Then, the condiThen, disjunction ¬ck (oxygen) becomes true, depending on the assignment of tional safety bias of ck (laser) (oxygen) = false. We call it a conditional safety bias and ck is called to be ck (laser) safety-biased depending on ck . (a) If one control proposition, ck is safety-biased depending on another con(b) (b) (a) trol proposition, ck , ck must be decided first and then ck should follow. (laser) is decided first to the contrary of the above claim. If Suppose that ck (laser) (oxygen) is assigned to be false, ck ’s safety bias is in trouble. no control ck (oxygen) (laser) decision of ck guarantees the safety of φlaser . Thus, to decide ck first, (oxygen) it has to look ahead the disjunctions related to the depending control ck (laser) in run time. Otherwise, ck must be assigned false for the global system safety, which is a too restrictive choice. This looking ahead is not required if (oxygen) ck is decided first according to the order of the dependency. (α) Algorithm 5 presents the algorithm finding the open-loop safe state, ssafe of each control proposition, which is the safety-bias, and the control decision order by finding the safety-bias dependencies. L is the list of control propositions in the control decision order as an output of the algorithm. Because, the dependencies between control propositions does not generate a single decision order of controls, we recommend the designers to input preferred control decision order manually. The repeat-until loop finds the safety-bias of controls, and their dependencies. If there is circular dependencies among control propositions, their safety-biases cannot be found and the loop is terminated. An example of a circular dependency is: (1)
(2)
(1)
(1)
(2)
(1)
φcircular (ck ∨ ¬ck ∨ ek ) ∧ (¬ck ∨ ck ∨ ek ) (1)
(2)
(1)
(6)
where ck and ck are control propositions, and ek is a environment proposition. In this case, the algorithm can declare a failure, or optionally the user can enforce the algorithm to find any possible open-loop safe state by having exhaustive search. By the enforcement, the open-loop safe states for φcircular (1) (2) (1) (2) will be found to be either ck = true, ck = true or ck = false, ck = false. However, we do not recommend the enforced search for the open-loop safe state. When there are circular dependencies among control variables, the con-
A Medical Device Safety Supervision over Wireless
31
Algorithm 5 Find Safety Bias Relationship(Φ, A) Ensure: L(out): list of controls in control decision order Ensure: Φ = ∅ or procedure fails repeat for all α ∈ A { A in preferred decision order} do Φold = Φ Θα := {θ ∈ Φ | α ∈ θ}; Θ¬α := {θ ∈ Φ | ¬α ∈ θ} if Θ¬α = ∅ then (α) ssafe := true L := [α; L]; A := A \ {α}; Φ := Φ \ Θα else if Θα = ∅ then (α) ssafe := false L := [α; L]; A := A \ {α}; Φ := Φ \ Θ¬α end if end for until Φ = Φold if Φ = ∅ then Declare failure or Exhaustively search for the open-loop safe states end if trol decision order has an inverse dependency. As we have seen in the example (laser) (oxygen) and ck , the inof inverse dependency of the safety-bias between ck version requires traverse of inverse dependencies, or pessimistic decision of the controls. Because the dependency traversal is NP-hard because analyzing all disjunctions related to the circular dependency is identical to the SAT problem. To have practical run-time algorithm, our safety verifier takes the (laser) pessimism. (Recall that ck = false is the solution of pessimism for inverse dependency.) Because this pessimism may not be what the user wants, we recommend ‘declaring failure’ when the loop has not found the full safety biases. If a failure occur, the user can review the invariants and fix them. In our experiences, all medical interlocks having open-loop safe states have successfully completed with this algorithm. 4.3 Safety Engine Generation When the NASS safety layer generates pre-verified safety controls, it has to ensure the safety in all possible scenarios. The generated controls at each round can be executed altogether by the connected devices. But sometimes, the controls that are generated at the various rounds can be executed by the devices at a round. Therefore, the safety verifier of the NASS safety layer has to ensure that the generated pre-verified safety controls be always safe when they are mixed with previously generated pre-verified safety controls that are possibly effective in the devices. If this joined safety is ensured with the
32
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
previously generated controls. By mathematical induction to the execution round, the safety of NASS execution is ensured.8 From Algorithm 5, the controls have the decision precedence. For the con(d) (d) (d) venience of the analysis, ck , pj,k and aj,k denotes the executed control, preverified safety control and application-planned control of the control decided (1) (oxygen) (2) (laser) in d-th precedence in the safety engine. E.g. ck ck and ck ck . The number of devices is denoted by n. 2
3
4
(·) p1,2
(·) p1,3
(·) p1,4
(·)
(·)
(·)
k=1 (·) P1,k (·)
P2,k
(·) p1,1
(·) P4,k
6
(·)
ssafe
p2,2 p2,3 p2,4 p2,5
(·)
P3,k
5
7
···
(·)
suppose that the only ack. packet was received(·) at round 2 saying p1,2 is used at the round 2
(·)
(·)
nil
(·) (·) p3,3 p(·) 3,4 p3,5 p3,6 (·)
(·)
(·)
p4,4 p4,5 p4,6 ···
(·)
p4,7
elements of Hj − ,k
(d)
(d)
Fig. 3. Semantic of Pj,k and Hj − ,k (d)
The pre-verified safety controls for a control d, pj,k , is explicitly defined (d)
only when k − μ ≤ j ≤ k. We extend this values of pj,k to be defined over (d)
every combination of j and k with Pj,k , such that
(d) Pj,k
⎧ ⎪ ⎨nil p(d) j,k ⎪ ⎩ (d) ssafe
if j > k, if j ≤ k ≤ j + μ, if k > j + μ
(7)
where nil is the empty command as depicted in Fig. 3. Recall that the acknowledgement packet has the round information of the most recently executed NASS. See the example in Fig. 3. The manager (d) received acknowledgement packet at round 2 saying that p1,2 is executed by the device at round 2. Then, the latest effective generation round that the manager knows is round 1. Let βjd denote the latest effective generation round. (d)
Then, the set of the effective NASS at the beginning of round j, Hj − ,k is bounded by j−1 (d) (d) Pi,k (8) Hj − ,k ⊂ (d)
i=βj−1
βjd for j > 1 in this example is 1. but acknowledgement delivery round is 2. Then we know that all NASS generated at round 2 is not effective because 8
As the basis of induction, the safety of all rounds are ensured at the beginning of operations by all devices being in the open-loop safe states forever.
A Medical Device Safety Supervision over Wireless
33
the device informed that it used NASS generated at round 1 even after round 2 command packet is delivered. From this intuition, we have (d)
Hj − ,k = P
(d)
where γj
(d) (d)
βj−1,k ,k
∪
j−1
(d)
Pi,k
(9)
(d) i=γj−1 +1
is the most recent round at which an acknowledgement packet was (d)
received about control (d). While Hj − ,k denotes the set of the still effective (d)
NASSs before the NASS generation at round j, Hj + ,k denotes the set of the still effective NASSs after the generation, such that (d)
(d)
(d)
Hj + ,k = Hj − ,k ∪ Pj,k
(10)
Consequently, the safety verifier must ensure that any control proposition (1) (2) (n) combination of Hj + ,k × Hj + ,k × · · · Hj + ,k satisfies safety statement φ. Let us define another statement, φˆ to check if the whole combinations satisfy such that
φˆ S (d1 ) , S (d2 ) , · · · , S (dn ) , E
(11) ⇔ ∀x ∈ S (d1 ) × S (d2 ) × · · · × S (dn ) , φ(x, E) where S (dd ) denotes a non-empty set of Boolean values that can be applied for control (d). φˆ receives the tuple of sets of Boolean values rather than the tuple of Boolean values, for the control propositions. φˆ is defined by φˆ
S (d1 ) , S (d2 ) , · · · , S (dn ) , E
worst θ, S (d1 ) , S (d2 ) , · · · , S (dn ) , E
(12)
θ∈φ
where
worst θ, S (d1 ) , S (d2 ) , · · · , S (dn ) , E θ(·, E)
∨ ∀a(d) ∈ θ, false ∈ / S (dd ) ∧ ∀¬a(d) ∈ θ, true ∈ / S (dd )
(13)
The definition of φˆ in Eq. (13) obviously derives Eq. (11) because φˆ checks if there is a combination of control propositions killing any disjunction, and that combination violates φ if there is one. The safety verifier algorithm is presented in Algorithm 6. The algorithm (d) (d) employs the function safety-check j,k aj,k presented in the middle of proof by Eq. (19)
34
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
Algorithm 6 The safety verifier (1)
(n)
Require: all effectiveness control decisions, aj,j · · · aj,j+μ for k = j to j + μ do (d) for all aj,k as effectiveness controls in order do (d) (d) if safety-check j,k aj,k = true {from Eq. (19)} then (d)
(d)
pj,k = aj,k (d)
(d)
else pj,k = ¬aj,k end if end for end for
Lemma 1 Algorithm 6 always generates pre-verified safety controls guaranteeing the safety invariants. Proof. The proof is by mathematical induction. Basis:
(1) (2) (n) ˆk−μ−1,k φˆ Hk−μ−1+ ,k , Hk−μ−1+ ,k , · · ·, Hk−μ−1+ ,k , E = true
(14)
ˆj,k is the worst case estimations of environmental propositions prowhere E (d) vided by patient state estimator. The basis is satisfied because Hk−μ+1+ ,k = (d)
(d)
(d)
{ssafe } from Pm,k = ssafe if m < k − μ. The safety invariants are always safe if all controls are open-loop safe state regardless of the environmental variables. Inductive step: For inductive step, we prove: if the following holds:
(1) (2) (n) ˆj−1,k = true, (15) φˆ Hj−1+ ,k , Hj−1+ ,k , · · · , Hj−1+ ,k , E the following also holds: (1) (2) (n) ˆ φˆ Hj + ,k , Hj + ,k , · · · , Hj + ,k , E j,k = true.
(16)
As a intermediate step from Eq. (15) to Eq. (16), we have (1) (2) (n) ˆ φˆ Hj − ,k , Hj − ,k , · · · , Hj − ,k , E j,k = true
(17)
(d)
(d)
because we have Hj − ,k ⊂ Hj−1+ ,k for every device (d) from the fact that an incoming acknowledgement packet gives more information on the device side, and can drop some previously effective NASSs, but cannot add additional
A Medical Device Safety Supervision over Wireless
35
ˆ j−1,k is always more pessimistic than E ˆ j,k beeffective NASSs. Moreover, E , , cause of the nature of strict worst-cases. (1) (2) (n) Algorithm 6 must produce the series of [pj,k , pj,k , · · · , pj,k ] making Eq. (16) be satisfied from the assumption of Eq. (17). The proof of the correctness of the NASS generation is also shown by mathematical induction. The correctness of (1) Basis is given by Eq. (17) because it is the initial state before control pj,k has not been produced yet. In the algorithm, control variables are verified one-byone in the given dependency order. As an induction step, we assume that all of the NASS of the previously decided devices before device (d), satisfy the safety invariants such that (d−1) (1) (1) (2) (2) (d-1) φˆ Hj − ,k ∪ pj,k , Hj − ,k ∪ pj,k , · · · , Hj − ,k ∪ pj,k , (d) (d+1) (n) ˆj,k = true. (18) Hj − ,k , Hj − ,k , · · · , Hj − ,k , E (d)
Algorithm 6 checks the following function for aj,d : (d) (d) (1) (1) (2) (2) Hj − ,k ∪ pj,k , Hj − ,k ∪ pj,k , safety-check j,k aj,k φˆ (d−1) (d-1) (d) (d+1) (n) ˆj,k · · · , Hj − ,k ∪ pj,k , aj,k , Hj − ,k , · · · , Hj − ,k , E
(19)
(d) (d) and the decision of the function safety-check j,k aj,k is projected to the pre(d)
verified safety control, pj,k such that (d) (d) (d) if safety-check j,k aj,k = true aj,k (d) pj,k = (d) ¬aj,k otherwise.
(20)
In Eq. (17), the first case is trivial because the fact that the function (d) (d) (d) safety-check j,k aj,k is true is that the effectiveness control, aj,k is safe with any possible combinations of other controls decided until the decision (d) (d) of pj,k . The point is if ¬aj,k can be applied for the safety assurance when (d)
(d)
safety-check j,k rejects aj,k . (d)
(d)
(d)
(d)
(d)
If aj,k ∈ Hj − ,k , aj,k passes safety-check j,k (aj,k ) because of Eq. (18). If (d)
(d)
(d)
(d)
/ Hj − ,k , it may not pass the filter. However, Hj − ,k = {¬aj,k } is derived aj,k ∈ (d)
(d)
(d)
/ Hj − ,k because Hj − ,k is not an empty set, but a set with Boolean from aj,k ∈ (d)
(d)
(d)
(d)
values. Thus, from Eq. (18), and Hj − ,k = {¬aj,k }, ¬aj,k satisfy the filter if aj,k does not. Consequently, the verifier of Eq. (20) always generates pre-verified safety controls satisfying the safety. (n) After the last control, pj,k is decided, we have (1) (1) (2) (2) φˆ Hj − ,k ∪ pj,k , Hj − ,k ∪ pj,k , · · · , (n) (n) ˆj,k = true (21) Hj − ,k ∪ pj,k , E
36
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha (d)
(d)
(d)
by induction. Because Hj + ,k = Hj − ,k ∪ pj,k , we are aware that Eq. (16) holds. The devices in the real world experience some delay in actuation, so the states do not immediately change as our current representation shows. We have extended our algorithm to cover the case of time delays in actuation also. S1’ Between the activities of airway laser and oxygen concentrate, 1 s guard time is required. The safety invariant for S1’ is given by (oxygen)
ck
(laser)
∧ cl
= false if |k − l| < Δ1s
(22)
where Δ1s is the number of rounds per second. This kind of delay dependent safety invariant can employ our safety engine as long as the pre-verified period is longer than the time duration required to be checked. Compensating for delay requires a minor change in the filter function by expanding the potential states of a device at round j to also include states from all previous rounds between j − Δ1s and j. 4.4 Case Study of Safety Layer Operations
(oxygen)t
aj,k
f (laser) t aj,k f
(oxygen) t
ck
(laser) ck
f t f
(oxygen) t
ck
(laser)
ck
f t f
(oxygen) t
ck
(laser)
ck
f t f
(µ = 1) (µ = 1) µ=0
Fig. 4. Example operational sequence of airway-laser interlock case
We have simulated the original airway-laser interlock case given in Section 2. Fig. 4 shows the simulated results of the airway-laser example sequences. There is no packet loss and all environments are estimated to be safe
A Medical Device Safety Supervision over Wireless
37
for all instances in the simulation. The sequence ① presents the application logic output. The application logic wants to turn on the laser at round 8 and to turn off the laser at round 16. For these operations, it wants to pause the oxygen concentrate for the same duration of the laser activation. Suppose that μ = 1 and all these application decisions are planned one round ahead (② of Fig. 4). Then, at round 7, the application logic generates the (oxygen) (laser) application-planned controls for round 8 to be a7,8 = false, a7,8 = true. (oxygen)
After safety layer processing, the NASSs for round 8 become p7,8 (laser) p7,8
= false. The reason why
(laser) p7,8
= false is that
(oxygen) c8
= false,
can become
(oxygen) , ssafe
if all command packets until round 8 are dropped. true, which is However, the following packet exchanges were successful in reality, and the planned controls at round 8 are the same as the previous round. Then the (oxygen) (laser) (oxygen) NASSs become p8,8 = false, p8,8 = true because ssafe is not an option for round 8 any more. Then, the devices flip their states together at round 8. If the application decides the state flipping at the flipping rounds, the behaviors of the devices are like sequence ③. In this case, the application(oxygen) (oxygen) = p7,8 = true planned controls and the NASSs at round 7 are a7,8 (laser)
(laser)
= p7,8 = false without being aware of flipping of the next round and a7,8 at round 7. At round 8, the application changes its mind and generates the (oxygen) (laser) = false and a8,8 = true. However, the safety engine plan, such as a8,8 (laser)
(oxygen)
because p7,8 = true, which can be employed by the disallows a8,8 device at round 8, making conflict. Thus, the laser is allowed after the oxygen concentrate is cleared. Even though the safety engine delays the operations, it is the best for the guaranteed safety.
5 Prototype System We have implemented a prototype of the PVSC framework in our medical tested. Our testebed consists of three computers connected through a private IEEE 802.11g wireless network in a non–line-of-sight configuration in 5 m distances to demonstrate operating room scenario. One computer served as the ICCS manager and the others demonstrate device controls, sometimes connected to experimental medical devices such as infusion pumps. We have implemented the synchronous communication layer in conjunction with the PVSC framework. The round duration is set to 100 ms and command packets are supposed to come in 40 ms from the beginning of a round. Acknowledgement packets must be received before the end of a round. μ was set to be 20. The packet drop rate was 0.24% during 9 hours of experiments. The maximum number of consecutive rounds with series of packet drops was 11 (i.e. for 1.1 s) but mostly less than 5. The safety of the system was ensured as designed. The software environment is Java2 Runtime Environment 1.5.0 and we em-
38
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
ployed [Cri89] for clock synchronization between the ICCS manager and the devices. The application logic is developed as using robust communications. Even though the packet drop rate was quite low, some noticeable consecutive rounds had series of packet losses. If we use the time difference between the control generation and the execution as the quality of service metric, we found that the PVSC framework has served quite optimized quality of service to the devices adapting itself. At the most of rounds (99.76%) when the channel condition was good, the devices apply the controls made at the same round. Only when there are packet losses, the devices used some aged controls. And that ages of controls were identical to the number of consecutive rounds without delivered packets.
6 Related Work Our work is motivated by the on going initiative of Medical Device Plug-andPlay [Gol09]. We proposed a framework, called NASS framework [KSM+ 10], for the same purpose of this paper in the form of finite state machine (FSM), but PVSC simplifies the approach by employing Boolean logic instead of FSM. This initiative has been quite active for the past ten years resulting in the ISO/IEEE 11073 family of communications standards [SFWS07], healthcare alliances such as Continua, and specification alliances such as Bluetooth and ZigBee. Although wireless technology is readily available inside current medical devices [BH08], few have been used for control. The techniques of deploying safe interoperability in medical devices (wired or wireless) have only recently gained momentum. Arney et. al demonstrated synchronization techniques of medical devices with an X-ray and a ventilator [AJJ+ 07]. Fischmeister et. al. applied their work for the Network Code Machine [FSL07] to be deployed in medical systems providing verifiable real-time performance demonstrated in HIMSS ’08. Software architectures for communications in medical plug-andplay systems have also been explored by King et. al. [Ke08] using publishsubscribe architectures for dynamic information flow. Currently, much of the work for medical plug-and-play focus on estabilishing dynamic connectivity of devices, device-to-device synchronization, and ensuring fair access to a communication medium not focusing on enforcing generic types of safety constraints with the addition of wireless. On the other end of the spectrum, medical device safety has been a very prevalent issue dating back to the infamous incidents in the 80’s involving the Therac 25 radiation therapy machines [LT93]. Since then, much work has been done to apply formal methods to medical devices analysis [AJJ+ 07, RC04, AAG+ 04]. The use of formal methods may even start to influence actual medical device review procedures [JIJ06]. However, much of the formal analysis work has been done on individual devices without any
A Medical Device Safety Supervision over Wireless
39
interoperable behavior between a network of devices. We have taken the initiative to move forward in this direction.
7 Concluding Remarks It is important to provide the best convenience to caregivers for patient safety in a health-care environment; providing wireless connectivity for medical devices is one of them. We presented the pre-verified safety control framework interconnecting and managing medical devices through wireless with guaranteed safety and high quality of service. Even though this framework is based on a non-trivial pipeline planning method, all of the complications are hidden from the application logic by the application engine. The provable safety verifier is automatically generated from the given safety invariants in Boolean logic. From our prototype, we found the application logic and the end devices are well protected from external flaws and complications by applying the NASS framework in Boolean logic. Furthermore, the quality of the communication support was also decent.
References [AAG+ 04] Rajeev Alur, David Arney, Elsa L. Gunter, Insup Lee, Jaime Lee, Wonhong Nam, Frederick Pearce, Steve Van Albert, and Jiaxiang Zhou. Formal specifications and analysis of the computer-assisted resuscitation algorithm (CARA) Infusion Pump Control System. International Journal in Software Tools for Technology Transfer, 4, 2004. [AJJ+ 07] David Arney, Raoul Jetley, Paul Jones, Insup Lee, and Oleg Sokolsky. Formal Methods Based Development of a PCA Infusion Pump Reference Model: Generic Infusion Pump (GIP) Project. In Proc. of Joint Workshop on HCMDSS-MDPnP, Jun. 2007. [BH08] Steven D. Baker and David H. Hoglund. Medical-grade, mission-critical wireless networks. IEEE Engineering in Medicine and Biology Magazine, Mar./Apr. 2008. [cod] CodeBlue: Wireless Sensors for Medical Care. http://fiji. eecs.harvard.edu/CodeBlue. [Cri89] Flavin Cristian. A Probabilistic Approach to Distributed Clock Synchronization. In Proc. of ICDCS, Jun. 1989. [FSL07] Sebastian Fischmeister, Oleg Sokolsky, and Insup Lee. A Verifiable Language for Programming Real-Time Communication Schedules. IEEE Trans. on Comp., 56(11), Nov. 2007. [Gol08] Julian Goldmann. Medical Devices and Medical Systems — Essential safety requirements for equipment comprising the patient-centric integrated clinical environment (ICE) — Part 1. draft ASTM TC F29.21 N 21, Sep. 2008.
40 [Gol09]
Cheolgi Kim, Mu Sun, Heechul Yun, and Lui Sha
Julian Goldmann. Medical Device Interoperability to Enable System Solutions at the Sharp Edge of Healthcare Delivery. White House Homeland Security Council Biodefense Directorate Conference presentation, Apr. 2009. [Gra07] Health Grades. Fourth Annual Patient Safety in American Hospitals Study, 2007. [Hig09] High Confidence Software and Systems Coordinating Group. HighConfidence Medical Devices: Cyber-Physical Systems for 21st Century Health Care. A Research and Development Needs Report, NITRD, Feb. 2009. [JIJ06] Raoul Jetley, S. Purushothaman Iyer, and Paul L. Jones. A Formal Methods Approach to Medical Device Review. IEEE Computer, 39(4), Apr. 2006. [Ke08] Andrew King and et. al. An Open Test Bed for Medical Device Integration and Coordination. Technical report, Kansas State University, 2008. [KSM+ 10] Cheolgi Kim, Mu Sun, Sibin Mohan, Heechul Yun, Lui Sha, and Tarek F. Abdelzaher. A framework for the safe interoperability of medical devices in the presence of network failures. In Proc. of ICCPS, pages 149 – 158, April 2010. [LT93] Nancy Leveson and Clark Turner. An Investigation of the Therac-25 Accidents. IEEE Computer, 26(7):18–41, July 1993. [Mar07] Adam Marcus. Once a Tech Fantasy, Plug-and-Play OR Edges Closer to Reality. Anesthesiology News, 33(1), Jan. 2007. [RC04] Arnab Ray and Rance Cleaveland. Unit verification: the CARA experience. International Journal on Software Tools for Technology Transfer, 2004. [SFWS07] L. Schmitt, T. Falck, F. Wartena, and D. Simons. Novel ISO/IEEE 11073 Standards for Personal Telehealth Systems Interoperability. In Proc. of Joint Workshop on HCMDSS-MDPnP, 2007.
A Novel Memory-Aware CPU Allocation Policy for Multicore NUMA Architecture Dongwoo Kang1 , Heekwon Park2 , and Jongmoo Choi3 1
2
3
School of Computer Science Engineering, Dankook University, Yongin, Korea, 448-701,
[email protected] School of Computer Science Engineering, Dankook University, Yongin, Korea, 448-701,
[email protected] School of Computer Science Engineering, Dankook University, Yongin, Korea, 448-701,
[email protected], Corresponding Author
Summary. Recent computer systems, ranging from mobile systems to servers, are employing multicore processors such as Intel’s Xeon, AMD’s Opteron and ARM’s Cortex-A9. Also, to reduce bus contention among multiple cores and DRAMs, they adopt the NUMA (Non-Uniform Memory Access) memory organization, wherein each core has direct path to its own local memory, leading to access local memory faster than remote memory. These trends of computer architecture trigger to rethink the internal structures and policies of today’s operating system. In this paper, we design a new memory-aware CPU allocation policy for multicore NUMA architectures that has the following three features. First, it makes a CPU allocation decision based on not only CPU load but also memory load, which enables to decrease the possibility of referencing remote memory. Second, it applies different weight on CPU load and memory load hierarchically and adaptively according to the types of CPU allocation requests. Finally, it utilizes the characteristics of processes such as CPU intensity and memory intensity to accurately estimate the CPU and memory load of each core. Real implementation based experimental results have shown that the proposed memory-aware CPU allocation policy can actually enhance the execution time of applications, compared with the traditional Linux CPU allocation policy.
1 INTRODUCTION One of the recent trends of computer architecture is employing multiple cores. Intel has already demonstrated a 32nm-based six-core processor, named the Core i7 processor, and has a plan to provide an eight and more cores processor [1]. AMD also has released new the Opteron architecture with 8 and 12 cores on each processor [2]. Even in the embedded system domains, ARM has developed the Cortex-A9 multicore processor, consisting of 4 ARM CPUs with low power-consumption features [3]. When we equip two or more processors in computer systems, we can easily configure tens or hundreds of CPUs as our computing resources. S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 3, © Springer Basel AG 2011
42
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
As the number of cores increases, the possibility of bus conflicts between multiple cores and DRAMs also increases. To mitigate the bus conflicts, NUMA (Non Uniform Memory Access) memory organizations are popularly adopted in multicore systems, such as Intel’s Nehalem QPI(QuickPath Interconnect) [1] and AMD’s Hypertransport technologies [2]. In these organizations, the access latency of remote memory is slower than that of local memory. Therefore, placement of processes and data among local and remote memory become critical for obtaining high performance like as in GPGPU (General Purpose Graphical Processing Unit) architecture [4]. These architectural trends require to revisit the internal structures and policies of today’s operating systems [5] [6]. In this paper, we investigate a novel memory-aware CPU allocation policy for multicore NUMA architectures. To begin with, we have made two observations on real Intel Xeon 8 cores (2 processors) NUMA systems. The first observation is that the latency differences between local and remote memory are quite large, which gives a negative effect on the execution time of a process when it references remote memory frequently. The second observation is that the performance degradation of memory-bound processes is much larger than that of CPU-bound processes when they are allocated on the same core. From the observations, we design a new CPU allocation policy that has the following three features. The first one is that, it makes a CPU allocation decision based on not only CPU load but also memory load so that it can maximize the CPU and memory load balancing simultaneously. The memory load balancing gives an opportunity to diminish the number of accesses for remote memory. The second feature is applying different weight on CPU load and memory load hierarchically and adaptively according to the types of CPU allocation requests. In particular, it gives more weight on CPU load for the CPU allocation request at the process creation time (i.e.. sys fork( )), while more weight on memory load for that at the process loading time (i.e.. sys execve( )). Finally, it utilizes characteristics of processes such as CPU intensity and memory intensity to estimate accurately CPU load and memory load of each core. The proposed CPU allocation policy has been implemented on Linux kernel version 2.6.32, based on the hardware platforms consisting of Intel Xeon X5570 8 cores (2 processors), 32GB DDR3 DRAM, 4TB SAS Disk, and peripherals. The 32GB DRAM is divided into two memory units where the first processor uses one unit as local memory and the other as remote memory, and vice versa. Experimental results with three benchmarks have shown that the proposed policy can actually enhance the execution time of each benchmark, compared with the traditional Linux CPU allocation policy. The rest of this paper is organized as follows. In the next section, we discuss the motivation of this work. Then, we explain the design issues and implementation details in Section 3. In Section 4, we present the performance evaluation results and finally, we conclude this paper in Section 5.
A Novel CPU Allocation Policy for Multicore NUMA Arch.
43
2 MOTIVATION In this section, we discuss two observations conducted on the Intel Xeon 8 cores (2 processors) NUMA system that motivate our research. We first explain the structure of the experimental system briefly, and then elaborate how it affects the performance of Linux kernel. Fig 1 depicts the structure of the Intel Xeon multicore NUMA system considered in this paper. It consists of 2 processors, each of which in turn consists of 4 cores (in this paper, we use the terms of CPU and core interchangeably). According to the interrelation between cores and DRAMs, multicore system can be classified into two categories, one is the UMA(Uniform Memory Access) organization and the other is the NUMA(Non-Uniform Memory Access) organization.
Fig. 1. Multicore NUMA architecture
In UMA, all cores can access any memory address at the same latency. On the contrary, in NUMA, some memory banks are connected directly to a processor or processors, while others are connected through the interconnection technology such as Intel’s QuickPath Interconnect and AMD’s HyperTransport. In the example of Fig 1, processor 0 can access memory 0 directly, while accessing memory 1 through the interconnection technology. Directly accessible memory is defined as local memory while other memory is defined as remote memory. In Fig 1, memory 0 and memory 1 become local memory and
44
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
remote memory, respectively, for a processor 0 and vice versa, for a processor 1. Note that although we can equip more processors and DRAMs and construct more complex interconnected multicore NUMA systems, the concepts of local and remote memory and our suggestions of this paper are still valid in such systems. The first observation is measuring the latency differences between local and remote memory quantitatively and analyzing the performance effects of multicore NUMA architecture on operating systems. For this purpose, we have ported the Linux kernel version 2.6.32 on our experimental system and have executed a synthetic application that accesses data with the size of 128MB sequentially. Then, we have measured the total elapsed time of the application when data is allocated on local memory and remote memory, respectively, as shown in Fig 2.
Fig. 2. Latency differences between local memory and remote memory
From Fig 2, we can observe that the latency of remote memory is quite slower than that of local memory. On average, read accesses for remote memory takes 1.6 times longer than those for local memory, while write accesses takes 1.5 times longer. The results reveal some performance aspects of operating system on multicore NUMA systems. One aspect is that a process might have considerable performance degradation if operating system allocates page frames for the process from remote memory. The other aspect is that a naive
A Novel CPU Allocation Policy for Multicore NUMA Arch.
45
CPU allocation policy and/or process migration policy across multiple processors for CPU load balancing may cause a bunch of remote memory references, causing nontrivial performance deterioration. Our second observation is the scalability of multiple processes on multicore NUMA systems. For this experiment, we have built two different types of synthetic applications. One is a CPU-bound application that executes several mathematical operations intensively and the other is a memory-bound application that allocates 32MB memory space and executes memory read/write operations repeatedly. Then, we have created various numbers of processes where each process executes the CPU-bound or memory-bound application independently and have measured the average runtime of processes, as shown in Fig 3. Note that we carefully configure the runtime of each application as 1 second to plot the graph of Fig 3 more intuitively. Also note that, in this experiment, memory space requested by each process is allocated only from its local memory so that we can focus on scalability analysis purely without the effects of remote memory references.
Fig. 3. Scalability of CPU-bound and Memory-bound processes
Fig 3 illustrates that CPU-bound processes show better scalability than memory-bound ones. Let us discuss the results of the CPU-bound processes first. When the number of processes increases from 2 to 8, the average runtime of each process is constantly 1 second, the same as the runtime of the CPU-bound application. This is because there are 8 cores in the experimental
46
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
system, as depicted in Fig 1, and each core can execute each process concurrently. When the number of processes becomes 16, the average runtime becomes 2 seconds since each core needs to run two processes with an interleaving fashion. These trends continue as shown in Fig 3. As the number enlarges twice, the time also increases twice. On the contrary, memory-bound processes show a relatively poor scalability. As we expect, the addition of processes leads to increase the average runtime of processes. However, the increasing ratio of memory-bound processes is larger than that of CPU-bound processes, even though all processes access local memory only. Observations from Fig 2 imply that the increasing ratio becomes much larger if some processes begin to access remote memory. It indicates that, in multicore NUMA architecture, memory contention might be more critical than CPU contention to achive good performance. In other words, we need to consider carefully not only CPU load balancing but also memory load balancing for designing efficient CPU allocation policies.
3 DESIGN AND IMPLEMENTATION Based on the observations discussed in Section 2, we design a new memoryaware CPU allocation policy. The key feature of the proposed policy is that it makes a CPU allocation decision by using both CPU load and memory load. Traditionally, the conventional CPU allocation policies make use of CPU load only since they are mainly focusing on the UMA memory organization [7] [8]. However, our policy exploits memory load together to reduce the number of remote memory references. Also, there are two additional features in our policy. First, to reflect the characteristics of processes such as CPU-bound and memory-bound, we define CPU intensity and memory intensity of a process and apply them to estimate CPU load and memory load of each core. Secondly, for CPU allocation, we give a different weight on CPU load and memory load hierarchically and adaptively according to the allocation request type. 3.1 Estimate CPU load and Memory load Traditionally, operating systems make their CPU allocation decisions based on CPU load only and one of the commonly used techniques for estimating CPU load of a core is counting the number of processes in the run queue assigned to the core. However, for better CPU allocations in multicore NUMA systems, it needs to contemplate the characteristics of processes as discussed in Fig 3. To reflect this requirements, we introduce two new attributes of a process, which are CPU intensity and memory intensity. CPU intensity is a concept to represent how much actively a process utilizes CPU resources. In this paper, we define it as the ratio between the possible time slice allotted to a process and the actual used time slice. Formally,
A Novel CPU Allocation Policy for Multicore NUMA Arch.
47
it can be expressed as follows: Ci (k) =
ConsumedT S(k) AllocatedT S(k)
(1)
where Ci (k) is the CPU intensity of a process k, and AllocatedTS(k) and ConsumedTS(k) are the allocated time slice allowed to consume and the actually consumed time slice at the last execution, respectively. For instance, when a process, that has the allocated time slice of 100 milliseconds , actually consumed 40 milliseconds at the last scheduled time, the CPU intensity of the process becomes 0.4. Similarly, memory intensity is defined as how much working set a process has. It can be expressed as follows: Mi (k) =
U sedP F (k) P roportionalShareP F (k)
(2)
where Mi (k) is the memory intensity of a process k and UsedPF(k) is the number of page frames currently used by the process. Also, the ProportionalSharePF is the average number of page frames possibly allocated to a process if all processes use page frames fairly. It can be calculated by dividing the total number of page frames in a system with the current number of processes. As an example, if there are 1000 page frames and 5 processes in a system and a process is currently using 40 page frames, then the memory intensity of the process is 0.2. The introduction of CPU intensity and memory intensity enables to estimate CPU load and memory load of a core through the following two formulas: Cload (i) =
N
Ci (k)
(3)
Mi (k)
(4)
k=0
Mload (i) =
N k=0
where Cload (i) and Mload (i) are CPU load and memory load of a core i, respectively, and k (range from 0 to N) are the processes assigned to the core. For example, let us assume that a system has two cores and each core has three processes. Also assume that each process is described with the two parameters of (allocated time slice, consumed time slice), and the three processes on the first core are (100, 20), (100, 20) and (100, 50), while the other three processes on the second core are (100, 20), (100, 10), (200, 60). Then, CPU load of the first core is 0.9, while that of the second core is 0.6. From these estimates, we can recognize that the first core has higher CPU load than the second core. Note that by estimating from the number of processes or from the total execution times of processes, we can not differentiate CPU loads among the cores.
48
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
As an another example, assume that the system described at the previous paragraph has total 1200 page frames and the three processes of the first core currently use 40, 80, 40 page frames while the other three processes of the second core use 20, 160, 40 page frames, respectively. Then, memory intensity of the first core is 0.8 while that of the second core is 1.1. These estimates enable to identify how much memory space a core currently uses and how the potentiality of a core to allocate page frames from remote memory is. Note that the working set size of a process can be changed during the execution. However, decent operating systems can adapt the changes well using a variety of page allocation and replacement techniques [7] and we conjecture that measuring the current resident page frames of a process is sufficient to estimate memory intensity for our memory-aware CPU allocation policy. 3.2 Hierarchical and Adaptive CPU allocation Now the question is how to make use of the estimated CPU load and memory load for CPU allocation. One simple way is just adding the two loads and choosing a core that has the smallest sum of the loads. However, since CPU load and memory load represent distinct characteristics of a process and, in general, a system has different capacity of CPU and memory resources, it needs to give a different weight on the two loads. For this purpose, we devise a new formula that is expressed as follow: CMload (i) = α · Cload (i) + (1 − α) · Mload (i)
(5)
where CMload (i) is the weighted combination of CPU load and memory load of a core i and α is a control parameter ranging from 0 to 1. The role of the control parameter α is determining the weight on CPU load and memory load. Specifically, as α approaches 1, the policy gives more weight on CPU load and, eventually when α is equal to 1, it considers CPU load only. On the contrary, as α goes to 0, the policy gives more weight on memory load and, finally it reflects memory load purely when α is equal to 0. There are two feasible approaches to decide the appropriate value of the parameter α. The first one is choosing the value that can minimize the average response time of all processes on a system. It’s kind of an optimization problem, finding the best solution with the consideration of given conditions such as number of processes, characteristics of each process, and CPU and memory capacities. The second approach is exploiting operating system heuristics such as scheduling level and request types that can provide useful hints to determine the value of α. In this paper, since the second approach can be practically implemented in real operating systems and executed on-line without considerable overheads, we select the second approach and leave the first one as a future work. To explore useful operating system heuristics, we first analyze the scheduling behaviors of Linux kernel. Fig 4 presents the scheduling mechanism used
A Novel CPU Allocation Policy for Multicore NUMA Arch.
49
Fig. 4. Scheduling infrastructure in Linux Kernel
in Linux kernel, where CPU allocation is conducted hierarchically at two levels, one is a node domain level and the other is a CPU domain level. Linux kernel uses a data structure, called sched domain, which arranges CPUs in a hierarchy depending on physical hardware organizations [10]. In the NUMA organization, the sched domain consists of several node domains, and each node domain, in turn, consists of a set of CPUs that have the same viewpoint about local and remote memory. In other words, we can regard the node domain as the processor depicted in Fig 1. The traditional CPU allocation policy in Linux kernel chooses a CPU using the following three steps: 1) trying to choose the same CPU, 2) trying to choose a CPU from the same node, 3) selecting the most idlest CPU from all nodes. Before elaborating these steps in detail, we define some terms first. The original CPU of a process is defined as the CPU where the process has run on at the previous execution. Similarly, the original node of a process is defined as the node that contains the original CPU of the process. For instance, assume that a process was executed on CPU 2, then the original CPU and node of the process are CPU 2 and node 0, respectively in Fig 4. The final term is the weight of a process in Linux kernel. In the Linux kernel version 2.6.23 and later, every process has its weight value depending on its priority. As an example, if a process has the default priority of 120, Linux kernel assigns 1024 into the process as the weight of the process. Also, it assigns 1.25 times larger weight value into a process with the priority of 119 higher value, and vice versa [11].
50
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
Now, let us elaborate the three steps of the traditional CPU allocation policy used in Linux kernel. At the first step, it tries to allocate the original CPU to achieve CPU cache affinity and to minimize process migration overheads. Specifically, it adds up the weights of all processes on the original CPU and, if the value is lower than a threshold value, it allocates the CPU to the process. Otherwise, Linux kernel regards the CPU as too congested and goes into the second step. The default value of the threshold is set as 1024 in Linux kernel. At the second step, it tries to allocate a CPU from the original node. In specific, it selects a CPU with the least sum of weights of processes from the original node. When the value is lower than the threshold value, the CPU is allocated to the process. The reason of this trial is to execute a process at the same node, which enable to reduce the number of remote memory accessing. If it fails to select a CPU at the second step again, it moves into the final step. Here, it chooses a node that has the least sum of weights of processes among nodes. Then, it selects a CPU that has, again, the least weighted number of processes from the chosen node. In Linux, the find idlest group() and the find idlest cpu() functions take care of the choice of a node and a CPU, respectively. From the analysis of the CPU allocation mechanism in Linux kernel, we notice that CPU allocation is carried out hierarchically at the two levels, one is the node domain level and the other is the CPU domain level. Also, we find out that the two levels have quite antithetic requirements. At the node domain level, memory load might be more important for CPU allocation. This is because recent developed multicore NUMA systems provide almost identical CPU capabilities among nodes, while they show considerably differences of memory latencies among local and remote memory. On the contrary, at the CPU domain level, CPU allocation based on memory load does not give any performance differences since all CPUs in a node have the same memory configuration. These findings trigger us to design a new CPU allocation policy that gives more weight on memory load at the node domain level and CPU load at the CPU domain level. These controls are possible using the formula 5) with various values of α. In this paper, we set α as 0 at the node domain level while setting it as 1 at the CPU domain level. Setting α as 1 at the CPU domain level is reasonable since memory load does not bring any differences at this level. However, setting α as 0 at the node domain level could be controversial and there might be more appropriate value. There are two reasons for our setting. One is that as the number of cores increases, CPU becomes comparatively abundant resources. The other, and more substantial, reason is that, after the node domain level, we still have another chance to reflect CPU load at the CPU domain. Analyzing the effects of α with various values is left as a future work. In addition to the hierarchical adaptation, we apply CPU load and memory load differently according to the types of CPU allocation requests. In Linux kernel, CPU allocation is requested mainly by the three sources; pro-
A Novel CPU Allocation Policy for Multicore NUMA Arch.
51
Fig. 5. Linux Kernel internals for CPU allocation
cess creation (sys fork), process image loading (sys execve), and load balancing (load balance), as shown in Fig 5. We carefully examine the behaviors of the three request types and design appropriate CPU allocation procedures for each type, as described pseudo code in Algorithm7. The process creation request, denoted as sys fork in Algorithm 7, creates kernel data structures such as task, file and mm structures, and makes the new child process and the original parent process share memory images (text segment is actually shared, while data segment is shared through the copy-on-write mechanism). Hence, when the child and parent processes are assigned into different nodes, one of them needs to access remote memory frequently, which incurs performance degradation. To overcome this problem, we need to assign the child process into the same node of the parent process. Hence, we choose statically the node of a parent process as a candidate node. Then, we select a CPU from the candidate node with α = 1(consider CPU load only). On the other hand, the process loading request discards the existing memory images and brings in new program images from disks. Since the discarding makes it free to assign the process into whether local or remote memory, it’s a good chance to enhance memory load balancing. Therefore, we first select a node with α= 0 (consider memory load only). Then, we choose a CPU from the selected node with α= 1.
52
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
Algorithm 7 CPU Allocation algorithm N ODE ← {node1 , node2 , . . . , nodei } CP U [i] ← {cpu1 , cpu2 , . . . , cpuk }
The set of all nodes The set of all CPUs in node of i
Require: node id ∈ N ODE Require: x ∈ CP U [node id] x is set of CPUs in node of i procedure Select CPU(node id,α) Select a CPU in the node id domain that has the smallest CMload with the parameter α candidate cpu ← 0, smallest cmload ← ∞ while all x do We have the answer if r is 0 if smallest cmload > CMload (x) then candidate cpu ← x smallest cmload ← CMload (x) else end if end while return candidate cpu The idlest cpu number end procedure Require: i ∈ N ODE Require: j ∈ CP U [i] procedure Select Node(α) Select a node that has the smallest CMload with the parameter α candidate node ← 0, smallest cmload ← ∞ while all i do weights ← 0 while all j do weights ← weights + CMload (j) if weights < smallest cmload then candidate node ← i smallest cmload ← weights end if end while end while return candidate node end procedure procedure select task rq(request type) CPU allocation main function, applying CPU and memory loads adaptively and hierarchically candidate node ← 0 if request type = sys f ork then candidate node ← parant node candidate cpu ← Select CP U (candidate node, 1) else if request type = sys execve then candidate node ← Select N ode(0) candidate cpu ← Select CP U (candidate node, 1) else request type = load balance if process remote memory > process local memory then candidate cpu ← Select task rq(sys execve) else candidate cpu ← Select task rq(sys f ork) end if end if return candidate cpu end procedure
A Novel CPU Allocation Policy for Multicore NUMA Arch.
53
The final request type is load balancing. The load balancing gives a positive performance effects by migrating processes from congested CPUs into idle CPUs. However, especially in NUMA systems, it may cause performance degradations due to the increasing of remote memory references when a migration is conducted across nodes. So, we need to carefully consider the tradeoffs. In this paper, if a candidate process for load balancing has more page frames in local memory, we handle it like the process creation request so that the process is allocated into the same node. Otherwise, we handle it like the process loading request so that the process can be allocated into a node with the least memory load. We have implemented the proposed memory-aware CPU allocation policy in Linux kernel version 2.6.32. Table 1 summarizes the modified files and their descriptions. Table 1. Implementation Summary
Modified File Descriptions sched.c
1) Add two new variables for manipulating CP Uload and memoryload in the run queue of each CPU (struct cfs rq) 2) Add two new variables for manipulating Ci and Mi of a process (struct task struct) 3) Measure the allocated time slice and the consumed time slice sum exec runtime and (sched slice(), prev sum exec runtime in struct sched entity) sched fair.c 1) Implement the proposed memory-aware CPU allocation functions described in Algorithm 7. 2) Update Ci and CP Uload and Mi and Mload when a process put in or get out of the run queue of a CPU (put prev task(), pick next task()) mm.h 1) Measure the used page frames and Mi of a process. ( file rss and anon rss in struct mm struct)
For implementing the proposed policy, we need to measure several process information such as the allocated time slice, the consumed time slice, and the resident page frames of a process. Fortunately, such information can be obtained from the existing data structures and functions, which allows to implement our policy without considerable overheads to gather information
54
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
and without impairing the portability of Linux kernel. Also, we make use of several lightweight CPU load and memory load monitoring techniques such as hashing and pre-calculation to minimize runtime overheads. One concern we have in the implementation of the propose policy is the overhead for communication between user processes and Linux kernel. For example, assume that Linux kernel runs in a node 0 of Fig 4. Then, a process that runs in a node 1 might have some performance degradation due to the communication between kernel and the process such as system calls and data copies. To mitigate this problem, we consider that the policy first tries to allocate CPUs from the node where Linux kernel runs on, if the number of processes on the node is less than a controllable threshold value. However, this choice does not give any performance benefits. Sensitivity analysis has shown that Linux kernel has already provided the replications of kernel images both on local and remote memory to overcome the problem [11]. As a result, we omit this consideration from the current implementation.
4 PERFORMANCE EVALUATION We have evaluated the performance of the proposed memory-aware CPU allocation policy on a real system. The experimental system consists of Intel Xeon X5570 8 cores (2 processors), 32GB DDR3 DRAM, 4TB SAS Disk, and peripherals. On this hardware platform, we have executed three benchmarks, named nbench, STREAM, and lmbench . The nbench is designed to expose the capabilities of CPU and memory in a system [12], while the STREAM is used for testing sustainable memory bandwidth in high performance systems [13]. Finally, the lmbench is a suite of applications for measuring bandwidth and latency of various UNIX functionalities such as context switching, file system, memory, and network management [14]. Fig 6 and 7 shows the experimental results of the nbench and STREAM benchmarks, respectively. In each figure, x-axis represents the number of processes executing the benchmark independently while y-axis is the average runtime of processes. Our CPU intensity and memory intensity measurements suggest that the nbench can be categorized as a CPU-bound application while the STREAM as a memory-bound application. Hence, the nbench shows a relative better scalability than the STREAM in multicore NUMA systems, also as observed in Fig 3. In addition, we can notice that, for the STREAM benchmark, the proposed policy provides better performance than the conventional Linux kernel policy, by reflecting not only CPU load but also memory load for CPU allocation decisions. For the nbench benchmark, both policies show comparable results since it is a CPU-bound application. Fig 8 depicts the performance evaluation results when we run the nbench and STREAM benchmarks concurrently with the various number of processes. The goal of this experiment is analyzing the effect of the proposed policy when
A Novel CPU Allocation Policy for Multicore NUMA Arch.
Fig. 6. nbench benchmark results
Fig. 7. STREAM benchmarks results
55
56
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
there exist heterogeneous applications together. The results also show that our proposed policy performs better than the conventional one. We expect that when we apply not only the CPU load and memory load but also the characteristics of a process such as CPU-bound and memory-bound into CPU allocation decisions, we can obtain more performance improvements.
Fig. 8. nbench and STREAM benchmarks results
Fig 9 shows the lmbench results. The lmbench benchmark consists of a set of applications testing a specific part of UNIX operating systems such as process management latency, networking latency, memory read/write bandwidth, context switching latency, STREAM latency, and memory read latency. In this experiment, we create processes ranging from 2 to 64 where each process executes an application independently. The results display that some applications such as memory read/write bandwidth and STREAM latency gain performance benefits from our policy, while other applications does not show marginable performance differences. Detailed analysis reveals that the latter applications are mainly CPU-bound, which leads to little performance differences. Our final experiment is the possibility of applying process characteristics on CPU allocations. In this experiment, we have run several processes, one half executes the nbench application (a CPU-bound application) and the other half
A Novel CPU Allocation Policy for Multicore NUMA Arch.
57
Fig. 9. lmbench benchmark results
executes the STREAM application (a memory-bound application). Then, we devise three CPU allocations, namely Node-bias, CPU-bias, and CPU-unbias, as described in Fig 10. The Node-bias allocation statically assigns CPU-bound processes into one node and memory-bound processes into the other node, separately. In the CPU-bias allocation, each core with even number has CPUbound processes only while other core with odd number has memory-bound processes. Finally, in the CPU-unbias allocation, each core has both CPUbound and memory-bound processes evenly. The results have shown that the Node-bias allocation performs the worst since assigning memory-bound processes into the same node causes a lot of remote memory accesses and the bus contentions. Interestingly, the CPU-bias allocation shows better performance than the CPU-unbias allocation, implying that, in the same node, assigning same characteristic processes into the same CPU might reduce the bus contentions among CPUs. Currently, we are investigating this issue more closely with a logic analyzer that can measure the bus contentions quantitatively.
5 CONCLUSION In this paper, we have proposed a new memory-aware CPU allocation policy. Using CPU intensity and memory intensity of a process, it estimates
58
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
Fig. 10. Applying process characteristics on CPU allocations
CPU load and memory load of a core and applies them for CPU allocation decisions hierarchically and adaptively. Implementation based experimental results have shown that the proposed policy indeed enhances the response times of benchmarks. As the popularity of multicore NUMA systems increases in computer architecture areas, operating system researchers also study internal structures and policies related to the systems including scheduling [15] [16] [17] [18] [19], synchronization [20] and energy efficiency [21]. Our proposal is one of those studies, addressing CPU allocation issues to reduce the number of remote memory references. We are considering two research directions as future works. One direction is analyzing the optimal value of the control parameter α under the various conditions such as number of processes, characteristics of each process, and CPU and memory capabilities. Another direction is conducting more thorough quantitative experiments with diverse benchmarks.
A Novel CPU Allocation Policy for Multicore NUMA Arch.
59
Acknowledgement This research was supported by National IT Industry Promotion Agency(NIPA) under the program of Software Engineering Technologies Development and Experts Education.
References [1] [2] [3] [4]
[5]
[6]
[7] [8] [9]
[10] [11] [12] [13] [14] [15]
[16] [17]
Intel Multi-core Technology, http://www.intel.com/multi-core/. AMD Magpy-Cours, http://developer.amd.com/zones/ magnycours/Pages/default.aspx. ARM Cortex-A9 processor, http://www.arm.com/products/ processors/cortex-a/cortex-a9.php. Sunpyo Hong and Hyesoon Kim: An Analytical Model for a GPU Architecture with Memory-level and Thread-level Parallelism Awareness. in Proceeding of the 36th Annual International Symposium on Computer Architecture (ISCA), pp. 152-163, (2009) Burton Smith: Many-core Operating System Challenges and Opportunities. in the 3rd Workshop on the Interaction between Operating Systems and Computer Architecture, (2007) Joab Jackson: Multicore chips require OS rework, Windows architect advises. InfoWorld, http://www.infoworld.com/d/developer-world/multicorechips-requires-os-rework-windows-architect-advises-182. (2010) Andrew S. Tanenbaum: Modern Operating Systems. 3rd edition, Pearson Prentice Hall (2009) Wolfgang Mauerer: Professional Linux Kernel Architecture. WILEY. (2008) M.Tim Jones: Inside the Linux 2.6 Completely Fair Scheduler. IBM Research Center, http://www.ibm.com/developerworks/linux/library/lcompletely-fair-scheduler (2009) Martin J. Bligh, Matt Dobson, Darren Hart, Gerrit Huizenga: Linux on NUMA Systems. in the Proceedings of the Linux Symposium (2004) Changes in the Linux Scheduler as of 2.6.23, http://gustavus.edu/+max/osbook/updates/CFS.html. nbench, http://www.tux.org/ mayer/linux/bmark.html STREAM benchmark, http://www.cs.virginia.edu/stream. Carl Staelin: lmbench - an extensible micro-benchmark suite. HP Laboratories Israel (2004) Tong Li, Dan Baumberger, David A. Koufaty and Scott Halm: Efficient Operating System Scheduling for Performance-Asymmetric Multicore Architecture. in the SC conference (2007) M. Correa, A. Zotzo and R. Scheer: Operating System Multilevel Load Balancing. in the ACM SAC conference, pp 1467 1471 (2006) Rafeal Chanin, Monica Correa, Paulo Fernandes, Afonso Sales, Roque Scheer, Avelino F. Zorzo: Analytical Modeling for Operating System Schedulers on NUMA systems. Electronic Notes in Theoretical Computer Science, 131 149 (2006)
60
Dongwoo Kang, Heekwon Park, and Jongmoo Choi
[18]
Joseph Antony, Pete P. Janes, and Alistair P.Rendell: Exploring Thread and Memory Placement on NUMA Architectures: Solaris and Linux, UltraSPARC/FirePlane and Opteron/HyperTransport. High Performance Computing (2006) Mathieu Faverge, Pierre Ramet: A NUMA Aware Scheduler for a Parallel Sparse Direct Solver. Workshop on Massively Multiprocessor and Multicore Computers (2009) Christoph Lameter: Effective Synchronization on Linux/NUMA Systems. Gelato Conference (2005) Andreas Merkel and Frank Bellosa: Memory-aware Scheduling for Energy Efficiency on Multicore Processors. in the workshop of 2008 USENIX Hotpower (2008)
[19]
[20] [21]
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms Xuefeng Piao1 , Heeheon Kim1 , Yookun Cho1 , Sangchul Han2∗ , Minkyu Park2 , Monju Park3 , and Seongje Cho4 1
2
3
4
School of Computer Science and Engineering, Seoul National University, Korea, {hbpark,hhkim,cho}@os.snu.ac.kr Department of Computer Science, Konkuk University, Korea, {schan,minkyup}@kku.ac.kr Department of Computer Science and Engineering, University of Incheon, Korea,
[email protected] Division of Information and Computer Science, Dankook University, Korea,
[email protected]
Summary. Upon multiprocessor platforms, global EDZL is known to be at least as effective as global EDF in scheduling task sets to meet deadlines, but there has been no research on power-aware EDZL scheduling. In this paper, we firstly address the problem of reducing energy consumption of real-time tasks on EDZL scheduling by lowering processor speed. An off-line algorithm and an on-line algorithm are proposed to reduce energy consumption while guaranteeing a hard real-time constraint. Then we show the effectiveness of our algorithms through extensive simulation.
1 Introduction In the future, embedded systems such as smart phones will undertake complex real-time applications. The workload will be heavy and vary with changing demand of the real world, which causes real-time task to be created and deleted dynamically. In such an environment, multiprocessor architecture will be dominant in embedded systems to guarantee short response time, and global scheduling is preferable to partitioned scheduling because it enables dynamic task management and easy cross-processor migration. On the other hand, since battery-operated real-time embedded devices such as portable and mobile devices have common limitation in power supply, energy consumption is also one of the important design parameters. To reduce energy consumption in real-time scheduling, DVS (Dynamic Voltage Scaling) techniques have been introduced to exploit the hardware characteristic of processors by lowering processor supply voltage or speed. Since the energy ∗
Corresponding Author
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 4, © Springer Basel AG 2011
62
Xuefeng Piao et al.
consumption of processors is almost quadratically proportional to processor speed, a small reduction in processor speed can result in a significant reduction in energy consumption. The objective of power-aware scheduling is slowing down processor speed without missing any deadlines of real-time tasks. In the past years, many power-aware algorithms have been proposed in partitioned scheduling. Aydin et al. [2] firstly attempt to incorporate poweraware scheduling of periodic tasks into multiprocessor systems. For framebased task model, where all tasks arrive at the same time and share a common deadline, polynomial time approximation algorithms were proposed to resolve the power-aware scheduling problems upon identical and heterogeneous multiprocessor platforms [7, 15]. In [8], observing that tasks might complete earlier than their worst-case execution times, a slack reclamation algorithm was proposed in which tasks are reassigned to processors dynamically to slow down processor speed on heterogeneous multiprocessor. In contrast to partitioned scheduling, however, there are a few studies on power-aware scheduling in global approach. Anderson et al. [1] addressed the system syntpohesis problem of periodic tasks on identical multiprocessor for global fpEDF scheduling [5]. Under EDF(k) scheduling, that is a variant of well-known EDF scheduling algorithm and strictly dominates5 EDF [11], an off-line and an on-line algorithms were presented by N´elis et al. upon identical multiprocessor platforms in which each processor can adjust execution speed independently [13]. In this paper, we propose power-aware algorithms for global EDZL (Earliest Deadline Zero Laxity) scheduling [9]. Although global EDZL is known to outperform global EDF [4, 14], no work has been conducted for reducing energy consumption in EDZL scheduling. We propose an off-line and an online algorithms for EDZL scheduling upon multiprocessor platforms, where all processors operate at the same speed. The rest of this paper is organized as follows. Sect. 2 defines the system model and Sect. 2.1 briefly reviews the schedulability conditions of EDF and EDZL. The proposed off-line and on-line algorithms are presented in Sect. 3.3. Sect. 5 shows our simulation results and Sect. 5 concludes this work.
2 System Model We consider a preemptive hard real-time system in which periodic tasks are scheduled by EDZL upon a multiprocessor platform composed of m identical processors running at an identical speed. We assume that the maximum processor speed, denoted by Smax , is 1 and that the processor speed can be adjusted continuously within the range [0, 1]. This is as the same as the assumption in [15]. 5
A scheduling algorithm A1 is said to strictly dominate another scheduling algorithm A2 if any task set schedulable by A2 is also schedulable by A1 and there is a task set which is schedulable by A1 but not schedulable by A2 .
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
63
Fig. 1. The worst-case interference of a task τi on a task τk where τi = τk
A periodic task set τ = {τ1 , τ2 , . . . , τn } consists of n independent periodic tasks. A periodic task τi is characterized by (ei , pi ), where ei represents a worst-case execution time at the maximum processor speed and pi represents a period. We assume that the relative deadline of each task is equal to its Ui = ei /pi , the period. The utilization of τi , denoted by Ui , is defined as n total utilization of τ , denoted by U (τ ), is defined as U (τ ) = i=1 Ui , and the maximum utilization of τ , denoted by Umax , is defined as Umax = maxτi ∈τ (Ui ). An execution instance of τi , denoted by Ji , is called as a job which is characterized by (ωi (t), Di ), where ωi (t) represents a remaining execution time at time t and Di represents an absolute deadline. The laxity of Ji at time t, denoted by i (t), is defined as i (t) = Di −t−ωi (t)/S where S is the normalized speed at time t.
3 EDZL schedulability conditions vs. EDF schedulability condition For the schedulability of EDZL, Cirinei and Baker [10] proposed a sufficient condition6 to determine whether a given task set is schedulable or not by EDZL. Then they proposed an improved schedulability analysis of EDZL that uses a tighter bound on the interference of tasks [4]. In the following, we briefly describe the iterative method of EDZL-schedulability test adapted to our model. Figure 1 shows the worst-case interference of a task τi over a task τk (τi = τk ), where slb i represents the lower bound on slack of the interfering task τi . The lower bound on slack of a task is the minimum time interval between finishing time and absolute deadline of all jobs of the task. For task τk , the worst-case competing work contributed by any interfering task τi , denoted by Wik , is defined as Wik = ni ei + min(ei , pk − slb i − ni pi ), 6
Kato et al. [12] reported that the sufficient condition has a pitfall and slightly revised the condition.
64
Xuefeng Piao et al.
where ni = (pk − slb i )/pi . The total competing work of all interfering tasks over the τk , denoted by Wk , is defined as Wk = min(Wik , pk − slb i − ek ). i=k
At the beginning of schedulability test, the lower bound on the slack of each task is initialized to zero and the lower bound on the slack of a task τk is computed by slb k = pk − ek −
1 min(Wik , pk − ek ). m i=k
If an obtained lower bound on the slack of a task is positive, the bound is used to compute a lower bound on the slack of another task, and so on. In this way, the slack is iteratively refined for each task, using at each round the tighter values derived at preceding steps. Once the given task set is confirmed to be schedulable, the iteration is broken. Otherwise, the iteration is continued until no further slack is updated [4]. Theorem 1 (Baker et al. [4] and Kato et al. [12])). A periodic task set τ is schedulable by EDZL if it satisfies one of the following conditions. • The number of tasks satisfying the following is less than m + 1. Wk ≥ m(pk − ek )
(1)
• The number of tasks satisfying (1) is not less than m + 1, but the following does not hold for any of them. Wk > m(pk − ek )
and
∀i = k : Wik > pk − ek
(2)
For the schedulability of EDF, many studies have been conducted [1, 3, 6, 11]. Among them, Goossens et al. [11] presented the following simple inequality for schedulability test of the global EDF scheduling on m identical processors. Theorem 2 (Goossens et al. [11]). A periodic task set τ is schedulable by EDF scheduling upon m identical processors, if the following is satisfied. U (τ ) ≤ m(1 − Umax ) + Umax
(3)
For the relationship between EDZL and EDF on task scheduling, Park et al. [14] presented that EDZL strictly dominates EDF. Then any task set schedulable by EDF is also schedulable by EDZL. However, in terms of schedulability condition, a task set satisfying the schedulability condition of EDF
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
65
(i.e., Theorem 2) may not satisfy the schedulability conditions of EDZL (i.e., Theorem 1). The following is an example of such a task set. Example 1. Consider the following periodic task set τ scheduled on 2 processors. τ = {τ1 (1, 4), τ2 (1, 2), τ3 (3, 12), τ4 (1, 2)} The total utilization is U (τ ) = 1.5. The utilizations of tasks are U1 = 0.25, U2 = 0.5, U3 = 0.25, and U4 = 0.5, respectively. The task set satisfies the schedulability condition of EDF by Theorem 2 but does not satisfy the schedulability conditions of EDZL by Theorem 1.
4 Power-Aware EDZL Scheduling In this section, we describe our off-line and on-line algorithms. The off-line algorithm determines a static speed at design time, and the on-line algorithm determines a dynamic speed at a scheduling time. 4.1 Static Speed Determination We exploit the schedulability conditions of EDZL and EDF to obtain a static speed upon identical multiprocessor platforms in which periodic tasks are scheduled by EDZL. We denote by S edzl the lowest speed obtained from the EDZL schedulability conditions, and denote by S edf the lowest speed obtained from the EDF schedulability condition. Then our off-line algorithm determines a static speed S as follows: S ≥ min(S edzl , S edf ).
(4)
Firstly, we discuss S edzl . From Theorem 1, the following can be obtained. Corollary 1. Upon a multiprocessor platform with m identical processors running at a speed S, a periodic task set τ is schedulable by EDZL if it satisfies one of the following conditions C1 and C2. C1. The number of tasks satisfying the following is less than m + 1. ek Wk ≥ m pk − (5) S S C2. The number of tasks satisfying (5) is not less than m+1, but the following does not hold for any of them. Wk ek > m pk − S S
and
∀i = k :
Wik ek > pk − S S
(6)
66
Xuefeng Piao et al.
In condition C1, (5) can be rewritten as follows: S≤
Wi + Ui . mpi
(7)
For a task τi , the maximum speed satisfying (7), denoted by Si , is called as a critical speed. Notice that if all processors run at a speed lower than or equal to Si , then (5) holds for task τi . In this case, the jobs of τi may reach zero-laxity. Otherwise, the jobs of τi never reach zero-laxity. Let S m+1 be the (m + 1)-th largest critical speed among the critical speeds of all tasks. Then we obtain S edzl as follows. •
S m+1 > Smax : Even if all processors run at Smax , there are at least m + 1 tasks such that Wk /Smax > m(pk − ek /Smax ). Thus τ does not satisfy either C1 or C2. In this case, τ may not be schedulable by EDZL. • S m+1 = Smax : Even if all processors run at Smax , there are at least m + 1 tasks such that Wk /Smax ≥ m(pk − ek /Smax ), and τ does not satisfy C1. However if (6) does not hold for any of them with all processors running at Smax , then τ satisfies C2 and S edzl is given as S edzl = Smax . Otherwise, τ may not be schedulable by EDZL. • S m+1 < Smax : If a static speed is S m+1 , then (5) holds for m + 1 tasks. In this case, τ does not satisfy C1. But if any of these tasks does not satisfy (6), then τ satisfies C2 and S edzl is given as S edzl = max(S m+1 , Umax ). Otherwise, S edzl is given as S edzl = max(S˜m+1 , Umax ) where S˜m+1 = S m+1 + such that 0 < ≤ 1 − S m+1 . Note that, to ensure the system schedulability, a static speed must be greater than or equal to Umax whatever the scheduling algorithm [13]. Now, we consider S edf . From Theorem 2, the following can be obtained. Corollary 2 (N´ elis et al. [13]). A periodic task set τ is schedulable by EDF on m identical processors running at a speed S if S ≥ Umax +
U (τ ) − Umax . m
(8)
Since EDZL strictly dominates EDF, a static speed used in EDF can be used as a static speed in EDZL. Then we obtain the following lemma. Lemma 1. A periodic task set τ is schedulable by EDZL on m identical processors running at a speed S given by (8). Proof. We prove the claim by contradiction. Suppose that a periodic task set τ is schedulable by EDF with a speed S given by (8), but it does not schedulable
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
67
1 0.9
Sedf edzl S
0.8
speed
0.7 0.6 0.5 0.4 0.3 0.2 1
1.15
1.3
1.45
1.6
1.75
1.9
2.05
2.2
2.35
7
7.75
8.5
The total utilization
(a) m = 4 and n = 12 1 edf
0.9
S Sedzl
0.8
Speed
0.7 0.6 0.5 0.4 0.3 0.2 0.1 1.75
2.5
3.25
4
4.75
5.5
6.25
The total utilization
(b) m = 16 and n = 48 Fig. 2. The comparison between S edf and S edzl
by EDZL with the speed S. Let τ be a modified task set of τ : ∀τi ∈ τ , only the execution time ei is modified as ei = ei /S. Then the modified task set τ is schedulable by EDF with the maximum speed. Furthermore, since EDF is dominated by EDZL, τ is also schedulable by EDZL with the maximum
68
Xuefeng Piao et al.
Algorithm 8 : Iterative method Input: A periodic task set τ Output: (S1 , . . . , Sn ), lCount, cCount 1: slb ← (0, . . . , 0) 2: repeat 3: Converged ← 1 4: All variables are initialized by zero; 5: for k ∈ {1, . . . , n} do 6: for i ∈ {1, . . . , n} and i = k do 7: Wik ← ni ei + min(ei , pk − slb i − ni pi ) 8: if Wik > pk − ek then 9: cCount ← cCount + 1 10: end if
11: Wk ← Wk + min Wik , pk − ek 12: end for 13: newSlack ← (pk − ek ) − Wk /m 14: if slb k < newSlack then 15: slb k ← newSlack 16: Converged ← 0 17: end if 18: Sk ← Wk /mpk + Uk 19: if Sk > 1 then 20: lCount ← lCount + 1 21: end if 22: end for 23: until Converged = 1 return (S1 , . . . , Sn ), lCount, cCount
speed, i.e., τ is schedulable by EDZL with the speed S, which contradicts the assumption that τ does not schedulable by EDZL with the speed. For some periodic task sets, the lowest speed obtained from the EDF schedulability condition may be slower than that obtained from the EDZL schedulability conditions. Example 2. Consider the following a periodic task set τ scheduled on 2 processors. τ = {τ1 (2, 4), τ2 (3, 8), τ3 (1, 5), τ (3, 12)} The task set is schedulable by both EDF and EDZL. However, for the task set, the speed obtained from the EDF schedulability condition is slower than that obtained from the EDZL schedulability conditions, i.e., S edf = 0.9125, S edzl= 0.9375.
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
69
Algorithm 9 : Static speed determination Input: A periodic task set τ Output: A static speed, infeasible 1: S1 , . . . , Sn , lCount, cCount ← Call Algorithm 8 2: Obtain S m+1 3: if S m+1 > Smax then 4: return inf easible 5: else if S m+1 = Smax then 6: if lCount = 0 and cCount = 0 then 7: return Smax 8: else 9: return infeasible 10: end if 11: else 12: for k ∈ {1, . . . , n} do 13: if Sk > S m+1 then 14: return min(max(S˜m+1 , Umax ), S edf ) 15: end if 16: for i ∈ {1, . . . , n} and i = k do 17: if Wik /S m+1 > pk − ek /S m+1 then 18: scCount ← scCount + 1 19: end if 20: end for 21: end for 22: if scCount = 0 then 23: return min(max(S m+1 , Umax ), S edf ) 24: end if 25: end if
Such a situation often occurs when the total utilization is heavy as shown in Fig. 2; the experimental setup will be described in Sect. 5. Theorem 3. A periodic task set τ is schedulable by EDZL on m identical processors running at a static speed S s given by (4). The pseudo code of our off-line algorithm is presented in Algorithms 8 and 9. Algorithm 8 computes the critical speed for each task in a given task set and counts the number of tasks satisfying Wk > m(pk −ek ) and Wik > pk −ek by lCount and cCount, respectively. To obtain critical speed of each task, we modified the iterative method provided in [4]. In the original method, once a given task set is confirmed to be schedulable, the iteration is broken. In our method (Algorithm 8), however, the iteration is continued until no further slack update is possible. Consequently, the critical speeds of tasks are obtained
70
Xuefeng Piao et al. Rmin(t) P1
J2
J1
P2
J4
J3
t
t+6 R-interval
Fig. 3. An EDZL schedule for J(t) when the absolute deadlines of all jobs in J(t) are D1 < D4 < D2 < D3 .
based on the lowest bound on the slack of tasks. According to the obtained values from Algorithm 8, Algorithm 9 checks whether the given task set is schedulable or not and determines a static speed. In Algorithm 9, scCount k m+1 represents the number of tasks satisfying W > pk − ek /S m+1 . i /S n 2 The complexity of Algorithm 8 is O(n i=1 (pi − ei )) as shown in [4] and the complexity of Algorithm 9 is O(n2 ). Then the complexity of our off-line n algorithm is O(n2 i=1 (pi − ei )). 4.2 Dynamic Speed Determination To obtain a dynamic speed, we introduce some notations and discuss a property of EDZL. The next release time of a task is called as an upcoming release time, and an upcoming release time of a task τi at a time t, denoted by Ri (t), is defined as Ri (t) = t/pi pi + pi . Among the upcoming release times of all tasks at time t, the minimum upcoming release time, denoted by Rmin (t), is defined as Rmin (t) = minτi ∈τ (Ri (t)). Notice that the absolute deadlines of all jobs in J(t) are later than or equal to Rmin (t). We call the time interval [t, Rmin (t)) as R-interval in which no job released. Then for any time instance t (t < t < Rmin (t)), Rmin (t ) = Rmin (t). The computation power of an Rinterval is defined as m(Rmin (t) − t). Let J(t) be a set of executable jobs at time t. Then a density of Ji within an R-interval, denoted by λi (t), is defined as λi (t) = ωi (t)/(Rmin (t) − t). The maximum density of J(t), denoted by λmax (t), is defined as λmax (t) = max Ji ∈J(t) (λi (t)). In therest of this subsection, we denote Ji ∈J(t) λi (t) by λi (t), and denote Ji ∈J(t) ωi (t) by ωi (t). Example 3. Consider an EDZL schedule for J(t) = {J1 , J2 , J3 , J4 } on two processors P1 and P2 in Fig. 3. The remaining execution times of all jobs in J(t) are ω1 (t) = 2, ω2 (t) = 4.5, ω3 (t) = 1, and ω4 (t) = 2.5. The minimum upcoming release time is Rmin (t) = t + 6 and R-interval is [t, t + 6). Although computation power within the R-interval is greater than the total execution time of all jobs in J(t), J2 completes its execution beyond the R-interval, while 2.5 time units are left on processor P2 . However, if we assign the absolute
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms J2 reaches zero laxity J1
P1
P2
71
Rmin(t)
J2
J4
J3
J1
t
t+6 R-interval
Fig. 4. An EDZL schedule for J(t) if the absolute deadlines of all jobs in J(t) are set to D1 = D2 = D3 = D4 = Rmin (t).
deadlines of all jobs as Rmin (t), then all jobs complete within the R-interval as shown in Fig. 4. From Example 3, we obtain the following property of EDZL. Lemma 2. For all job in J(t), the absolute deadlines are set toRmin (t) such λi (t) ≤ m. that λmax (t) ≤ 1, then all jobs meet the deadlines by EDZL if Proof. We prove the claim by contradiction. Suppose that J(t) satisfies λi (t) ≤ m at time t, but a job Ji misses the absolute deadline Rmin (t). Let t be the time when Ji reaches zero laxity. Since Ji misses the deadline and λmax (t) ≤ 1, there must be at least m + 1 jobs (including the job Ji ) that all have zero laxity at the time t (t < t < Rmin (t)). Then the amount of remaining execution time of the zero laxity jobs at time t is greater than or equal to (Rmin (t)−t )×(m+1). Furthermore, since EDZL is work-conserving, there is no idle time during time interval [t, t ). Then the amount of executed time during the time interval is m×(t −t). Notice that since no job is released within the time interval [t, Rmin (t)), i.e., R-interval, all jobs executed within the R-interval must be in J(t). Consequently, the total workload of all jobs in J(t) within the R-interval is as follows.
ωi (t)≥ m × (t − t) + (Rmin (t) − t ) × (m + 1) , ≥ m × (Rmin (t) − t) + Rmin (t) − t .
By dividing both sides by Rmin (t) − t, the following inequality can be derived. Since Rmin (t) > t , λi (t) ≤ m.
λi (t) ≥ m +
Rmin (t) − t Rmin (t) − t
λi (t) > m, which contradicts the assumption
72
Xuefeng Piao et al. J2 reaches zero laxity P1
J1
Rmin(t)
J2 J1 reaches zero laxity
P2
J4
J3
t
J1 t+6
R-interval
Fig. 5. EDZL schedule for J(t) when all processors run at 10/12 and the absolute deadlines of all jobs are set to Rmin (t).
From Lemma 2, for J(t) within an R-interval, we obtain a speed at time t as follows. S ≥ max
1 λi (t), λmax (t) m
(9)
We denote by S r the lowest speed obtained from (9). The following example shows that when m processors run at the speed, all jobs in J(t) are successfully scheduled within the R-interval if λi (t) ≤ m and λmax (t) ≤ 1. Example 4. Consider Example 3 in Fig. 4. The speed S r at time t can be set as 10/12 according to (9). When P1 and P2 run at the speed S r , all jobs in J(t) still meet deadlines Rmin (t) as shown in Fig. 5.
Theorem 4. For all jobs in J(t), the absolute deadlines are set to Rmin (t) such that λmax (t) ≤ 1, then all jobs meet the deadlines by EDZL with a dyλi (t) ≤ m. namic processor speed S r given by (9) if Proof. Let J(t) be a modified job set of J(t): ∀Ji ∈ J(t) , only the remaining execution time ωi (t) is modified as ωi (t) = ωi (t)/S r where S r is given by (9). Now we show that all jobs in J(t) also meet the deadlines Rmin (t) according to Lemma 2. From (9), we need to consider the following two cases. 1 1 λi (t) > λmax (t), S r ≥ m λ • When m i (t). The total exe remaining 1 cution time of J(t) can be rewritten as λi (t) ωi (t) ≤ ωi (t)/ m r . By dividing both sides by R (t) − t, we derive that by replacing S min λi (t) ≤ m. Therefore all jobs in J(t) meet the deadlines Rmin (t) by Lemma 2. 1 λmax (t). The λi (t) ≤ λmax (t), S r ≥ • When m total remaining execution ωi (t) ≤ ωi (t)/λmax (t) by time of J(t) can be rewritten as replacing λi (t) ≤ S r . By dividing both sides by Rmin (t) − t, we derive that
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
73
Algorithm 10 : Dynamic speed determination
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15:
Input: A job set J(t) at time t Output: A processing speed at time t is obtained by Algorithm 9 Ss if λi (t) ≤ m and λmax (t) ≤ 1 then 1 λi (t), λmax (t)) S r ← max( m if S r < S s then for all Ji ∈ J(t) do Di ← Rmin (t) i (t) ← Di − t − ωi (t)/S r end for return S r else for all Ji ∈ J(t) do i (t) ← Di − t − ωi (t)/S s end for return S s end if end if
1 λi (t)/λmax (t). Since λmax (t) ≥ m λi (t), λi (t) ≤ m. Therefore all jobs in J(t) also meet the deadlines Rmin (t) by Lemma 2.
As a result, for the above two cases, all jobs in J(t) meet the deadlines Rmin (t) by Lemma 2. For J(t), if λi (t) ≤ m and λmax (t) ≤ 1, our on-line algorithm computes a speed S r at each scheduling point, and determines a dynamic speed S by S ≥ min(S s , S r ) where S s is a static speed obtained from the proposed off-line algoritm. The pseudo code of our on-line algorithm is presented in Algorithm 10.
5 Simulation We evaluate the proposed off-line algorithm and the on-line algorithm by simulations. For a task used in the experiments and the simulations, the period was given as a random number uniformly distributed in the range [1, 1000], and the utilization was given as a random number uniformly distributed in the range [0.1, 1). Then the worst-case execution time was given as ei = Ui × pi . The simulations were conducted on m = 4 and m = 16 processors, respectively, for the following two groups of task sets. G1. The number of tasks was increased with the fixed total utilization U (τ ) = 2 on m = 4 processors and U (τ ) = 8 on m = 16 processors.
74
Xuefeng Piao et al.
1
EDF(k) EDZL
0.95 0.9
Static speed
0.85 0.8 0.75 0.7 0.65 0.6 0.55 8
12
16
20
24
The number of tasks
(a) m = 4 and U (τ ) = 2 1
EDF(k) EDZL
0.95 0.9
Static speed
0.85 0.8 0.75 0.7 0.65 0.6 0.55 32
48
64
80
96
The number of tasks
(b) m = 16 and U (τ ) = 8 Fig. 6. The static speed comparison for G1
G2. The total utilization was increased with the fixed number of tasks n = 12 on m = 4 processors and n = 48 on m = 16 processors. To evaluate our off-line algorithm, we compared the average minimum speed obtained by our off-line algorithm (by (4)) in power-aware EDZL with that obtained by the off-line algorithm for EDF(k) (by Algorithm 1 in [13]).
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
75
1 0.9
EDF(k) EDZL
0.8
Static speed
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0.56
1.12
2.24
2.24
2.8
7.68
9.6
The total utilization
(a) m = 4 and n = 12 1 0.9
EDF(k) EDZL
0.8
Static speed
0.7 0.6 0.5 0.4 0.3 0.2 0.1 1.92
3.84
5.76
The total utilization
(b) m = 16 and n = 48 Fig. 7. The static speed comparison for G2
For each configuration, we generated 1000 task sets schedulable by EDZL and EDF(k) . The simulation results of the proposed off-line algorithm for the task set groups G1 and G2 are shown in Fig. 6 and Fig. 7, respectively. As shown in the figures, the average minimum speeds of our off-line algorithm for EDZL
76
Xuefeng Piao et al.
Normalized energy consumption
0.97
α=0.1 α=0.5 α=0.9
0.96
0.95
0.94
0.93
0.92
0.91 20
40
60
80
100
The number of tasks
(a) m = 4 and U (τ ) = 2
Normalized energy consumption
1.02
1.01
1
0.99
α=0.1 α=0.5 α=0.9
0.98
0.97 20
40
60
80
100
The number of tasks
(b) m = 16 and U (τ ) = 8 Fig. 8. Normalized energy consumptions for G1
are lower than that of the off-line algorithm for EDF(k) in both experiments for the groups G1 and G2. For the two off-line algorithms, when the number of tasks is fixed, the static speed increases as the total utilization increases as shown in Fig. 7. On the other hand, when the total utilization is fixed, the static speed decreases as the number of tasks increases as shown in Fig.
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
Normalized energy consumption
1
77
α=0.1 α=0.5 α=0.9
0.98
0.96
0.94
0.92 0.56
1.12
1.68
2.24
2.8
The total utilization
(a) m = 4 and n = 12
Normalized energy consumption
1
0.996
0.992
0.988
α=0.1 α=0.5 α=0.9
0.984
0.98 1.92
3.84
5.76
7.68
9.6
The total utilization
(b) m = 16 and n = 48 Fig. 9. Normalized energy consumptions for G2
6. This is because the static speed is influenced by the maximum utilization of a task in a given task set in both two off-line algorithms. The maximum utilization decreases as the number of tasks increases in G1 and is increases as the total utilization increases in G2.
78
Xuefeng Piao et al.
To evaluate the on-line algorithm, we normalized the energy consumption with the on-line algorithm to that with the proposed off-line algorithm. In experiments, we used the method described in [8] to determine the actual execution time of a task. For a given task set, 50% tasks executed for their worst-case execution time and the other 50% task executed for the actual execution time. The actual execution time of a task τi was given as βi ei where βi was drawn from a random normal distribution with mean value α and standard deviation 0.1. We bound that the βi is not greater than one, and energy consumption function used in the simulation was S 2 for each execution unit. The simulation results of the proposed on-line algorithm for the task groups G1 and G2 are shown in Fig. 8 and Fig. 9. The proposed on-line algorithm reduces energy more efficiently when the number of processors is small and the total utilization of a given task set is low; note that the system utilization U (τ )/m of Fig. 8(a) and Fig. 8(b) are the same as 1/2. However, when the number of processors is large or the total utilization of a given task set is heavy, the on-line algorithm does not reduce energy consumption so much. When the actual execution time of a task is much less than the worst case execution time, the proposed on-line algorithm reduces more energy consumption compared with the energy consumption where only the off-line algorithm is applied. In the simulation, the proposed on-line algorithm only further reduce energy consumption 7% approximately than the proposed off-line algorithm at the best case. It is related to the system workload generated in the simulation since 50% tasks in a given task set are applied the ratio βi of actual execution time.
6 Conclusion We have propose an off-line and an on-line power-aware EDZL algorithms to reduce energy consumption of real-time tasks upon multiprocessor platforms in which all processors run at an identical speed. The off-line algorithm determines a static speed at design time by exploiting the schedulability conditions of EDZL and EDF, and the on-line algorithm determines a dynamic speed at each scheduling point by exploiting property of EDZL. The proposed algorithms guarantee a hard real-time constraint with reducing energy consumption of real-time tasks. For future research, we shall improve the online algorithm, and consider power-aware EDZL scheduling for heterogeneous multiprocessor platforms.
Acknowledgement This work was supported by the Industrial Strategic Technology Development Program, Grant Number 10035324, funded by the Ministry of Knowl-
Power-Aware EDZL Scheduling upon Identical Multiprocessor Platforms
79
edge Economy (MKE), Korea. This research was supported by Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (KRF-2008-314-D00335).
References [1] J. H. Anderson and S. K. Baruah. Energy-efficient synthesis of periodic task systems upon identical multiprocessor platforms. In Proceedings of the 24th International Conference on Distributed Computing Systems, pages 428–435, 2004. [2] H. Aydin and Q. Yang. Energy-aware partitioning for multiprocessor real-time systems. In Proceedings of the 17th International Symposium on Parallel and Distributed Processing, pages 113–121, 2003. [3] T. P. Baker. Multiprocessor edf and deadline monotonic schedulability analysis. In Proceedings of the 24th IEEE International Real-Time Systems Symposium, page 120, 2003. [4] T. P. Baker, M. Cirinei, and M. Bertogna. Edzl scheduling analysis. Real-Time Systems, 40(3):264–289, 2008. [5] S. K. Baruah. Optimal utilization bounds for the fixed-priority scheduling of periodic task systems on identical multiprocessors. IEEE Transactions on Computers, 53(6):781–784, 2004. [6] M. Bertogna, M. Cirinei, and G. Lipari. Improved schedulability analysis of edf on multiprocessor platforms. In Proceedings of the 17th Euromicro Conference on Real-Time Systems, pages 209–218, 2005. [7] J. Chen and T. Kuo. Multiprocessor energy-efficient scheduling for real-time tasks with different power characteristics. In Proceedings of the 2005 International Conference on Parallel Processing, pages 13–20, 2005. [8] J. Chen, C. Yang, and T. Kuo. Slack reclamation for real-time task scheduling over dynamic voltage scaling multiprocessors. In Proceedings of the IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing, pages 358–367, 2006. [9] S. Cho, S. Lee, S. Ahn, and K. Lin. Efficient real-time scheduling algorithms for multiprocessor systems. IEICE Transactions on Communications, 85(12):2859– 2867, 2002. [10] M. Cirinei and T. P. Baker. Edzl scheduling analysis. In Proceedings of the 19th Euromicro Conference on Real-Time Systems, pages 9–18, 2007. [11] J. Goossens, S. Funk, and S. Baruah. Priority-driven scheduling of periodic task systems on multiprocessors. Real-Time Systems, 25(3):187–205, 2003. [12] S. Kato and N. Yamasaki. Global edf-based scheduling with efficient priority promotion. In Proceedings of the 14th IEEE International Conference on Embedded and Real-Time Computing Systems and Applications, pages 197–206, 2008. [13] V. N´elis, J. Goossens, R. Devillers, D. Milojevic, and N. Navet. Power-aware real-time scheduling upon identical multiprocessor platforms. In IEEE International Conference on Sensor Networks, Ubiquitous, and Trustworthy Computing, pages 209–216, 2008.
80
Xuefeng Piao et al.
[14] M. Park, S. Han, H. Kim, S. Cho, and Y. Cho. Comparison of deadline-based scheduling algorithms for periodic real-time tasks on multiprocessor. IEICE Transactions on Information and Systems, 88(3):658–661, 2005. [15] C. Yang, J. Chen, and T. Kuo. An approximation algorithm for energy-efficient scheduling on a chip multiprocessor. In Proceedings of the conference on Design, Automation and Test in Europe, pages 468–473, 2005.
Thermalaware Register File based on Heat Transfer Jungwook Kim1 , Seong Tae Jhang2 , and Chu Shik Jhon3 1
2
3
Department of Computer Science and Engineering, Seoul National University, Seoul 157-144, Korea.
[email protected] Department of Computer, The University of Suwon, Gyeonggi-do 445-743, Korea.
[email protected]† Department of Computer Science and Engineering, Seoul National University, Seoul 157-144, Korea.
[email protected]
Summary. The integer register-file is the hottest unit in a microprocessor. As techniques like DTM reduce the temperature by sacrificing the performance of a microprocessor, they are revealing their limits. Thus for minimizing the DTMinterventions, it is needed to study an architectural approach that fundamentally suppresses the heat generation in a microprocessor. We improved the existing register-file to a more effective structure for heat dissipation based on the basic principle of heat transfer. Our technique is that lowers the temperature of the higher heat source by speeding up the heat rate from the higher heat source to the lower heat source. The heat rate can be accelerated by reducing the distance between high temperature point and low temperature point. As a result, we achieved the peak temperature drop that is up to 13.5℃(13.3%) on average 9.4℃(11.3%) compared to the existing register-file. Also relative performance improvement is up to 67.7% on average 49.8%.
1 Introduction The register file is known to the highest-temperature unit in a microprocessor. Especially, the integer register-file shows the highest power density within a processor since it consumes more power due to very frequent access with a relatively small area. High power density leads to high temperature, and high temperature can cause many problems: the durability decrease of a circuit, the leakage power increase, calculation errors, and denial of services [1] [2] [3]. Calculation errors and denials of services also become an important factor of the reliability reduction in microprocessors. Typically, in order to reduce this high temperature, various cooling devices are needed: heat sink, heat spreader, cooling fan and so on. This, however, has been a factor in the rise †
corresponding author
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 5, © Springer Basel AG 2011
82
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
of the unit price of a microprocessor. Generally, these cooling devices are designed based on the maximum temperature of the processor operation [4]. But it had been known that the processor operation in general applications is performed mostly at lower temperatures than the maximum temperature. Accordingly, some studies proposed that the cooling costs can be reduced by designing the cooling devices as the criteria for average temperature than maximum temperature, and the dynamic thermal management (DTM) can control the maximum temperature [4]. It has an advantage of lowering the unit price of a microprocessor when the DTM and the cooling devices are applied together. Today, various DTM methods are basically being applied in most processors and many studies have been carried on about the DTM. Since the DTM, however, is the way that reduces the temperature by sacrificing the performance of a microprocessor, DTM is increasingly revealing its limits. As the applications that give a continuous burden to the processor are increasing in recent computing environment (e.g. such as High Definition movies, 3D games, and various Real-Time systems), the processor is faced with having to operate close to the maximum temperatures in most of the time [5]. In these circumstances the DTM-intervention becomes more frequent. The frequent DTM-intervention gives a fatal adverse to the performance. Such a bad effect was also demonstrated in our previous study [6]. In our previous study, we had found out that the existing renaming-unit causes high temperature by not evenly allocating registers. Accordingly, we approached the problems in terms of processor architecture and lowered the temperature of register file by Dynamic Register Renaming (or Relocation) [6]. Thus we had achieved leakage power savings. Also relative performance improvements resulting from minimizing DTM-interventions had been achieved. Like such our previous study, the proposals that have to adopt a temperature-resistant structure to suppress high temperature from the design stage of a processor are getting a convincing [7]; therefore, the needs of these studies are increasingly being emerged. Though some related studies have been introduced [8] [9] [10], so far there is not much research about thermal-aware register files. Following previous our study, we are trying to lower temperatures by applying more advanced methods. In this paper we propose a new structure of the register file based on the basic principle of heat transfer. We were motivated by the fact that the heat rate is inversely proportional to the distance between T1 and T2 when T1 is the higher temperature heat source and T2 is the lower [11]. In other words if the distance is reduced, the heat rate can be accelerated. Thus the generated heat of T1 point can be transferred to T2 more quickly, and the temperature rise of T1 will be restricted. Accordingly, we have redesigned the existing register file based on the principle, and we demonstrated the overall temperature drop by spreading the heat more quickly than the existing register file from the high temperature to the low temperature. Also we led to additional reductions of temperature by applying our previous method (i.e. Register Relocation) again in the new structure. As a result, we achieved the peak temperature
Thermalaware Register File based on Heat Transfer
83
drop that is up to 13.5℃(13.3%) on average 9.4℃(11.3%) compared to the existing register-file. Also relative performance improvement by minimized DTM is up to 67.7% on average 49.8%. The rest of the paper is organized as follows. In Section 2., background and our previous study are introduced. In Section 3., we explain the new register file based on the basic principle of heat transfer. In Section 4., we show the results of the new structure and compare the results with the previous work. Relative performance improvements are discussed in Section 5. Related works are presented in Section 6. Conclusion follows in Section 7.
2 Background and Previous Work 2.1 Register Renaming Generally, modern superscalar processors have 32 architectural registers and more than 32 physical registers. For example, in Alpha 21264 processor, which has been representative as a high-performance microprocessor and was selected for our experimental target, the physical integer register file has 80 entries. Its higher part (i.e. 0-39 entry number) consists of 32 architectural registers and 8 shadow registers, and the other part (i.e. 40-80 entry number) is used as physical registers for the allocation of writing. The register renaming is a technique which preserves “program order” against data hazards; the hazards occur among two instructions using the same register or memory location. For example, consider two instructions I1 and I2 ; I1 and I2 are “load R1, R2, R3” and “add R2, R4, R5”, respectively; I1 occurring before I2 in program order. Commonly, a less time-consuming instruction is executed before a long-time instruction in an Out-of-Order microprocessor. Since the “load” instruction of I1 takes more time than the “add ”instruction of I2 , I2 will be executed before I1 . Thus, I2 may try to write R2 register before it is read by I1 , so I1 incorrectly gets a new value; WAR(Write After Read) hazard is occurred. In such a case, the renaming logic assigns the second R2 register to a free physical register within the range of 40-80 entry numbers; hence, I2 writes the value to a new destination and I1 gets the correct value. Consequently, the program order is preserved by the renaming technique. Fig. 1. shows an example of this mechanism. However, from our previous simulation, we found that the most assignments by the conventional renaming scheme clustered on one side of the register file, and it caused high temperature. Since the assignments for register writing are fixed to the only half range (i.e. 40-80 entry number), and accesses for writing hold a considerable portion in the total accesses, the power density in the right side of the register file is rapidly increased. As a result, the maximum temperature appears in that region; moreover, the hotspots (i.e. emergency temperature points) are also created. Fig. 2. shows an example of
84
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
Fig. 1. Convensional Renaming Method in Out-of-Order SuperScalar Microprocessors
the concentrated accesses on the half of the physical registers in gzip program; the x-axis represents an entry number of the physical registers. Fig. 3. shows an example of the thermal map (e.g. gzip); the steady-state temperature rises to the hotspot point (e.g. 90℃) in the right part of the registers.
Fig. 2. Unbalanced access in gzip program
2.2 Previous Work: Register Relocation The goal of our previous study [6] is the reduction of the temperature in a register file. The goal could be achieved by uniformly distributing accesses
Thermalaware Register File based on Heat Transfer
85
Fig. 3. Temperature emergency due to the unbalanced access
throughout the full-entries of the registers. Our idea was a re-mapping technique revealing that architectural registers (i.e. entry number 0-40) are relocated to the full range of entry numbers (i.e. 0-79) with only the even number allocation, and also that the assignments to physical registers (i.e. 40-80) are also repositioned throughout whole register file area (i.e. 1-80) with the odd number. Our strategy is as follows: First, the traditional renaming unit allocates an index number of a physical register entry to an architectural register. Next, a new index number is generated by our simple algorithm: if the index number is less than 40, then a new index number will be obtained from multiplying the first index number by 2; otherwise (i.e. 40-80), we subtract 40 from the first index and multiply the subtracted value by 2, and ‘1’ is added. This simple algorithm can be implemented by a small logic, and the logic can be attached to the traditional renaming unit; the attached logic consists of six small components: an eight bit adder, an eight bit shift register, a comparator, an OR gate, and two 2:1 muxes. Our algorithm can be expressed as follows. C = F ull entry number / 2 2 × (index − C) + 1 if index ≥ C N ew index = 2 × index if index < C Their detailed operations are described as follows. At first, the comparator checks if the first index number is less than 40 and passes the result to two 2:1 muxes. The adder subtracts 40 from its input data and sends it to the first 2:1 mux. The first 2:1 mux selects an input with the result signal of the comparator and forwards it to the shift register. The shift register does a multiply by shifting only one bit (e.g. 2 × x). The OR gate does the “+1” operation within “2 × i + 1”. The OR gate receives two inputs: a multiply result from the shift register and the constant number ‘1’, and then it does the OR operation with the two inputs; the OR gate sends its result to the second 2:1 mux. The second 2:1 mux receives two inputs from the shift register directly and the OR gate, and it selects one input with the result signal from the comparator; finally, it forwards the selected input to the output port connected to the next pipeline stage. Fig. 4. shows this new logic structure, and Fig. 5 describes our mapping scenario; the higher part and the lower part
86
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
of the original entries are relocated to the even entries and the odd entries, respectively.
Fig. 4. The proposed small logic attached to the traditional renaming unit
Fig. 5. Our mapping scenario
3 Thermal-aware Register File 3.1 Basic Principles of Heat Transfer Heat transfer processes can be quantified in terms of appropriate rate equations. These equations may be used to compute the amount of energy being transferred per unit time. For heat conduction, the rate equation is known as Fourier’s law. For one-dimensional plane wall shown in Fig. 6., having a temperature distribution T(x), the rate equation is expressed as
Thermalaware Register File based on Heat Transfer
qx = −k
87
dT dx
The heat flux qx (W/m2 ) is the heat transfer rate in the x direction per unit area perpendicular to the direction of transfer, and it is proportional to the temperature gradient, dT /dx, in this direction. The proportionality constant k is a transport property known as the thermal conductivity W/m· K and is a characteristic of the wall material. The minus sign is a consequence of the fact that heat is transferred in the direction of decreasing temperature. Under the steady-state conditions shown in Fig. 6., where the temperature distribution is linear, the temperature gradient may be expressed as T2 − T1 dT = dx L and the heat flux is then qx = −k
T 2 − T1 L
or qx = k
ΔT T1 − T2 =k L L
(1)
Note that this equation provides a heat flux, that is, the rate of heat transfer per unit area. The heat rate by conduction, qx (W), through a plane wall of area A is then the product of the flux and the area, qx = qx · A [11].
88
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
Fig. 6. One-dimensional heat transfer by conduction
Fig. 7. (a) is the existing structure of register file and (b) is the new structure proposed by us
3.2 The Thermal-aware Register File As can be seen in Fig. 7(a)., the existing register file has the horizontally long shape as the aspect ratio of 2.68:1. In the register file, architectural registers are located in left and physical registers are placed in right. Like it was shown in previous work, the right part-the physical registers shows the higher heating characteristics. And this heat is transferred to the left part that relatively is lower temperature. Then it reaches the steady-state temperature. When L is the distance from the center of the right part that is more higher temperature to the center of the left part that shows more lower temperature, the equation
Thermalaware Register File based on Heat Transfer
89
which was shown in Section 3.1. can be applied if it is assumed that T1 is the temperature of the right center and T2 is the temperature of the left center. If the generated heat from higher temperature point can be more quickly spread to the lower point, it can be expected that the maximum temperature will be lowered by the quick spreading. Since the existing register file was designed to horizontally long shape, the heat rate will be slow resulting from the long distance between the center of the higher temperature and the lower. This structure cannot but continue to maintain high temperature because the generated heat from the higher temperature is hard to go through the long distance. Being motivated by this, we propose a new register file structure that raises the heat rate by narrowing the distance between higher temperature and lower temperature without compromising its area. Ultimately, our object is that the structure reduces the overall temperature in the register file. Fig. 7(b). shows the new structure that its distance L between T1 and T2 is narrowed by adopting the shape which is horizontally narrow and vertically long by converting the aspect ratio. Also in such a structure, as the area A that the heat flux goes through grows, it is expected that the final effect of heat dissipation is greater. Expressions that represent the heat transfer effects of the existing register file and of the proposed structure are as follows. For the reason that they have the same value of the coefficient k and delta T, the heat flux ratio of the structure 1 and 2 can be expressed as : qx2 =k qx1
ΔT ΔT 1 1 :k = : L1 L2 L1 L2
Thus qx2 =
L1 ·q L2 x1
(2)
While, as the heat rate is the product of the heat flux and area, each heat rate is expressed as · A1 qx1 = qx1
qx2 = qx2 · A2
(3)
The proportional equation of each area A1 and A2 is A1 :A2 =H:W by Fig. 7.. Also as H and W can be replaced by H=2L2 and W=2L1 ,
90
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
A2 =
L1 · A1 L2
(4)
Now the heat rate equation (3) can be substituted with equation (2) and (4).
qx2
· A2 qx2 = qx2 2 L1 L1 L1 = · qx1 × · A1 = · qx1 · A1 L2 L2 L2
∴ qx2 =
L1 L2
2 · qx1
(5)
In the equation (5), because of L1 > L2 , qx2 will have a greater value than qx1 . In other words, in two different structures, it can be considered with that the heat rate between T1 and T2 is proportional to the square of the ratio of each distance L1 and L2 . But the equation (5) may be acceptable only when the conditions are L1 =0.5W and L2 =0.5H. Therefore it is predictable that heat dissipation is more effective as the heat rate is faster in our structure. Since the generated heat from hot source will be immediately transferred if the heat rate is faster, the temperature increase of hot point may be limited by the proportion of the accelerated heat rate. Consequently, the positive effect of the overall temperature drop of register file is expected.
4 Experimental Results 4.1 Simulation Parameters Our simulation environment targets the Alpha 21264 microprocessor. Table 1 reports the configuration that was assumed in our simulations. The parameters are based on Alpha 21264 microprocessor [12]. 4.2 Methodology For more precise simulations, we used Sim-alpha [13] as a main simulator. Since the floorplan file [14] of the Alpha21264 was used in our thermal experiments, we needed more accurate simulations on the Alpha Processor. The Sim-alpha simulator is based on the SimpleScalar [15], but it simulates the Alpha core more accurately than the SimpleScalar. While the SimpleScalar provides only a Register Update Unit (RUU) integrating many essential units (e.g. renaming logic, issue queue, reorder buffer), the Sim-alpha provides many essential logics individually and then implements them with more detailed
Thermalaware Register File based on Heat Transfer
91
Table 1. Simulation Parameters
Instruction Fetch Queue Size 4 Instruction Fetch Queue Width 4 Instruction Fetch Queue Speed 1 Map(Rename) Width 4 Issue Width 4 Commit Width 11 Branch Predictor Tournament Predictor Reorder Buffer Size 80 Load Queue Size 32 Store Queue Size 32 Issue Queue Size : INT / FP 20/15 L1 I/D Cache 512 sets, 64Byte Block, 2Way Fast forwarding Data by SimPoint Clock speed 3.0Ghz Technology 65 nm
behaviors. Especially, it is quite a help to our simulation that the relation between the architectural registers and the physical registers is obviously separated and defined, and the realization of the renaming map table and the reorder buffer is relatively exact, compared with the SimpleScalar. Our power consumption models referred to the models of Wattch [16]. The parameters of our power model followed the 65 nm technology guided by International Technology Roadmap for Semiconductors (ITRS) [17]. Our floorplan file for the thermal experiments also was fitted to 65 nm scales; the die size of the microprocessor core is 36 mm2 . Temperature simulations were conducted by HotSpot [18] with power trace files which were generated from Sim-alpha and Wattch. For more exact simulations, every power trace file was simulated as twice; at first, the steady-state temperature was obtained by the first thermal simulation, and it was used as the initial temperature for the next phase of the thermal simulation. This two-phase process is a typical method in HotSpot simulator. We used benchmark programs from SPEC2000 [19]. For the experiments efficiency and reducing the simulation time, we used fast-forwarding data from SimPoint [20]. SimPoint provides fast-forwarding data by analyzing each characteristic of SPEC2000 benchmark programs. In other words the study is that the results of unique segments are little difference with the results of whole sectors. Accordingly, the time of unnecessary experiments can be considerably saved.
92
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
4.3 Results and Discussion Steady-state Temperature Reduction Fig. 8. shows the steady-state temperature reductions in register file and compares the results of this paper and previous paper. Among four bars in each benchmark, two bars of the left side show the results of our previous study. And two bars of the right side show the results of this paper. The third bar shows the result of the new register file that was proposed based on the heat transfer theory. Though it seems like that the third bar is little higher than the second bar which shows the result from the previous proposed technique, much reduction of temperature can be seen compared to the first bar of the existing register file. This provides the possibility that a structure designed for the effective heat-transfer can lead to significant reductions of temperature without any other techniques such as the register-relocation of previous study. Furthermore, we tried to apply the register-relocation method to the new structure again. As a result, as the forth bars are shown, we achieved additional temperature reductions. And these are showing the best results. But it can be found that the reductions from the third to the forth is smaller than the reductions from the first to the second. In other words, the effect of register-relocation on the new structure of register file is weaker than the base structure. It can be thought that the new structure is proven to be already effective on heat dissipation. Also one notable part is the case of vortex benchmark program. In previous study, the vortex case showed rather the results of increased temperature by our method. But in this study the vortex showed the largest temperature drop conversely. The analysis of vortex case may be as follows. As vortex has the characteristic of that the proportion of using of R31 register is relatively large unlike other programs, its temperature had rose resulting from the increased power density near the R31 register by our register-relocation method. On the other hand, in spite of the temperature rise, because the heat rate of our new structure is faster, the generated heat is quickly transferred to the low temperature part. Thus the rise of maximum temperature could be restricted. Fig. 9. shows an example of thermal map change in bzip2. The maximum temperature of Fig. 9(b). is lower than Fig. 9(a). and the area of maximum temperature in Fig. 9(b). is smaller than 9(a). As the thermal-aware register not only lowers the maximum temperature but also reduces the exposed area to harmful high temperature, our new structure is beneficial to extend the lifetime of processor. Also we can find that the thermal gradient which is bad to lifetime of chip is also considerably alleviated in Fig. 9(b). As a result, we achieved the temperature drop that is up to 11.7℃(12.9%) on average 6.9℃(8.8%) compared to the existing register-file, and that is up to 6.3℃(7.8%) on average 2.3℃(3.1%) compared to the previous work.
Thermalaware Register File based on Heat Transfer
93
Fig. 8. The comparison of temperature reductions by base, RR (Register Relocation), and TR (Thermal-aware Register).
Fig. 9. An example of thermal map comparison in bzip2: (a) is base, (b) is TR, and (c) is TR+RR
Peak Temperature Reduction Fig. 10. shows the peak temperature reductions of each program in the integer register-file. As can be seen in Fig. 10., our method shows the same effect on the reduction of the peak temperature as well as the steady-state. Especially, in case of gcc program, the best results are shown as the reduction over 10℃. In whole programs the average reduction of peak temperature was 9.4℃. If the emergency temperature is defined as 80℃, in the steady-state temperatures, four programs are exceeding the emergency point: bzip2, crafty, gcc, and gzip. In the peak temperatures, three programs have been added to the early four programs: gap, parser, and twolf; therefore, total seven programs are exceeding the emergency temperature. Finally it can be seen that the average of the peak temperatures is already exceeding the emergency temperature. In spite of such high peak-temperatures, because our method has the effect of reducing the peak temperature as well as the steady-state temperature, it can be found in the right side of Fig.10 that the average of the peak temperature has been decreased below the critical temperature. As a result, we achieved the peak temperature drop that is up to 13.5℃(13.3%) on average 9.4℃(11.3%) compared to the existing register-file.
94
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
Fig. 10. Peak temperature reductions
Temperature Distribution and Change Over Time Fig. 11. and 12. show the temperature changes over time in bzip2 program. In three-dimensional coordinate of Fig. 11. and 12., x-axis displays entry numbers of the register file; y-axis shows the execution cycles over time; and z-axis corresponds to the temperatures of each entry. Fig. 11. shows the temperature changes of the register file by the existing register assignment method. In this case, it cannot be found that the peak temperature goes down below the emergency point (e.g. 80℃) during whole execution cycles. In previous section of near 400 (x 100k) cycles point, it can be seen that in the right side of the register file, the temperature has been increased to over 85℃; in contrast, temperature of the left side is about 65℃; thus, the temperature difference is more than 20℃between the left side and the right side. Accordingly, it can be easily expected that the thermal gradient by the sudden difference will be a significant damage to the lifetime of the register file. The maximum of the peak temperatures is kept above the emergency point even in the next section after the 400 (x 100k) cycles point. In that section, the peak temperature of the right side is increased to over 90℃, but the temperature of the left side is rather decreased to about 55℃. Thus it can be found that the difference became larger than the previous section between the right side and the left. Consequently, the existing register file causes the continuous high temperature and the extreme difference of temperature. Generally, the thermal gradient by the sudden difference is a cause of the thermal-cycling creation. Rapid thermal-cycling between hot point and cold can damage the chip by giving the thermo-mechanical stress to a circuit [1] [3]. Therefore if programs
Thermalaware Register File based on Heat Transfer
95
such as gcc are continuously performed, the microprocessor cannot avoid a severe damage of the register file circuit as well as the performance loss. On the other hands, in case of our method, Fig. 12 shows some stable heating pattern. Though the maximum temperature is seen close to 80℃, the heating-pattern is shown as the uniform distribution compared to Fig. 11. Of course, in such a uniform heating pattern, the created thermal-gradient will be very small enough to ignore the impact to the circuit. Also, during the whole cycle, the maximum temperature has been considerably reduced, and the uniform heating-pattern is being kept. Since the maximum temperature is below the emergency point, the performance loss by DTM-intervention will not occur. Accordingly, it can be seen that our method has many advantages in the overall comparison. First, the decrease of steady-state and peak temperature leads to relative performance improvements by minimizing DTM; in addition, it is expected to save the leakage power by the reduced temperature. Second, it is expected that the uniform heating pattern contributes to extend the lifetime of the register file circuit by minimizing the thermal gradient creation.
Fig. 11. Temperature distribution and change over time in bzip2 - Base
5 Performance Improvement In addition, we can consider the benefit of performance improvement; as our structure minimized the number of DTM-intervention. The performance eval-
96
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
Fig. 12. Temperature distribution and change over time in bzip2 - TR+RR
uation was carried out in limited four cases exceeding the emergency point: bzip2, crafty, gcc, and gzip. Because none of the other programs exceeded the emergency point, any performance drop will not exist; thus, it may be enough to analyze the only four cases. The emergency temperature was assumed to 80℃, and the used DTM technique reducing the temperature was the fetch-throttling. The fetch-throttling is a DTM scheme that suspends the instruction fetch if the temperature exceeds the emergency point until the temperature goes down to a safe level below the emergency point while the temperature is monitored. During the fetch stop, access counts to the register file will be reduced considerably; hence, the power density of the register file will be lowered, and the lowered power-density will lead to the temperature drop. However, such a DTM technique stopping the instruction pipeline decreases the Instruction Per Cycle (IPC) severely; therefore, the execution time for the given instructions will be significantly extended. Due to the extended time, the processor performance suffers severe damage. On the other hands, since the temperature of the register file is reduced by our architectural approach, the case beyond the critical temperature is extremely rare even in the most execution time. In other words, our method brings about the blocking effect; it fundamentally blocks the performance loss by DTM. Fig.13 and 14 reports such a contrast result between the existing register file and the proposed register file, and Fig.14 presents the degree of the relative performance improvement due to the difference with Fig.13. Fig.11 and 12 show the comparison of temperature changes over time under DTM-intervention between the existing register file and our approach. In other words, it shows the monitored results of the temperature changes
Thermalaware Register File based on Heat Transfer
97
and performance loss by DTM; when the temperature exceeds the emergency point, DTM reduces the temperature of the register file by stopping the instruction fetch or by lowering the clock frequency. Fig.11 shows the temperature changes and the performance loss in the existing register file, and Fig.12 shows the degrees of the temperature changes and the performance loss in the case of adopting our thermal-aware structure and register-relocation method. First, in Fig.11, the overall heating pattern is shown as the imbalanced form of the clustered access on the right side of the register-file as shown in the previous examples of Section 4.3; thus, the maximum temperature is higher than Fig.12. Also the initial temperature is formed highly as 93℃; accordingly, the DTM-intervention is immediately started due to the initial temperature exceeding the emergency temperature. The temperature of the register file starts to fall by stopping the instruction-fetch. It can be found that the temperature decreases below 80℃after 20 (x 100k) cycles as it rapidly goes down until about 20 (x 100k) cycles. Since the temperature dropped below the emergency point, the instruction-fetch is normally started again; however, the temperature of the register file will soon increase above 80℃by the restarted instruction-fetch. Then, DTM-intervention is triggered once again, the temperature falls again to below 80℃. As such a process continuously is repeated, the execution cycles of the instructions go on. Thus, from 20 (x 100k) cycles to 95 (x 100k) cycles in Fig.11, it can be seen that the pattern like a saw blade is repeated. In other words the temperature is going up and down as the zigzag pattern around 80℃by DTM. Thus the execution time is increasingly extended; consequently, in Fig.11, the execution time is spent about 95 (x 100k) cycles for finishing the given instructions. Now let us look at the results of our relocation method in Fig.12. As expected, it can be seen that the initial temperature is lower than Fig.11; however, since there are some cases of exceeding 80℃, DTM is triggered at each time of the exceeding. Thus some patterns of the saw blades can be seen during execution cycles. But it is confirmed that because the saw blades patterns around 80℃are dull and found sparsely, there is little DTM-intervention compared to Fig.11; therefore, the relative performance improvements can be expected compared to Fig.11. As expected, this is due to the reduction of the maximum temperature since the overall temperature is distributed uniformly by our thermal-aware structure and relocation technique. Consequently, the finished execution cycles are about 57 (x 100k) cycles, and the finished time is shorter than Fig.11; accordingly, the performance of the processor will be relatively improved.
98
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
Fig. 13. Instructions Per Cycle
Fig. 14. Speed Up
6 Related Work Activity Migration [8] moves operations to multiple clones of register file when the emergency temperature is occurred. Thus the temperature of the previous unit can be decreased. But the migration overheads and area overheads exist and the migration overheads may damage the performance since the register file is time-critical. Active Bank Switching [9] proposed that only a few registers are active enough in the CPU cycles because not all the registers are used during the execution time. X.Zhou, et al. proposed the Compiler-driven Register Reassignment [10]. They evenly redistribute clustered registers to reduce the power density and temperature. But their method is the static one based on compiler and they only focused on the architectural registers. We proposed the Dynamic Register-Relocation [6] in previous study. We had found that the existing renaming unit unevenly allocates the architectural registers to the physical registers. The imbalanced allocations cause high power-density and high temperature. The power-density and temperature had been reduced
Thermalaware Register File based on Heat Transfer
Fig. 15. Temperature changes over time under DTM in gcc - Base
Fig. 16. Temperature changes over time under DTM in gcc - TR+RR
99
100
Jungwook Kim, Seong Tae Jhang, and Chu Shik Jhon
by evenly relocating the registers between architectural registers and physical registers. As can be seen until now, full-fledged research about the thermalaware register file is not much yet.
7 Conclusion and Future Work High temperature of microprocessor produces various problems, and it drops the reliability. The register file is the hottest block, and it also is the important storage of results from processor calculation. Thus the operation stop or calculation errors by the high temperature gives a critical adverse to the reliability of a processor. Though various dynamic temperature-control methods have been applied, since the existing DTM reduces temperature by sacrificing the performance of a microprocessor, the DTM is increasingly revealing its limits. To overcome the limits, the needs of studies about the structure that suppresses the heat generation from the design stage are emerged. We have proposed a new structure of the register-file based on the basic principles of heat transfer. The heat rate of the proposed structure is faster than the existing. Thus the temperature of hotter heat source decreases relatively more quickly. Accordingly, notable temperature reductions have been achieved compared to the existing structure. Also we have obtained additional temperature reductions by applying our previous techniques. As a result, we achieved the peak temperature drop that is up to 13.5℃(13.3%) on average 9.4℃(11.3%) compared to the existing register-file. Also relative performance improvement by minimized DTM is up to 67.7% on average 49.8%. In future work, we will verify the previously derived equation of the relative distances (L1 , L2 ) through experiments. And we will continue to study another structure based on the principle of heat transfer.
Acknowledgement This work was supported by the GRRC program of Gyeonggi province. [(GRRC SUWON2010-B1), CCTV Image Based Context-Aware Process Technology]
References 1. Atienza, D., et al.: Reliability-Aware Design for Nanometer-Scale Devices, ASPDAC, 21-24, March (2008) 2. Liao, W., Li, F., He, L.: Microarchitecture Level Power and Thermal Simulation Considering Temperature Dependent Leakage Model, ISPLED, Seoul, Korea, August 23-27 (2003) 3. Dadvar, P., Skadron, K.: Potential Thermal Security Risks, 21st IEEE SEMITHERM Symposium, (2005)
Thermalaware Register File based on Heat Transfer
101
4. Brooks, D., Martonosi, M.: Dynamic Thermal Management for HighPerformance Microprocessors, HPCA, Monterrey, Mexico, January (2001) 5. Rotem, E., Hermerding, J., Aviad, C., Harel, C.: Temperature measurement in the Intel CoreTM Duo Processor, THERMINICS, Nice, France(2006) 6. Kim, J., Jhang, S.T., Jhon, C.S.: Dynamic Register-Renaming Scheme for Reducing Power-Density and Temperature, SAC, Sierre, Switzerland, March 2226 (2010) 7. Jayaseelan, R., Mitra, T.: Dynamic Thermal Management via Architectural Adaptation, DAC, San Francisco, California, USA, July 26-31 (2009) 8. Heo, S., Barr, K., Asanovic, K.: Reducing Power Density through Activity Migration, In Proc. ISLPED, Seoul, Korea. August 25-27 (2003) 9. Patel, K., Lee, W., Pedram, M.: Active bank switching for temperature control of the register file in a microprocessor, In Proc. GLSVLSI, Stresa-Lago Maggiore, Italy. March 11-13, (2007) 10. Zhou, X., Yu, C., Petrov, P.: Compiler-Driven Register Re-Assignment for Register File Power-Density and Temperature Reduction, In Proc. DAC, Anaheim, California, USA. June 8-13 (2008) 11. Incropera, F.P., DeWitt, D.P.: Fundamentals of Heat and Mass Transfer, Fifth Edition, John Wiley & Sons (2002) 12. Kessler, R.E., McLellan, E.J., Webb, D.A.: The Alpha 21264 Microprocessor Architecture, IEEE Micro, March, (1999) 13. Doug, R.D., Burger, D., Keckler, S.W., Austin, T.: Sim-alpha: a Validated, Execution-Driven Alpha 21264 Simulator (2001) 14. Skadron, K., Stan, M.R., Sankaranarayanan, K., Huang, W.: Temperature aware Microarchitecture, In Proc. ISCA, San Diego, California, USA. June 11-13 (2003) 15. Austin, T., Larson, E., Ernst, D.: SimpleScalar: An Infrastructure for Computer System Modeling, Computer, vol. 35, no. 2, pp. 59-67, February (2002) 16. Brooks, D., et al.: Wattch: A Framework for Architectural-Level Power Analysis and Optimizations. In ISCA (2000) 17. International Technology Roadmap for Semiconductors, http://www.itrs.net/ 18. Skadron, K., et al.: HotSpot: Techniques for Modeling Thermal Effects at the Processor-Architecture Level, THERMINIC, Madrid, Spain, October 1-4 (2002) 19. SPEC2000INT benchmark at: http://www.spec.org/cpu 20. Sherwood, T., et al.: Basic Block Distribution Analysis to Find Periodic Behavior and Simulation Points in Applications. In PACT (2001)
Analysis of Autonomous Bandwidth-Delay-Balancing Characteristic in the Decay Usage Scheduler Kyeongho Park1 , Ju Hyun Lee2 , Hoyoung Hwang3 , Chang-Gun Lee4 , Sang Lyul Min5 , and Hyo-Joong Suh6 1
2
3
4
5
6
School of Computer Science and Engineering, Seoul National University, 151-744, Seoul, Rep. of Korea
[email protected] School of Computer Science and Engineering, Seoul National University, 151-744, Seoul, Rep. of Korea
[email protected] Division of Computer Engineering, Hansung University, Seoul, 136-792, Rep. of Korea
[email protected] School of Computer Science and Engineering, Seoul National University, 151-744, Seoul, Rep. of Korea
[email protected] School of Computer Science and Engineering, Seoul National University, 151-744, Seoul, Rep. of Korea
[email protected] School of Computer Science and Information Engineering, The Catholic University of Korea, Bucheon, Gyeonggido, 420-743, Rep. of Korea
[email protected]
Summary. The decay usage scheduler pursues long-term fairness in terms of both service bandwidth and service delay, in contrast to GPS (generalized processor sharing)-based schedulers pursuing short-term fairness only in terms of service bandwidth. Due to this bandwidth-delay-balancing characteristic of the decay usage scheduler, I/O-bound interactive processes are preferred to CPU-bound processes, resulting in fairness and better system utilization autonomously. However, there is no firm understanding of the mixed effects of the decay usage parameters on the service performance. This paper empirically analyzes their effects in terms of the resulting service bandwidth and service delay. Such analysis and understanding provides a basis of controlling the decay usage parameters for desirable service provision as required by applications.
Key words: decay usage, CPU scheduler, fair scheduling, bandwidth-delaybalancing, history-sensitiveness
1 Introduction The decay usage algorithm has been widely used as a CPU scheduler in timesharing systems like UNIX [Bac86], where CPU-bound processes and I/OS.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 6, © Springer Basel AG 2011
104
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
bound interactive processes are mixed. Since the decay usage scheduler gives preference to processes that have consumed little CPU in the recent past, I/O-bound interactive processes tend to be serviced with relatively small delay compared with CPU-bound processes [Hel93]. By providing smaller delay to the process with smaller CPU usage, the decay usage scheduler achieves fairness in terms of both service bandwidth and service delay autonomously. It can be contrasted with GPS (generalized processor sharing)-based schedulers in which fairness is achieved only in terms of service bandwidth [PG93]. However, there is no firm understanding of the inherent properties of the decay usage scheduler. In this paper, we clarify the mixed effects of the decay usage parameters on the service performance and its bandwidth-delay-balancing characteristic. In the decay usage algorithm, the priority of each process is represented by a combination of two values. One is a base priority that is given to the process statically, and the other is dynamically changing CPU usage information. The dynamic CPU usage information is decayed periodically, which gives more weights to the recent usage. As a result, the scheduler prefers processes that have acquired less CPU in the recent past, hence achieving fairness. Naturally I/O-bound interactive processes which consume relatively little CPU quanta tend to acquire CPU before CPU-bound processes, which improves overall system utilization by overlapping CPU and I/O activities. This also improves the responsiveness of I/O-bound interactive processes. However, the decay usage parameters do not directly describe the quality of service such as service rate and service delay. Therefore, it is difficult to predict the performance of processes or to provide the desired services by controlling the decay usage parameters. There have been some works on the characteristics of the decay usage algorithm [Hel93, Epe98, EJ99], but their results are limited in the sense that only CPU-bound processes are assumed and the focus is given only to total CPU quanta (service bandwidth) each process receives. In other words, they fail to address the inherent properties of the decay usage in general situations where CPU-bound processes and I/Obound interactive processes are mixed. In this paper, service delay is considered as important a factor as bandwidth in evaluating the service each process receives. As the result, the properties of the decay usage are analyzed for processes with various CPU workloads in the combined view of service bandwidth and service delay. The fact that the decay usage prefers processes with little CPU usage and resultingly reduces their service delay implies an autonomous trade-off relationship between the service bandwidth and service delay, and we denote this property as bandwidth-delay-balancing. We empirically show the bandwidthdelay-balancing property among processes with the same base priority and the spectra of bandwidth-delay-balancing based on base priorities and historysensitiveness. These observations lead to understanding of how base priority and other parameters affect the service characteristics in terms of bandwidth and delay.
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
105
By clarifying inherent but previously obscure properties of the decay usage, we expect to establish an analyzable model of the algorithm. These results are also expected to be a basis of controlling the decay usage parameters for desirable service provision as required by users. The remainder of the paper is organized as follows. In Section 2, the decay usage algorithm is described and related works are reviewed. The bandwidthdelay-balancing characteristic in the decay usage is clarified in Section 3. In Section 4, it is empirically shown that there exist spectra of bandwidth-delaybalancing based on the base priority and history-sensitiveness. Also, the meaning of each parameter in the algorithm is analyzed. We discuss the potential applications of our observations in Section 5. Finally, Section 6 summarizes our work.
2 An overview of the decay usage scheduler 2.1 The decay usage scheduler The decay usage is a dynamic priority-based scheduling algorithm. The priority of a process i is determined from these two values: • base priority statically given to the process (basei ) • past CPU usage information of the process (cpui ) Basically, the decay usage algorithm works as follows [Hel93]: – When the process i consumes a quatum, cpui = cpui + 1 – Every T quanta for all processes, cpui = cpui /D (D > 1) – Schedule the process with the smallest prii , where prii = R ∗ cpui + basei Various implementations in real systems are conceptually based on this basic algorithm [Bac86, GC94, MN04, Vah96, Lov05]. Each process is given a fixed base priority, basei , and this can be interpreted as a basic resource right of the process in the system. The smaller basei is, the higher its resource right is. cpui contains the CPU usage history of the process i. Its initial value is 0 and it accumulates usage information by increasing whenever the process consumes a CPU quantum. However, this CPU usage information, cpui , is decayed by 1/D in every T quanta. This periodic decay is to make the usage information recency-weighted, meaning that the more recent information has a greater impact on the final priority. In other words, T and D determine history-sensitiveness of the scheduler. The dynamic priority of the process i is a combined value of basei and cpui :
106
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
Fig. 1. An example of the decay usage scheduling
prii = R ∗ cpui + basei
(1)
where R is a system parameter reflecting the weight of cpui in prii . The CPU scheduler selects the process with the lowest prii . Intuitively speaking, the smaller basei is, the better service the process i tend to receive. At the same time, the smaller cpui is, the better service the process i tend to receive. In summary, the parameters of the decay usage are a per-process variable (basei ) and system-wide variables (R, T , and D). Their values are to be set properly by system designers. Figure 1 shows an example of the decay usage scheduling. There are three processes, A, B, and C, with their base priorities being 0, 4, 4, respectively. It is assumed that D = 2, T = 20, and R = 1. Each rectangle in the upper part of the figure illustrates the arrival time and the length (i.e., required CPU quanta) of a request. Whereas the processes A and B generate relatively heavy CPU requests, the process C generates requests intermittently. Intuitively speaking, the processes A and B are CPU-bound ones, while the process C is an I/O-bound interactive one. In the middle of the figure, the values of prii and the scheduled process in each time quantum are shown. The priority prii starts from basei and changes according to cpui that increases with services of the corresponding process and decreases by decaying in every T quanta. The arrows in the lower part of the figure depict the duration that the requests reside in the system until they finish (i.e., the service delay of the requests). Process A experiences better service delays than process B since A’s base priority is the smaller (that is, the higher). Process B and C have equivalent base priorities, but C’s service delays are much better than B. It is because C generates only small requests intermittently, maintaining priC smaller than priB . Process C also acquires slightly better services than process A though
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
107
A’s base priority is the smaller. In the sense of served bandwidth, the CPUbound processes A and B are acquiring good services taking large portions of CPU bandwidth. In the sense of responsiveness, however, the I/O-bound interactive process C is acquiring a good service experiencing smaller delays. 2.2 Related works Fairness is one of the most important requirement in scheduling algorithms. In GPS-based scheduling algorithms such as PGPS [PG93], SFQ [GVC97], and WF2 Q [BZ96], fairness means provisioning of bandwidth in proportion to the weight of each process, in an instantaneous manner. Therefore, they are also known as proportional-share schedulers. This philosophy is also found in the CPU schedulers such as lottery scheduling [WW94], TFS (time function scheduling) [FS95], and stride scheduling [WW95]. On the other hand, some schedulers prefer processes with little CPU usage, trying to balance the service bandwidth and service delay in a long-term viewpoint. Such examples include decay usage [Hel93], hybrid lottery scheduling [PMG99], and priority enhanced stride scheduling [MMG02]. However, the analysis of their characteristics are limited. Although there exist some works on the properties of the decay usage, there has been not much sound understanding about the mixed effects of the decay usage parameters on the service performance. Hellerstein [Hel93] analyzed the service rate given to each process in steady-state assuming all processes to be CPU-bound, and derived an algorithm to control the service rate. Epema [Epe98,EJ99] made a similar analysis for multiprocessor systems. However, these works do not address general situations where CPU-bound and I/O-bound interactive processes are mixed. Also, by focusing only on the service rate, they failed to show the important property of the decay usage that compensates processes with little consumed bandwidth with short delays. Petrou et al. [PMG99] mentioned the property of the decay usage preferring I/O-bound interactive applications to CPU-bound ones, in the work on the implementation of lottery scheduler. But further analysis of the property was not given. Other than the decay usage, there are scheduling frameworks considering bandwidth and delay at the same time, such as the service curve-based methods [Cru95, SCP99, PSL03]. In these methods, the required service characteristic of each application is given in the form of a service curve. To meet the requirement, admission control is needed and the application must conform its contract. The decay usage does not allow such precise control as the service curve, while it is simple to implement and does not constrain the workload characterization.
108
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
3 Bandwidth-delay-balancing characteristic As stated before, previous analyses on the decay usage algorithm focused on the service bandwidth given to each process. But the service delay is also an important factor to evaluate the quality of service (QoS) that an application receives, especially for an interactive application in which the responsiveness is vital. In the case that the request length is variable, it is appropriate to observe the ratio between the minimum possible service time (i.e., the request length) and the actual service time (i.e., experienced delay), rather than to measure the actual service time itself. We shall use rij to denote the jth request of the process i, with its length being Lji and its service delay being Dij , respectively. With these notations, the quality of service delay that rij experiences is defined as (2) qij = Lji /Dij . In the case of the best service, qij shall be one since Lji equals Dij . On the other hand, qij approaches zero as Dij increases. So 0 < qij ≤ 1. And when n requests of the process i are serviced, the arithmetic mean of qij , DQoSi , is defined as n qij , (3) DQoSi = n j=1
which means QoS in terms of service delay. We also use Wi to denote the total CPU bandwidth served for the process i. Throughout this paper, we shall use Wi and DQoSi to evaluate the service that the process i receives. Since the decay usage algorithm prefers processes that consumed little CPU by lowering the priorities of processes that consumed much CPU, there is a trade-off relationship between the service bandwidth and service delay. In other words, the larger the value of cpui is (by consuming larger bandwidth), the less likely the process i is to be chosen. On the contrary, the process with smaller cpui will have a higher opportunity of service. This can be verified by observing Wi and DQoSi of each process. The first experiment is performed to show the basic relationship of bandwidth and delay. Base priorities of all processes, basei , are equally set to exclude their influence. It means that prii is determined only by the usage information, cpui . Also, decaying operation is prohibited by setting D = 1 since the decay operations in every T quanta dilute the accumulated usage information. In Figure 2, we plot the (Wi , DQoSi )-pairs of 100 processes generating random requests during 1,000,000 quanta. Their base priorities are equally set to zero, with T = 1000 and R = 0.5. The figure shows four graphs when the CPU utilization, U , is set as 0.25, 0.5, 0.75, and 1.0, respectively. It is assumed that the request length of each process follows a normal distribution N (μi , σi2 ), where the parameters μi and σi are extracted from uniform distributions U (0, 10) and U (0, 2), respectively. The workload of each
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
109
Fig. 2. Bandwidth-delay-balancing relationship among processes with the same base priority
process i, ui , is randomly set following a uniform distribution U (0.01, 0.2). Then, it is normalized so that ui = U . The inter-arrival time between two consecutive requests of the process i follows an exponential distribution Exp(λi ), where λi = μi /ui such that the resulting process utilization is ui . We will use the same setting for other simulations, unless otherwise mentioned. Figure 2 clearly shows that there exists a trade-off relationship between Wi and DQoSi among processes with the same base priority. Processes taking large CPU bandwidth will receive low quality service in the viewpoint of delay, resulting in the balancing of (bandwidth, delay)-pair. The (Wi , DQoSi )-pairs on the trajectory are considered as an equivalent quality of service in the decay usage. This characteristic is effective regardless of the system utilization, U . When U is small, most points are located in the upper-left region. It is because the processes generate less workloads. This balancing characteristic is still effective for other base priorities than zero as long as they are the same. It is because base priorities have relative meaning and only the differences among them are meaningful. This property can be summarized as follows:
110
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
Property 1: There exists a bandwidth-delay-balancing relationship among processes with the same base priority. This property is observed for all ranges of the decay usage parameters, but the degree of DQoS degradation according to bandwidth increment, i.e., the degree of bandwidth-delay-balancing, is dependent on the parameters. In the next section, the influence of the decay usage parameters on the degree of balancing is explained.
4 Spectra based on the decay usage parameters In a realistic situation, a mix of processes with different base priorities is common, unlike in the previous simulation where all processes are assumed to have the same base priority. In such a situation, the degree of bandwidthdelay-balancing may be influenced by two factors determining the priority of each process: • •
the gaps among base priorities and the CPU usage information with periodic decay (i.e., history-sensitiveness).
In this section, we clarify their effects empirically. We also examine the effects of various system parameters on service quality. 4.1 Base priority and bandwidth-delay-balancing Figure 3 shows multiple graphs of (Wi , DQoSi )-pairs, each of which is simulated with specific base priority gaps and history-sensitiveness. In each run of the simulation, 100 processes are divided into four different base priority groups and 25 processes in each group are given the same base priority. CPU utilization is assumed as one, and other conditions are the same as the previous simulation. We observe the service quality of the processes while changing the gaps among the groups’ base priorities (horizontal direction in the figure). The notation of base = {b1 , b2 , b3 , b4 } at the top of the figure means that the base priorities of four process groups are b1 , b2 , b3 , and b4 . We also observe the service quality of the processes while changing the decay rate of CPU usage information, D (vertical direction in the figure). To see the effect of base priority gaps among process groups, observe the graphs in the row of D = 1.20. When there is no gap among base priorities (the leftmost graph), they exhibit similar bandwidth-delay-balancing characteristic as in the experiment in the previous section. As the gaps increase, however, the trajectories of (Wi , DQoSi )-pairs of the process groups are differentiated more and more clearly. This result can be interpreted as follows. When the base priority gaps are small, they barely affect the resultant priority, prii , and the CPU usage information, cpui , dominates prii values. Thus, as
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
111
Fig. 3. The spectra of bandwidth-delay-balancing based on base priority gaps and history-sensitiveness
observed in the previous section, all process groups show similar bandwidthdelay-balancing characteristic in which only the past CPU usage information is reflected. When the gaps are larger, in contrast, they have more effect on re-
112
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
DQoSi process groups with smaller basei
process groups with larger basei
Wi Fig. 4. The effect of the priority gaps on the spectrum
sultant priorities while CPU usage information has less effect. Therefore, the bandwidth-delay-balancing characteristic is faded and delay quality of processes with large bandwidth is not degraded much. This phenomenon is first observed in the group with the smallest base priority, and it is propagated to the groups with larger base priorities. Consequently, the service difference among process groups caused by the base priority gaps becomes clear. That is, the processes with smaller base priorities are located in the upper region of the graph since they experience smaller delay for a given bandwidth compared with other processes with larger base priorities. It can be concluded that the combined service quality of delay and bandwidth decreases as the base priority increases. It is more apparent when the processes with the same base priority are grouped with dotted lines, as shown in the rightmost graph in the row of D = 1.20. This characteristic is summarized as follows: Property 2: The degree of bandwidth-delay-balancing is dependent on the relative value of base priority and it forms a continuous spectrum according to the base priority gap. Figure 4 depicts the general effect of the priority gaps on the spectrum. As the gaps increase, the trajectories are differentiated more clearly. The spectrum of balancing based on the relative base priority is more apparent when the decay rate of usage information is larger (i.e., larger D in Figure 3). This is because the base priority have a relatively larger effect on the final priority of the process when the decay rate is large. As one ex-
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
113
treme example, when D = 1.0, the degree of balancing does not change across process groups regardless of the base priority gaps. This is because the CPU usage information is never decayed, therefore dominating the resultant priority, while completely eliminating the effect of base priority gaps. As the other extreme example, when D = 10.0, the difference of degree of balancing among groups becomes apparent as the base priority gaps increase. This is because base priorities have major effect on the priorities of processes, where the effect of CPU usage information disappears due to a large decay. 4.2 History-sensitiveness and bandwidth-delay-balancing To see the effect of the decay rate, D, of past CPU usage information, observe the graphs in the column of base = {0, 0, 0, 0}. As D increases, the bandwidthdelay-balancing characteristic becomes obscure and the bottommost graph depicts points dispersed over a wide area. This is because the decay operation is to decrease the past CPU usage information, thus fading the bandwidthdelay-balancing characteristic. This means that there exists another dimension of continuous spectrum of bandwidth-delay-balancing based on the decay rate. The phenomenon that the balancing is faded is also observed in the other columns with larger base priority gaps. In addition to D, other parameters T and R can also control the effect of the past CPU usage information. T determines the decay period. So increment of T slows the decay, that is, increases the effect of the past CPU usage information. R is the weight of cpui in prii . Thus, by increasing R, the CPU usage information has more effect on the resultant priority. Therefore, it is expected that control of T and/or R results in similar spectra as in the case of D. In other words, the three parameters, D, T , and R, are categorized as parameters related to the ‘CPU-usage-history sensitiveness’ for scheduling processes. These observations are summarized as follows: Property 3: The degree of bandwidth-delay-balancing is dependent on the history-sensitiveness and there exists another dimension of continuous spectrum based on it. Figure 5 depicts the general effect of the history-sensitiveness on the spectrum. 4.3 Responsiveness to dynamic workload changes The decay usage scheduler does not require any description of traffic characteristics from the processes. It provides appropriate services to the processes by collecting only CPU usage information. If workload of a process changes, the scheduler dynamically responds to the change by adjusting service delays of the process.
114
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
DQoSi process groups with smaller basei
process groups with larger basei
Wi Fig. 5. The effect of the history-sensitiveness on the spectrum
Parameter T controls not only the history-sensitiveness, but also the system’s responsiveness to workload changes. As T increases, the system becomes less responsive to the changes. Figure 6 shows the change of service quality of a process following its abrupt workload changes, for different T values. The observed process continually generates workloads of 0.03 except the period between 30000 and 40000 where its workload increases to 0.3. Total workload of background processes is fixed to 0.7, with R = 1. The plotted service qualities are windowed averages, with the window size being 2000. When D is small (D = 1.1), it is clear that the responsiveness is higher for a smaller T . However, increment of D (D = 2) diminishes the history-sensitiveness, resulting in the weakened effect of parameter T on the responsiveness. Property 4: The smaller the period of decay is, the higher the system’s responsiveness to workload changes is.
4.4 Service quality according to system workload Figure 7 shows the service quality of a process group while changing its base priority and background workload. The process group we observe is composed of 10 processes with same base priority, basef , and they generate total workload of 0.3. We check four basef values, 0, 10, 20, 30. The background workload to control the system utilization is generated by 30 processes with base priorities of 0, 1, 2, ..., 29, respectively. The background workload is set
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
115
Fig. 6. The effect of T on the responsiveness to the workload changes
as 0.2, 0.5, 0.7, and 0.9, meaning that total system utilization is set as 0.5, 0.8, 1.0, and 1.2 (overloaded), respectively. As shown in the row of basef = 0, when the base priority of the observed process group is relatively small, the service quality barely changes by the increase of background workload. Even when the system is overloaded, the service quality is maintained. As basef increases, however, the difference of service quality according to the system utilization also increases. Thus, the process with relatively small base priority has better service predictability.
116
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
Fig. 7. Service predictability according to base priority and system utilization
Property 5: The smaller the relative base priority of a process is, the higher its service predictability is. While the previous experiments are to observe collective behavior of multiple processes with the same base priority, we conduct another experiment to observe the behavior of one process, say process i, out of 20 running processes. Each graph in Figure 8 shows the service quality of the process i according to the change of its workload, Wi , with fixed base priority, basei . The other 19 processes whose base priorities are set to 31 to 49, generate random traffic, with the sum of all workloads being one. For the process i, basei changes from 0 to 50 with the step size of 10. For each basei , we increase Wi from 0.01 to 0.30 with the step size of 0.01. Since the sum of all workloads is larger than one, the system is always overloaded. For the system-wide decay usage parameters, we use D = 2, T = 1000, and R = 0.5. When the base priority of the observed process is 0 (i.e., basei = 0), its priority is much higher than other processes and it always receives best service. As basei increases, however, the base priority gap with other processes decreases and priority inversion may happen when Wi is large. As a result, the observed service quality starts to
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
117
Fig. 8. Service quality in an overloaded system
degrade at a certain value of Wi . As basei is getting larger, the starting point of degradation is getting smaller. When basei = 50, the priority of the process is lower than other processes for most of the running time, thus it can hardly receive service. Property 6: Even in the overloaded situation, the service quality of a process may be kept steady if its workload is within a threshold, which is dependent on the relative value of base priority. As the workload increases over the threshold, the service quality degrades gracefully.
4.5 The effect of traffic pattern and the number of processes In the previous sections, the traffic patterns are generated randomly (as explained in Section 3) but they are fixed for every run in a set of simulations. Therefore, the effect of the change of traffic patterns is not clear. In this section, the effect of traffic pattern change on service quality is examined. And the effect of the number of the processes in a process group is also observed. Figure 9 is to show the effect of traffic pattern change on the trend of service quality of each process group. We use D = 1.2, T = 1000, and R = 0.5. D is intentionally set to a low value to make the trajectories clear by lessening the dilution of bandwidth-delay-balancing. Total 100 processes are divided into four groups of 25 processes, with their base priorities being 0, 10, 20, and 30, respectively. The total workload of the processes in each group is set to 0.25. With these conditions, the traffic-generating parameters of each process
118
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
Fig. 9. The effect of traffic pattern changes to service quality
are newly chosen in each run of the simulation. That is, the total workload and the number of the processes are fixed, but the traffic pattern of each process changes randomly. The graphs in the figure are randomly chosen ones from 100 runs of the simulation. The position of each (Wi , DQoSi )-pair is naturally varying as the traffic pattern changes. However, the positions and shapes of the trajectories are very similar in every graph. This shows that the trend of service quality is preserved when traffic pattern changes. Figure 10 is to examine the effect on service quality when the number of processes in a process group changes. Assume one process group composed of 50 processes with workload 0.01 each and another process group composed of five processes with workload 0.1 each. The total workloads of each group is equivalent but the CPU usage information of each process, i.e., cpui , will accumulate differently. In the simulation, we assume two process groups, A and B. Group A has 20 processes and their total workload is 0.2. They are represented by black circles in the figure. The number of processes in group B, nB , is 20, 40, 60, and 80 in each run of the simulation, with total workload being fixed as 0.8. They are represented by white circles in the figure. The base priorities are set to 0 for group A and 20 for group B. And we set D = 1.2, T = 1000,
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
119
Fig. 10. Service quality according to the number of processes
and R = 0.5. Using these parameters, the effect of nB ’s change on group A is examined. According to the result, the increase of nB deteriorates the service quality of group A. This is due to the inherent characteristic of the decay usage algorithm that the priority is determined by the usage information. Assuming that the total workload of group B remains fixed, the average workload of each process decreases as nB increases. With large nB , therefore, the processes in group A must compete with increased number of processes from group B whose prii tend to accumulate slowly. This disadvantages group A in the competetion, resultingly worsening their service quality.
5 Potential application of the observations From the previous observations, the meaning of parameters can be summarized as follows: • base priority given to each process (basei ): It determines the degree of service differentiation in the combined sense of delay and bandwidth. • system-wide parameters (D, T , and R): They control the CPU-usagehistory sensitiveness and, in turn, determine the degree of bandwidth-
120
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
delay-balancing. The history-sensitiveness is diminished as D increases, T decreases, or R decreases. Diminishing the history-sensitiveness dilutes the degree of bandwidth-delay-balancing, while making clear service differentiation by the base prioritiy gaps. These understandings allow us to control the parameters to make the scheduler behave as desired. For example, by setting R = 1, T = “the number of processes in the queue”, D = ∞, and basei = 0 for all i, the decay usage works as a round-robin scheduler. Also, the observations in Figure 2 (There exists bandwidth-delay-balancing characteristic among processes with same base priority.) and Figure 3 (Each group of processes with the same base priority belongs to a differentiated band.) imply the potential of service classification parameterized by the base priority. In such a service model, the processes in the same service class receive equivalent service in the combined sense of delay and bandwidth—the smaller the base priority is, the better the combined service is. By modelling these relationship systematically, we expect to establish a new charging scheme in which delay and bandwidth are balanced. Based on the results in Figure 7, while it seems difficult to build a guaranteed service model, we expect that it is possible to establish a probabilistic service model based on the system utilization and relative base priorities. Figure 8 shows that the service quality stays stable regardless of the base priority until the workload reaches a specific value, at which the service quality starts gradual degradation. This characteristic implies a potential service in which the service quality is guaranteed as long as the workload is within the reservation, while it degrades gracefully on workload violation. More concretely, by widening the gaps among base priorities of the processes and decreasing the history-sensitiveness using D, T , and R, we can make the decay usage work as a fixed-priority scheduler. Furthermore, by controlling these parameters, we expect that it is possible to provide guaranteed service as in fixed-priority scheduling for requests conforming to the reservation and degrade the service quality gracefully for violating requests.
6 Conclusions In this paper, we clarify that the bandwidth-delay-balancing is an inherent property of the decay usage algorithm. We also show that there exist spectra of bandwidth-delay-balancing based on the decay usage parameters. bandwidthdelay-balancing among processes with the same base priority is caused by the characteristic that the decay usage gives preference to processes that acquired little CPU quanta in the recent past. As such, the degree of bandwidthdelay-balancing forms a continuous spectrum according to the relative base priorities. There also exists another domain of spectrum based on historysensitiveness that is controlled by decay rate of past CPU usage information.
Bandwidth-Delay-Balancing Characteristic of the Decay Usage Scheduler
121
We empirically analyzed the effects of the parameters and derived their meaning. Such analysis and understanding provides a basis of controlling the decay usage parameters for desirable service provision as required by applications.
References [Bac86]
Bach, M.J.: The Design of the UNIX Operating System. Prentice-Hall, New Jersey (1986) [BZ96] Bennett, J.C.R., Zhang, H.: WF2 Q: Worst-case Fair Weighted Fair Queueing. Proc. of INFOCOM ’96, 120–128 (1996) [Cru95] Cruz, R.L.: Quality of Service Guarantees in Virtual Circuit Switched Network. Journal on Selected Areas in Communications, 13(6), 1048– 1056 (1995) [Epe98] Epema, D.H.J.: Decay Usage Scheduling in Multiprocessors. ACM Trans. Computer Systems, 16(4), 367–416 (1998) [EJ99] Epema, D.H.J., de Jongh, J.F.C.M.: Proportional-Share Scheduling in Single-Server and Multiple-Server Computing Systems. ACM SIGMETRICS Performance Evaluation Review, 27(3), 7–10 (1999) [FS95] Fong, L.L., Squillante, M.S.: Time-Function Scheduling: A General Approach To Controllable Resource Management. IBM Research Report RC 20155 (1995) [GC94] Goodheart, B., Cox, J.: The Magic Garden Explained: The Internals of UNIX System V Release 4, an Open Systems Design. Prentice-Hall, New Jersey (1994) [GVC97] Goyal, P., Vin, H.M., Cheng, H.: Start-Time Fair Queueing: A Scheduling Algorithm for Integrated Services Packet Switching Networks. IEEE/ACM Trans. Networking, 5(5), 690–704 (1997) [Hel93] Hellerstein, J.L.: Achieving Service Rate Objectives with Decay Usage Scheduling. IEEE Trans. Software Engineering, 19(8), 813–825 (1993) [Lov05] Love, R.: Linux Kernel Development, 2nd Ed. Novell, Massachusetts (2005) [MN04] McKusick, M.K., Neville-Neil, G.V.: The Design and Implementation of the FreeBSD Operating System. Addison-Wesley, Massachusetts (2004) [MMG02] Moal, D.L., Masuda, M., Goshima, M., Mori, S., Nakashima, Y., Kitamura, T., Tomita, S.: Priority Enhanced Stride Scheduling. IPSJ Trans. HPCS, 43(SIG 6), 99–111 (2002) [PG93] Parekh, A.K., Gallager, R.G.: A Generalized Processor Sharing Approach to Flow Control in Integrated Services Networks: The Single-Node Case. IEEE/ACM Trans. Networking, 1(3), 344–357 (1993) [PMG99] Petrou, D., Milford, J.W., Gibson, G.A.: Implementing Lottery Scheduling: Matching the Specializations in Traditional Schedulers. Proc. of USENIX ’99, 1–14 (1999) [PSL03] Pyun, K., Song, J., Lee, H.-K.: A Generalized Hierarchical Fair Service Curve Algorithm for High Network Utilization and Link-Sharing. Computer Networks, 43, 669–694 (2003) [SCP99] Sariowan, H., Cruz, R.L., Polyzos, G.C.: SCED: A Generalized Scheduling Policy for Guaranteed Quality-of-Service. IEEE/ACM Transactions on Networking, 7(5), 669–684 (1999)
122 [Vah96]
K. Park, J. H. Lee, H. Hwang, C.-G. Lee, S. L. Min, and H.-J. Suh
Vahalia, U.: UNIX Internals: The New Frontiers. Prentice-Hall, New Jersey (1996) [WW94] Waldspurger, C.A., Weihl, W.E.: Lottery Scheduling: Flexible Proportional-Share Resource Management. Proc. of the First Symposium on Operating Systems Design and Implementation, 1–11 (1994) [WW95] Waldspurger, C.A., Weihl, W.E.: Stride Scheduling: Deterministic Proportional-Share Resource Management. Technical Report MIT/LCS/TM-528, MIT, Massachusetts (1995)
A Reliable Nested Transaction Model with Extension of Real-Time Characteristics Seung-Jin Moon1 and Sanghoon Lee2 1 2
Department of Computer Science The University of Suwon
[email protected] Department of Computer Science The University of Suwon
[email protected]
Summary. This paper focuses on the simpler problem of scheduling reliable nested transaction for a single processor. As real-time systems are becoming more complex and more distributed, a concept of nested transactions proposed by Moss are needed to provide flexibility and performance in distributed complex and dynamic systems. Mosss model is extended to hard real-time systems by the addition of explicit timing constraints. Though the model allows multiprocessor and distributed implementations, solving a real-time nested transaction model scheduling problem for a single processor is viewed first step toward solving the more general problem. The concepts of ACID properties: atomicity, consistency, isolation and durability are extended to nested transaction. A reliable nested transaction model with realtime characterization, based upon the concept of subtransactions, is presented. For a single-processor environment, the well-known Priority Ceiling Protocol can be extended to support the reliable nested transaction model, yielding an integrated concurrency control and scheduling algorithm that guarantees timing constraints of a set of nested transactions and maintains consistency of the database. It can be verified that the Real-Time Nested Priority Ceiling Protocol prevents unbounded blocking and deadlock, and maintains the serializability of a set of hard real-time transactions.
Key words: Real-time system, database, nested transaction, reliability, autonomous control.
1 INTRODUCTION As more and more real-time systems become complex and distributed, it has been required to achieve powerful and flexible control structures, such as autonomous control system, to support distributed and reliable computing effectively. In conventional real-time database model, transactions assumed to be flat have a single thread of control and are treated as a single unit with respect to scheduling, concurrency control, and fault recovery. They often cannot
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 7, © Springer Basel AG 2011
124
Seung-Jin Moon and Sanghoon Lee
provide the flexibility and performance required for complex and dynamic systems [HR93]. So, a reliable transaction model with real-time characterization, which can provide more decomposable and finer grained control of concurrency and recovery, is needed. Moss [Mos81] proposed the concept of nested transactions as a partial solution to these problems. The nested transaction model allows a transaction to be decomposed into a hierarchy of subtransactions. Subtransactions can be scheduled and executed separately as a unit, either concurrently on a single processor or in parallel on multiple, possibly distributed, processors. A flat transaction, the simplest type of transaction in transaction processing system, has all the properties: atomicity, consistency, isolation and durability(ACID) [HR83]. These properties guarantee database transactions are processed reliably. In this paper, with extending the concept of failure atomicity ensures the all-or-noting as well as isolation and durability properties, we present a reliable nested transaction model called the Real-Time Nested Transaction Model(RTU-NTM) for an uniprocessor environment. We extend the concept of nested transactions and improve its utility for use in real-time systems. Though we believe value of this model in the long term will be for systems that allow truly parallel execution, our initial study focusses on the simpler problem of scheduling nested transactions for a single processor. We present an integrated scheduling and concurrency control algorithm, the Real-Time Nested Priority Ceiling Protocol (RT-NPCP), that not only guarantees timing constraints of a set of real-time nested transactions but also maintains consistency of the databases, with or without the possibility of bounded transaction aborts. The rest of the paper is organized as follows: Section 2 describes the motivation and background for this study, including some related work. Section 3 describes the Real-Time Nested Transaction Model. Section 4 defines the Real-Time Nested Priority Ceiling Protocol. Finally, conclusions and plans for future studies are given in Section 5.
2 RELATED WORK AND MOTIVATION Real-time models of flat transactions [AG92, Lin89, LL73, UB92] and nested transactions [ASA05,CG94,EBE01,HC02,XWX08] have been studied by several researchers. In [SRSC91], Sha et al. proposed a priority-driven two-phase lock protocol called the read/write priority ceiling protocol that avoids deadlocks and guarantees that a job is blocked at most once by a lower priority job. In [STDW96], Squadrito et al. extended the read/ write priority ceiling protocol [SRSC91] for real-time object-oriented databases. Also, Nakazato [NL93] proposed the Type-Specific Convex Ceiling Protocol(TCCP) for controlling real-time concurrent transactions with read and write operations, which guarantees the serializability of real-time transactions, freedom from deadlock and predictable temporal behavior. There are a lot of advantages of a nested transaction model. First, hierarchical organization in a nested transaction model is a powerful design technique. This may results that real-time nested trans-
A Reliable NT Model with Extension of Real Time Characteristics
125
actions based on the concept of the subtransaction contribute better design methodology for building more reliable and efficient real-time database applications. Second, nested transactions provide for the safe control of concurrency within a transaction hierarchy. One transaction can run many subtransactions in parallel in multiprocessor distributed database systems, with the guarantee that they will preserve the consistency constraints of the database. Third, nested transactions permit finer-grained recovery from failures. A subtransaction can safely be aborted and rolled back without affecting transactions outside of its hierarchy. The maximum benefits of a nested transaction model are apparent for multiprocessor and distributed real-time database systems, since subtransactions may be distributed among various processors. This permits subtransactions to execute in parallel, improving response time. Rollback and recovery of aborted subtransactions may be kept local, improving response time and also decreasing design complexity. For uniprocessor systems, we do not have all these benefits, but several advantages remain. All the advantages of top-down decomposition and bottom-up composition of modules apply. This permits more reuse of existing software, and clearer control structures for the design and implementation of complex transactions, which generally will result in greater reliability. Another advantage that applies even for uniprocessor systems is the isolated rollback of a subtransaction in the case the subtransaction must be aborted, which can reduce worst-case fault recovery time. Finally, even with only interleaved execution on a single processor, decomposition into concurrent subtransactions can sometimes provide faster response time than the flat transaction model, since it may allow one subtransaction to proceed while another is waiting for I/O. These benefits are significant enough to warrant study of real-time nested transactions in a uniprocessor environment. Furthermore, such study serves as a stepping stone toward future research on nested transactions in multiprocessor and distributed real-time systems.
3 REAL-TIME NESTED TRANSACTION MODEL In this section, we define real-time nested transactions and introduce the assumptions and notation which are necessary to describe Real-Time Nested Transaction Model(RT-NTM). 3.1 Nested Transaction A transaction routine is a specification of a transformation of the state of the database, including the algorithm to perform the transformation and the resources needed by the algorithm. We use P and Pi to denote transaction routines. A transaction instance τ is a particular request for execution of a transaction routine P . Each transaction instance request arrives at some time and becomes ready to be executed. The execution of transaction routine P in
126
Seung-Jin Moon and Sanghoon Lee
response to request τ starts at some time after the arrival time. Requests that have arrived, but for which the corresponding transaction executions have not yet completed are called active. We use τ and τi to denote transaction instances. Where it is used alone, the term transaction means a transaction instance. However, it will be seen that many cases this distinction is not crucial, as most of the statements made about transaction instances also hold for the corresponding transaction routines. The relationships between transactions are described in terms of trees. This tree-based terminology applies to both transaction routines and transaction instances, so in this paragraph the term ”transaction” applies to both cases. Every non-leaf transaction may be composed of any number of subtransctions, recursively. This result in an arbitrarily hierarchy of nested transactions, called a transaction tree, which displays the static aspect of the transaction invocation hierarchy. The entire collection of transactions forms a forest. A transaction that is not subtransaction of any other transaction is called a root transaction. A non-leaf transaction is called a parent, and its subtransactions are called its children. The ancestors of a transaction are all the transactions on the path from the transaction to root of its transaction tree, excluding the transaction itself. The subtransactons of a specified transaction are the transactions in the subtree rooted at the specified transaction, including the specified transaction. A realtime transaction requires the use of a set of resource. Access to resources is controlled by locks. As in the traditional transaction model, all resources are permanent data objects in the sense that they have exactly one value at any time, and continue to hold the same value until the value is updated by a transaction. That is, data objects are not volatile, and do not have multiple versions. Any temporal consistency requirements are assumed to be insured indirectly, via the choice of the periods and deadlines of transactions that update the database. Different kinds of locks may be defined, with different conflict relationships. Two lock modes are said to be in conflict if concurrent accesses to the same resource by transactions with the two modes (e.g. read/write lock modes) may violate the consistency constraint of the databases. Two transactions that access the same resource with conflicting lock modes are said to conflict-access the resource. For example, an exclusive lock on a resource conflicts with any attempt to acquire another lock on the same resource. A read lock on a resource conflicts with any attempt to acquire a write lock on the same resource, but does not conflict with other read locks; a write lock behaves like an exclusive lock, conflicting with any attempts to acquire read or write locks. During the execution of a transaction, it may acquire and later release locks which protect resources that are used by the transaction. In order to acquire a lock on a resource σ, a transaction issues a Lock(σ) operation, and to release the resource it issues an U nlock(σ) operation. The order of acquiring and releasing is assumed to follow a pre-defined protocol such as a two-phase locking protocol (2PL) [EGLT76]. According to the 2PL protocol, a transaction acquires all the locks which it needs before it releases any locks, and releases all the locks by the time it completes. Initially, all locks
A Reliable NT Model with Extension of Real Time Characteristics
127
are said to be free. A transaction is said to hold index a lock from the time it succeeds in acquiring the lock until the time it releases it. A transaction can also retain a lock, which is not as strong as holding the lock. The retention concept is central to the protocols that guarantee serializability of nested transaction execution. When a transaction no longer needs to hold a lock, instead of freeing the lock it can transfer the lock to its parent transaction. The parent transaction retains such locks, until it ultimately frees them. Retention of a lock by a transaction is a place-holder, indicating that the lock is reserved for the use of subtransactions inside the retainer’s sphere, i.e. the subtransactions of the retainer. A transaction outside the sphere of the retainer is not allowed to acquire a conflicting lock but the subtransactions of the retainer potentially can. As an example, if a transaction retains a read lock, a locking policy may guarantee that transactions that are not subtransactions of the retainer cannot acquire and hold a write-lock on the same resource, but it may allow a subtransaction of the retainer to acquire a write lock on the resource. When a lock is not held by any transaction it is whether free or retained by some transaction. In our study we assume only leaf transactions perform database operations on resources directly. If a non-leaf transaction needs to access a resource, it must do so indirectly, by creating a child to do the work. Since we assume that a parent transaction does not execute any database operations such as locking/unlocking resources concurrently with its children, no situations can arise where a child requests locks which are held by the parent, or vice versa, so there can exist no deadlocks between a parent and its children. A child can request a lock retained by its parent in order to hold the lock but a parent cannot request a lock that is held by a child since a parent is assumed not to conduct direct database operations such as locking/unlocking resources. This is a reasonable assumption since in most of the database applications, a parent transaction will require results from its children and thus will have to wait for termination of the child transactions. We also assume that no precedence relationships exist between siblings. The ability to execute sibling transactions in parallel is an important feature of the nested transaction model. The potential benefit of such parallelism is greatest in multiprocessor or distributed systems, where it can reduce response time, but even interleaved concurrency can also be useful in a single-processor system if it allows transactions to execute while their siblings are waiting for completion of I/O. 3.2 Transaction Model When a transaction finishing accessing the last resource that it accesses, it is said to have committed . After a transaction has succesfully committed, the changes that the transaction has made to the system are guaranteed to be permanent. When a transaction has finished its entire execution it is said to have completed . Depending upon the concurrency control protocol used, the commit operation may be same as the complete operation. For example, this
128
Seung-Jin Moon and Sanghoon Lee
is the case under the strict two phase locking protocol, since no locks released until the transaction complete its execution. When a transaction begins but fails to execution, it is said to have aborted . When a transaction is aborted, it is required to immediately roll the values of all data back to a previous stable state. When a transaction is rolled back, all of its subtransaction are required to roll back, regardless of whether they have already committed or not. When a transaction τi is complete, it implicitly releases to its parent any locks that it is holding or retaining. The parent transaction of τi retains all these locks, until it releases them. If τi is a root transaction, it releases all locks to the environment, at which point they become free. Likewise, when a transaction aborts, it also releases all the locks that it holds or retains, and they are then retained by its parent until the parent releases them. Note that our definition of completed transaction only includes successful transaction execution while in the traditional model both committed and aborted transactions are considered to have been completed. In the traditional transaction model, transactions may be aborted to break a deadlock. For real-time transactions, we allow the possibility that a subtransaction may be aborted because it missed a deadline. This allows for fault-tolerant scheduling, in which subtransactions may be given individual deadline; transactions that do not complete within their deadlines may be cut short as in the imprecise computataion model studied by [CLL90, LNL87], or replaced by alternative transactions as in the fault-tolerant scheduling model introduced by Liestman et al. [LC86]. In our model, we extend the concept of failure atomicity. When a transaction is aborted, unlike in the traditional model where the aborted transactions are simply removed from the transaction set, an alternate for the aborted transaction may be initiated to cope with the failure. A substitute transaction is a special purpose transaction in the sense that it is only used when the corresponding original transaction has to be aborted. Substitute transactions provide real-time transaction systems with flexible functionality and permit their performance to degrade gracefully in case of failures. In this study we assume that the substitute transaction must be able to run to the completion with an absolute guarantee that there can be no infinite cycles of transaction aborts and restarts. This assumption is based upon the requirement that every hard-real-time transaction must be executed to completion in bounded time. 3.3 Schedulability Analysis Assumptions To make schedulability analysis possible, we assume a finite set of transaction routines is known prior to the point where the system starts execution. Each transaction routine P consists of a known sequence of code segments, that are executed sequentially, and each code segment has known resource requirements. We also assume that a transaction instance τi never voluntarily suspends its execution while τi holds locks on any resources, and that there is no time-slicing between transactions of equal priority while they are holding
A Reliable NT Model with Extension of Real Time Characteristics
129
locks. This assumption is necessary to bound the time that other transactions may be blocked by τi . For schedulability analysis, we assume a real-time transaction system executes a fixed set of simple periodic processes on a single processor. Each periodic process corresponds to a unique root transaction routine Pi and is characterized by an infinite sequence of instances τi of Pi . Since there is a one-to-one correspondence between processes and root transaction routines, we identify the processes with the corresponding root transaction routines, and use the same notation for their attributes. For example, the period of Pi (and any instance τi of Pi ) is Ti . Since we are assuming processes are simple periodic, the relative deadline of Pi (and τi ) is also Ti . Note that the term process and the notation Pi both refer to both a periodic process and the corresponding root transaction routine. We assume that for each transac tion τi , there is a substitute transaction τi for τi as described in the previous section. When τi is a leaf transaction, τi is a direct substitute for τi . When τi is a non-leaf subtransaction, we assume that τi does the work of identifying the subtransactions of τi to be aborted. Each periodic process Pi is statically associated with a priority p(Pi ), which is also the base priority of all its transactions and subtransactions. Note that if we use the term ”transaction” alone, it means ”transaction instance” and includes not only the instances of the root transaction routine Pi but also the instances of all its subtransactions. Each transaction τi has the base priority p(τi ) = p(Pi ) and may also have several dynamically assigned priorities, called inherited priorities. The active priority p∗t (τi ) of a transaction instance τi is the maximum of its base priority and all of its inherited priorities at time t. The subscript t is omitted when the time at which the active priority is taken is clear from context. We assume subtransactions inherit the base priority of their root transaction, and inherit all the inherited priorities of their ancestors in the transaction hierarchy. The substitute transaction τi for root transaction τi is assumed to inherit the active priority τi has at the moment τi is aborted. Since we are assuming there is only one processor, the processor scheduling algorithm is to execute the highest active-priority transaction among the ready transactions. A transaction is ready to execute if it is an active transaction and it is not currently waiting for resources other than the processor. A currently executing transaction is preempted when a higher-priority transaction becomes ready. Transactions with the same priority are executed according to a First-Come-First-Served (FCFS) discipline, i.e. in the order of transaction arrival time.
4 REAL-TIME NESTED PRIORITY CEILING PROTOCOL This section defines the Real-Time Nested Priority Ceiling Protocol(RTNPCP) - a generalization of Sha, Rajkumar, and Lehoczky’s Priority Ceiling Protocol [SRL90, SRSC91] - and proves that it prevents unbounded blocking and deadlocks, and maintains the serializality of a set of root transactions.
130
Seung-Jin Moon and Sanghoon Lee
4.1 Priority Ceiling The priority ceiling φ(σ, m) of a resource σ for locking mode m is a static priority that is associated with the resource and mode. It is required to be (at least) as high as the highest base priority at which any transaction will ever request a lock (of any mode, on any resource) such that the request would be object-blocked (see definition of object-block in Sect. 4.3) if a lock on σ of mode m is held or retained by another transaction. Note that the lock mode parameter m is omitted if the mode of the lock is clear in the context. In general, a resource may have a different priority ceiling for each mode in which it may be locked [Bak91, SRSC91]. For a ceiling!read/write resource – i.e. one that can be locked in read-only or read-write modes – there are two separate ceilings. The read-ceiling applies to requests for read locks, and the write-ceiling applies to requests for write locks. Applying the definition above, we see that the read [write] ceiling of a resource σ is required to be at least as high as the highest base priority at which any transaction will ever request a lock (of any kind, on any resource) such that the request would be blocked by the locking protocol if a read [write] lock σ is held or retained by another transaction. Note that we intentionally depart from the terminology of Sha, Rajkumar, and Lehoczky [SRL90]. They use the term write-ceiling for what we call the read-ceiling, and they use the term absolute-ceiling for what we call the write-ceiling. Their write-ceiling is so called because it is an upper bound on the priority of a writer-task that accesses the resource. Our write-ceiling is so called because it is an upper bound on the priority of a task (reader or writer) that may blocked by a writer-lock on the resource. We prefer the notation we are using because it generalizes better to more complex forms of locking, i.e. the m-ceiling of a resource is an upper bound on the priority of a task that can be blocked if the resource is locked in mode m. The current priority ceiling φt (σ) of a locked resource σ is the (highest) priority ceiling of the lock(s) currently held or retained on that resource at time t. This is a dynamic value. Note that if σ is read-locked, φt (σ) is equal to the read-ceiling, and if σ is write-locked, φt (σ) is equal to the write-ceiling of σ. The notation φ(σ) is used where the value of the time parameter t is known from context. For an exclusive resource - i.e. one that can only be locked for exclusive access – there is only one priority ceiling, and so φ(σ) can be considered a static value. Such resources are subsumed by the read/write resources, since they can be viewed as a degenerate case for which there are never any requests for read locks (i.e. all lock requests are implicitly for write locks). At any time when a transaction τi is requesting any kind of lock on any resource, σ ∗ denotes a resource with highest current priority ceiling among all the resources for which transactions other than τi hold or retain a lock, τ ∗ denotes one of the transactions holding or retaining a lock on σ ∗ , and φ∗ denotes the priority ceiling of σ ∗ . The value φ∗ is called the system ceiling at the time of the lock request. Note that these values are all dynamic.
A Reliable NT Model with Extension of Real Time Characteristics
131
4.2 Locking Zones In this section we define the concept of locking zone of a transaction τi , which is a generalization of the concept of critical section. We will show that the locking zone of τi satisifies the following properties: • A lower-base-priority transaction τl never blocks a higher-base-priority transaction τh unless τl is already in its locking zone. • A higher-base-priority transaction τh is never blocked by a lower-basepriority transaction τl once τh enters its locking zone. Using the properties of locking zones, we will show later in the section that certain resource scheduling algorithms guarantee that transactions are serializable and that no deadlock or multiple priority inversion can occur. A critical section of an instance of a leaf transaction τi is the time interval bounded by τi ’s execution of the operations Lock(σj ) and U nlock(σj ) where σj is a resource that is locked by τi . A leaf transaction may have multiple critical sections that may or may not overlap. A transaction τi is said to conflict with a transaction τj if at least one of the subtransactions of τi locks a resource which τj also accesses, and they lock them in conflicting modes.The locking zone of a transaction instance τ is defined to be the time interval (in an actual execution history) bounded by the first Lock(σj ) operation and the last U nlock(σn ) operation performed by the leaf transactions of τ . Figure 1 illustrates the locking zones and critical sections of nested transactions. Suppose a schedule is generated for a set of root transaction instances τl , τm , and τh according to a scheduling algorithm. The time interval between time 1 and 22 is a locking zone of τl , since the subtransaction τl locks the resource σ2 for the first time at time 1 and τm unlocks the last reource σ0 at time 22. Locking zones of τh , and τm are also determined in the same way. 4.3 Blocking In this section, we define the term ”blocking” as it is used in RT-NTM. There are two distinct kinds of blocking that may cause a transaction to wait at the point where it requests a lock on a resource. A third kind of blocking may happen to a transaction at any point in its execution, and is due to preemption of the processor by a transaction with lower base priority but which is inheriting higher active priority from some other transaction. A transaction τi is object-blocked if and only if it is requesting a lock on a resource σ and a conflicting lock on σ is held by another transaction or retained by a transaction τj that is not one of τi ’s ancestors. In this case, we say τj object-blocks τi . A transaction τi is ceiling-blocked if and only if it is requesting a lock on some resource and p∗ (τi ), the active priority of τi , is not higher than φ∗ , the system ceiling at the instant of lock request. In this case, we say τj ceiling-blocks τi . A transaction τi is resource-blocked if and only if it is object-blocked or ceiling blocked. A transaction τi is inheritance-blocked if and only if there is another transaction τj such that p(τi ) > p(τj ) and p∗ (τi ) < p∗ (τj ), i.e., if τj has a
132
Seung-Jin Moon and Sanghoon Lee
Fig. 1. Example of Locking Zones
lower base priority than τi but is currently inheriting a higher active priority from some other transaction. In this case, we say τj inheritance-blocks τi 4.4 Protocol In this section, we formally describe the Real-Time Uniprocessor Nested Priority Ceiling Protocol (RTU-NPCP). The protocol is described in a general form, that applies not only to exclusive locks, but also to read/write locks. The protocol can be used for even more general types of locks with an appropropriate a definition of the conflict relationship between lock requests and outstanding locks. • Lock/Unlock operation rules - A transaction τi is permitted to acquire a lock on a resource σi only if the
A Reliable NT Model with Extension of Real Time Characteristics
133
lock request is neither object-blocked nor ceiling-blocked. - A transaction τi releases all its locks to its parent (or to the environment, if it is a root transaction) when it commits or is aborted. The parent then retains locks returned from committed or aborted subtransactions. In the case of abort, a substitute transaction τi is initiated in order to recover from the abort. Note that a parent transaction does not release any locks until all of its children have released all of their locks. • Priority propagation rules - When τi is object-blocked by τj its active priority p∗ (τi ) is inherited by the entire transaction tree to which τj belongs. - When τi is ceiling-blocked, its active priority p∗ (τi ) is inherited by all the transaction trees with the system ceiling, φ∗ ≥ p∗ (τi ). We illustrate the RTU-NPCP in the following example. For the example, the possibility of transaction aborts is ignored. Example: A transaction hierarchy and resource requirements are shown in Figure 2. Each of three root transactions τl , τm and τh in ascending order of priorities is composed of two subtransactions. Each subtransactions accesses three resources, σ0 , σ1 , and σ2 with read/write lock modes as described in the resource access pattern. First, we determine statically the two priority ceilings of each resources as Table 1. Table 1. Priority Ceiling Resources
σ0 σ1 σ2
read-priority ceiling write-priority ceiling p(τm ) p(τh ) p(τh ) p(τh ) p(τm ) p(τh )
Now, consider the following sequence of events, which are shown in Figure 2. • At time = 0, τl arrives and creates a subtransaction τl1 which starts executing non-database operations. • At time = 1, τl1 read-locks an unlocked resources σ0 and enter its locking zone. The current priority ceiling φ(σ0 ) becomes p(τm ). • At time = 2, τl1 write-locks σ2 . The current priority ceiling φ(σ2 ) becomes p(τh ). Therefore, the system ceiling φ∗ at time = 2 becomes p(τh ), which is the highest current priority ceiling. • At time = 3, the highest priority transaction τh arrives and creates τh1 which preempts τl1 , then executes its non-database operations. • At time = 4, τh1 Attempts to write-lock σ1 . τh1 is ceiling-blocked since the active priority of τh1 is not strictly higher than the system ceiling which is p(τh ). The active priority of τh1 , p(τh ) is, inherited by τl , τl1 , and τl2 . At the same moment, τm is initiated and ready to execute. However, the subtransaction τm1 is inheritance-blocked by τl1 since the active priority of τl1 is now
134
Seung-Jin Moon and Sanghoon Lee
Fig. 2. Example of Read/Write Lock Mode
temporarily raised to p(τh ). τl1 resumes its execution. • At time = 5, τl1 commits and τl2 is initiated and executes. • At time = 7, τl2 commits, thus, τl exits its locking zone. The priorities of τl , τl1 , and τl2 return to their original base priorities, p(τl ). Immediately, τh1 preempts τl and acquires the read-lock on σ1 . • At time = 12, τh completes. τm1 resumes and executes. • At time = 17, τm2 commits, then exits its locking zone. • At time = 18, τm completes. τl2 resumes its execution. • At time = 19, τl competes its execution.
A Reliable NT Model with Extension of Real Time Characteristics
135
4.5 Properties of RTU-NPCP In this section, we prove the properties of RTU-NPCP. For these proofs, we assume that a transaction instance is never aborted and never voluntarily suspends its execution. We prove that: (1) there is no possibility of deadlock; (2) the duration of the priority inversion encountered by each root transaction instance τi is at most the duration of the locking zone of one root lower-basepriority transaction; (3) serializability is maintained. The proofs of (1) and (2) are refinements of the original proofs of the PCP in [SRSC91], and the proof of (3) is similar to a proof which is presented in [Pap79]. Our main new contribution is the introduction of the concept of ”locking zone”, a generalization of the concept of ”critical section” that captures the range over which locks need to be retained in a nested transaction. We believe we have also improved the proofs by making more explicit distinctions in places where the original PCP publications use the words ”blocking”and ”priority” with ambiguous or different meanings. No Deadlock Lemma 1 Once a transaction τh enters its locking zone it cannot be blocked. Proof. Suppose τh enters its locking zone at time th . It follows that p(τh ) > φ∗ , where p(τh ) is the base priority of τh and φ∗ is the system ceiling at time th . Let tc be the first instant within τh ’s locking zone where τh is blocked. It must be blocked in (at least) one of three ways: Inheritance-blocked. There must be some other transaction τl with lower base priority, that has higher active priority than τh at time tc . Transaction τl must inherit priority from some transaction τx with higher active priority than τh . According to RTU-NPCP, this is only possible when τx is object-blocked or ceiling-blocked on a resource σl which is locked by τl at some time tl < tc . By the definition of priority ceiling, it follows that φtl (σl ) ≥ p∗ (τx ) ≥ p(τh ) > p(τl ). Object-blocked. Transaction τh must request a lock on some resource σl at time tc and there must be some other transaction τl that is already holding or retaining a conflicting lock on σl obtained by τl at some time tl < tc . Since we are assuming a transaction cannot suspend inside its locking zone, τh must have preempted τl , and so τl must have lower base priority than τh . By definition of priority ceiling, φtl (σl ) ≥ p(τh ) > p(τl ). Ceiling-blocked. Transaction τh must request a lock on some resource σh and there must be some other transaction τl that hold or retains a lock on some resource σl with ceiling φtl (σl ) = φ∗ ≥ p(τh ), obtained at some time tl < tc . Since we are assuming a transaction cannot suspend inside its locking zone, τh must have preempted τl , and so we know τl has lower base priority than τh . It follows that φtl (σl ) ≥ p(τh ) > p(τl ). In every case, there is a transaction τl with lower base priority that is holding a lock on a resource σl such that
136
Seung-Jin Moon and Sanghoon Lee
φtl (σl ) ≥ p(τh ) > p(τl ). Since τh cannot suspend inside its locking zone, and τl must execute to obtain the lock on σl , τl must inheritance-block τh at time tl . Therefore, by choice of tc , we cannot have th < tl < tc . It follows that tl < th < tc . In this case, φ∗th ≥ φtl (σl ) ≥ p(τx ) – a contradiction of the assumption that τh was able to enter its locking zone at time th . The lemma follows. Corollary 2 Whenever τl is blocked it is blocked by a transaction with lower base priority. Proof. The corollary follows from the case analysis in the proof of the lemma above. Lemma 3 A transaction τl can block another transaction only when τl is in its locking zone. Proof. This follows directly from the definitions of the three kinds of blocking. In each case, τl must be holding a lock on some resource For object blocking, the lock held by τl directly conflicts with the requested lock. For ceiling blocking, the lock held by τl determines the system ceiling. For inheritance blocking, the lock held by τl is necessary for τl ’s active priority to be higher than its base priority. The lemma follows. Suppose τ3 blocks τ2 , and τ2 blocks τ1 , at some instant in time. Then, τ1 is said to be transitively blocked by τ3 . Lemma 4 The RTU-NPCP prevents transitive blocking. Proof. Suppose τ3 blocks τ2 and τ2 blocks τ1 . By Lemma 3, in order to block τ3 , τ2 must be in its locking zone. However, by Lemma 1, τ2 cannot be blocked by τ3 while it is in its locking zone. This is a contradiction. The lemma follows. ww A transaction τi is said to wait-for τj if τi is resource-blocked by τj . A cycle in the wait-for relation for a set of n transactions is said to exist if for every j such that i ≤ j ≤ i + n − 1, τj waits-for τj+1 and τi = τi+1 . Theorem 5 The RTU-NPCP prevents deadlocks. Proof. Suppose there is a deadlock. Then, as proved in [Hol72], there must exist a cycle in the wait-for relation. Suppose the n root transactions involved in such a cycle are τ1 , τ2 , ..., τn . By Lemma 4, the number of transactions in the cycle can only be two, i.e., τ1 waits-for τ2 and vice versa. By Lemma 3, both transactions must be in their locking zones. Without loss of generality, suppose τ1 entered its locking zone first. From Lemma 1, τ1 will never be blocked while it is in its locking zone. This is a contradiction. The theorem follows.
A Reliable NT Model with Extension of Real Time Characteristics
137
No Multiple Priority Inversions Multiple priority inversion is a situation where a root transaction is subject to blocking for more than the duration of one locking zone of a lower-basepriority root transaction. Theorem 6 RTU-NPCP prevents multiple blocking. Proof. Suppose τh suffers multiple blocking. From Corollary 2, we know that a transaction can be blocked only when there is a lower-base-priority transaction blocking it, and by Lemma 3, the lower-base-priority transaction must be in its locking zone. Since we are assuming τh is blocked for longer than the duration of the locking zone of any single lower-base-priority transaction, there must be two or more lower-base-priority transactions, τl1 and τl2 , that are in their locking zones and block τh . Since we are assuming transactions do not suspend within their locking zones, one of τl1 and τl2 must preempt the other while it is in its locking zone. Without loss of generality, assume τl2 enters its locking zone first, and then τl1 preempts it. If τh is blocked by τl2 it must be resourceblocked or inheritance-blocked, and so we have two cases: resource-blocked. Let σ2 be a resource locked by τl2 that blocks τh at this at this time. Then, p(τh ) ≤ φ(σ2 ). Suppose τl1 enters its locking zone at time t1 , having preempted τl2 . Since there is no suspension while holding locks, τl1 has no inherited priority. In order for τl1 to successfully enter its locking zone, p(τh ) ≤ φ(σ2 ) ≤ φ∗t1 < p(τl1 ), where φ∗t1 is the system ceiling at time t1 . This contradicts the assumption that p(τl1 ) < p(τh ). inheritance-blocked. By the definition of inheritance-blocking, p(τh ) ≤ p∗ (τl2 ) at some time during the locking zone of τl2 . This can only happen if τl2 is inheriting priority, which can only happen if it is resource-blocking some higher-priority task τx , but this amounts to a case of transitive blocking a contradiction of Lemma 4. In both cases, τl1 cannot enter its locking zone while τl2 is in its locking zone. The lemma follows. Serializability In this section, we prove the RTU-NPCP maintains serializability. This is a key property of our nested PCP, that does not hold for the original (flat) PCP. For nested transaction protocols, serializability must be preserved upwards under composition of transactions. To see the difference, consider the transactions shown in Figure 3. Transactions τl1 , τl2 , τh1 , and τh2 , are leaf transactions, that access resources σ1 and σ2 . Transaction τl is the parallel composition of τl1 and τl2 , and τh is the parallel composition of τl , and τh1 . It is not enough that the leaf transactions be serializable; the non-leaf transactions τl and τh must also be serializable. For example, Figure 3 shows two schedules; both are serializable at the leaf level, but only Schedule 1 is serializable at the root level. A schedule for a set of transaction instances is an order
138
Seung-Jin Moon and Sanghoon Lee
in which the elementary database operations of the leaf transaction instances (lock, unlock, read, write, etc.) are done. A schedule is serial if all the elementary database operations of each transaction instance occur consecutively. A schedule is serializable if its effect is equivalent to that of some serial schedule. We prove that the schedule produced by the RTU-NPCP is serializable, using the serialization graph test, which is commonly used to prove serializability for the traditional flat transaction model [BHG87]. The serialization graph for a given execution schedule is a directed graph whose nodes are transaction instances. An edge τi → τj indicates there exists a resource σk such that τi conflict-accesses σk before τj in the schedule. Therefore, an interleaved execution of transaction instances is serializable if and only if the serialization graph of the execution schedule doesnt contain a cycle [EGLT76, Pap79]. See Figure 3 for examples of serialization for two different schedules for the same pair of nested transactions.Schedule 1 has no cycle, and is therefore serializable. Schedule 2 has a cycle, and this is therefore not serializable.
Fig. 3. Serializable and non-serializable schedules
A Reliable NT Model with Extension of Real Time Characteristics
139
Note that, since our nested transaction model allows hierarchical compositions of transactions, the nodes of the serialization graph include the transactions at all levels of the hierarchy. When there is an edge from a transaction τi to a transaction τj in the serialization graph, the locking zone of τi ensures that this is same as if there is an edge from every ancestor of τi ’s to every ancestor of τj ; in particular, there is an edge from τi ’s root transaction to τj ’s root transaction. For serializability, the principal nodes of interest are the root-level transactions, since if they are serializable then the transactions at the other levels are serializable also. Lemma 7 When there is an edge from a transaction τi to a transaction τj in the serialization graph, RTU-NPCP guarantees that τi finishes executing its locking zone before τj finishes its locking zone. Proof. Suppose σ1 is the first-requested resource among possibly several resources contributing an edge τi → τj to the serialization graph. According to RTU-NPCP, the system ceiling φ∗ from the instant when τi (or one of its subtransactions) accesses σ1 in mode m to point that τi no longer retains the lock must be at least as high as φ(σ1 , m) . There are two cases: Case 1. If τi (including its subtransactions) is never preempted by any higher active priority transactions, then the lemma follows. Case 2. If τi is preempted by a higher active priority transaction (possibly by τj ), and then later τj executes while τi is still being preempted, τj ’s lock request for σ1 will be denied until τi exits its locking zone (and releases all retained locks) because p(τj ) ≤ φ(σ1 ) ≤ φ∗ at the time of τj ’s request. The lemma follows. Theorem 8 Any schedule produced by RTU-NPCP is serializable. Proof. Suppose the serialization graph of a schedule produced by RTU-NPCP contains a cycle τn → τ1 → τ2 → τi . . . τn−1 → τn , where each τi is a root transaction instance and n > 1. This means there must exist an incoming edge to τn and an outgoing edge from τn . By Lemma 7, τn−1 must exit its locking zone before τn does, τn−2 must exit its locking zone before τn−1 does. Therefore, transitively, τn−2 must exit its locking zone before τn does. Following the chain transitively, we see that τ1 must exit its locking zone before τn does, and to complete the cycle, τn must exit its locking zone before τ1 does i.e. τn → τ1 → τn . However, once τn exits its locking zone, it is impossible to form such an edge as τ1 → τn , since τn no longer accesses any resources, contradicting the assumption. The theorem follows.
5 CONCLUSIONS AND FUTURE WORK In this paper, we have suggested a reliable real-time transaction model which combines timing constraints with nested transactions. We believe it is desirable to extend the study of real-time transactions to include the nested
140
Seung-Jin Moon and Sanghoon Lee
transaction semantics, because it subsumes the flat transaction model and in addition has several potential advantages, which we have described. As a first step, we have investigated the problem of scheduling periodic processes with nested transactions, for a uniprocessor. We adapted the uniprocessor Priority Ceiling Protocol to this model, yielding an integrated lock-based concurrency control and priority-driven scheduling algorithm, which not only guarantees timing contraints of a set of hard real-time transactions but also maintains consistency of the database. Thus, rate-monotonic schedulability analysis can be performed for systems of root transactions, just as if they had no subtransaction. In future work, we plan to conduct the schedulability analysis based on rate-monotonic analysis. Furthurmore we will attempt to investigate protocols for implementing nested transactions in multiprocessor and distributed environments. Toward this end, we are currently looking at nested versions of the multiprocessor and distributed PCP [Raj90] with considering the needs of multiprocessor- based real-time database systems [KJH02]. We plan to apply the multiprocessor schedulability analysis described in [OB98], which provides an efficient on-line and off-line schedulability test for real-time transactions. We expect the preliminary results of these studies to be available in the near future.
Acknowledgement This work was supported by the GRRC program of Gyeonggi province.[GRRC SUWON2010-B6, Center for u-City Security and Serveillance Technology].
References [AG92] Abbott, R. and Garcia-Molina, H.: Scheduling Real–Time Transactions: A Performance Evaluation. ACM Transactions on Database Systems., 17(3), 513–560 (1992) [ASA05] Abdouli, M.; Sadeg, B.; Amanton, L.: Scheduling distributed real-time nested transactions.Object-Oriented Real-Time Distributed Computing, 2005. ISORC 2005. Eighth IEEE International Symposium on, 208–215 (2005) [Bak91] Baker, T.P.: Stack-Based Scheduling of Real-Time Processes, The RealTime Systems Journal, 3(1), 67–100 (1991) [BHG87] Bernstein, P.A., Hadzilacos, V., and Goodman, N.: Concurrency Control and Recovery in Database Systems. Addison-Wesley Publishing Company (1987) [CG94] Chen, Y.W., Gruenwald, L.: Research issues for a real-time nested transaction model. Real-Time Applications. Proceedings of the IEEE Workshop on(Washington, DC , USA), 130–135 (1994) [CLL90] Chung, J-Y., Liu, W.S., and Lin, K.J.: Scheduling Periodic Jobs that Allow Imprecise Results. IEEE Transactions on Computers(September 1990), 1156–1174 (1990)
A Reliable NT Model with Extension of Real Time Characteristics
141
[EBE01] Elisa Bertino, Barbara Catania, Elena Ferrari.: A nested transaction model for multilevel secure database. Management systems. ACM Transactions on Information and System Security (TISSEC) archive., 4(4) (New York, NY, USA November 2001), 321–370 (2001) [EGLT76] Eswaran, K.P., Gray, J.N., Lorie, R.A., Traiger, I.L.: The Notion of Consistency and Predicate Locks in an Database System. Communication of the ACM, 19(11), 624–633 (1976) [HC02] Hong-Ren Chen, Chin, Y.H.: An efficient real–time scheduler for nested transaction models. Parallel and Distributed Systems, 2002. Proceedings. Ninth International Conference on, 335–340 (2002) [Hol72] Holt, R.C.: Some Deadlock Properties of Computer Systems. ACM Computer Systems, 4(3), 179–196 (1972) [HR83] Harder, T, Reuter, A.: Principles of Transaction-Oriented Database Recovery. ACM Comput. Surv., 15(4), 287–317 (1983) [HR93] Harder, T. and Rothermel, K.: Concurrency Control Issues in Nested Transactions. VLDB Journal., 2(1), 39–74 (1993) [KJH02] Tei-Wei Kuo, Jun Wu, Hsin-Chia Hsih.: Real-time concurrency control in a multiprocessor environment. Parallel and Distributed Systems, IEEE Transactions on., 13(6), 659–671 (2002) [LC86] Liestman, A.L., Campbell, R.H.: A Fault–Tolerant Scheduling Problem. IEEE Transactions on Software Engineering(November 1986), 12(11), 1089– 1095 (1986) [LNL87] Lin, K.J., Natarajan, S, and Liu, W.S.: Imprecise Results: Utilizing Partial Computations in Real-time Systems. Proceedings of the 8th Real–Time Systems Symposium(San Jose, CA, December 1987), 210–217 (1987) [Lin89] Lin, K.J.: Consistency Issues in Real–time Database Systems. Proceeding of the 22nd Hawaii International Conference on System Sciences, 654–661 (1989) [LL73] Liu, C.L., and Layland, J.W.: Scheduling Algorithmms for Multiprogramming in a Hard-Real-Time Environment. Journal of the Association for Computing Machinery., 20(1), 46–61 (1973) [Mos81] Moss, J.E.B.: Nested Transactions: An Approach to Reliable Distributed Computing. Technical Report MIT/LCS/TR–260, MIT Laboratory for Computer Science (1981) [NL93] Nakazato, H., Lin, K–J.: Concurrency Control Algorithm for Real-Time Tasks with Read/Write Operations. Proceedings of 5th EuroMicro (1993) [OB98] Oh, D. and Baker, T.P.: Utilization Bounds for N-Processor Rate Monotone Scheduling with Static Processor Assignment. Real Time J., 15(1), 183–193 (1998) [Pap79] Papadimitriou, C.H.: The Serizlizability of Concurrent Database Updates. Journal of the ACM(October 1979), 631–653 (1979) [Raj90] Rajkumar, R.: Real-time Synchronization Protocols for Shared Memory Multiprocessors. Proceedings of the Intl Conf. on distributed Computing Systems, 116–123 (1990) [SRL90] Sha, L., Rajkumar, R., and Lehoczky, J.P.: Priority Inheritance Protocols: An Approach to Real-Time Synchronization. IEEE Transaction on Computers, 39(9), 1175–1185 (1990) [SRSC91] Sha, L., Rajkumar, R., Son, S.H., and Chang, C.H.: A Real–Time Locking Protocol. IEEE Transaction on Computer., 40(7), 793–800 (1991)
142
Seung-Jin Moon and Sanghoon Lee
[STDW96] Squadrito, M, Thuraisingham, B., DiPippo, L.C. and Wolfe, V.F.: Towards Priority Ceilings in Object-Based Semantic Real-Time Concurrency Control. First International Workshop on Real–Time Databases: Issue and Applications (1996) [UB92] Ulusoy, O., and Belford, G.G. Real–time Lock Based Concurrency Control in a Distributed Databse System. Proceedings of the 12th Intl Conf. Distributed Computing Systems, 136–143 (1992) [XWX08] Xiangdong Lei; Wuke Li; Xiaoli Yuan.: Scheduling Real–Time Nested Transactions in Mobile Broadcast Environments. Young Computer Scientists, 2008. ICYCS 2008. The 9th International Conference for, 1053–1058 (2008)
Part II
Network Computing & Security
PDF: A Novel Probability-based Data Forwarding Scheme in Lossy Wireless Sensor Networks Dang Tu Nguyen1 , Wook Choi2 , and Hyunseung Choo1 1
2
School of Information and Communication Engineering, Sungkyunkwan University, S. Korea {dangtu,choo}@skku.edu Department of Computer Science and Engineering, Hankuk University of Foreign Studies, S. Korea
[email protected]
Summary. To increase the end-to-end packet delivery ratio in lossy wireless sensor networks, existing routing protocols often use the data forwarding schemes based on a hop-by-hop ACK-based retransmission mechanism. However, these schemes may waste a considerable amount of energy for data transmissions, especially when the link quality is low for ACK transmissions. This paper proposes a novel probabilitybased data forwarding (PDF) scheme to minimize the energy consumption for unnecessary data retransmissions. In PDF, a retransmission threshold is set in each sensor depending on the probability of sending out a data packet successfully, thus becoming probability-based. The threshold is a number of data retransmissions sufficient for a data packet to arrive successfully at a next hop. The sender node stops sending a data packet after the threshold even if it does not receive an ACK message. Mathematical analysis and simulation results demonstrate that the proposed PDF scheme can save much energy and significantly increases the energy efficiency compared to the pure-ACK-based scheme when both schemes use the two well-known data forwarding metrics, P RR × Distance and NADV, in the network layer by up to 140.50% and 57.55%, respectively.
Keywords: Energy-savings; Reliable transmission; Geographic routing; Wireless sensor networks.
1 Introduction Wireless sensor networks (WSN) are composed of a large number of sensor nodes and in general, they are deployed in inaccessible and hostile environments, e.g., dense jungles, battlefields, and inside phenomenon [1–3]. Sensor nodes in such networks operate under stringently-constrained resources including low-power energy, the replenishment of which may not often be S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 8, © Springer Basel AG 2011
146
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
feasible. This characteristic and other factors such as multi-path routing, stochastic interference, data diffusion and scattering make the wireless link between sensor nodes irregular and unreliable [10–12]. Therefore, the design of communication stacks should take into account such realistic radio link layer characteristics. In order to cope with the wireless link unreliability in the network layer, several efforts have been made to define metrics that characterize the energy efficiency of communications [7,8,18,20]. Communications over the unreliable links could be optimized based on those metrics. Moreover, the most common mechanism to increase the packet delivery ratio used in the previous works is to retransmit data packets using the acknowledgment (ACK) message [7,8,18, 20]. Because of the unreliable nature of wireless links, there may be situations that the data packets actually arrive at a next hop, but the ACK messages fail to arrive at the sender node. In the pure-ACK based retransmission scheme [14, 15], a node sends a data packet to a next hop and waits for an ACK message. If the next hop receives the data packet, it responds with an ACK message to the sender node. After a certain timeout duration, if the sender node does not receive the ACK message, it retransmits the same data packet. This leads to unnecessary data retransmissions, thus eventually wasting a considerable amount of energy. In this paper, we propose a novel probability-based data forwarding (PDF) scheme to minimize the unnecessary energy consumption. The retransmission mechanism of PDF is similar to that of the pure ACK. In PDF, however, after a number of data retransmissions, which is sufficient for the data packet to arrive successfully at a next hop, the sender node stops sending the data packet even if it does not receive an ACK message. The key contributions of our work are twofold: • •
Helping sensor nodes conserve a large amount of energy that is otherwise used for unnecessary data transmissions. Considerably increasing the energy efficiency of the network.
The remainder of this paper is organized as follows. In Section 2, we discuss related works. Section 2.1 presents assumptions, notation, and system models while Section 3.3 describes the proposed PDF scheme. Section 5 provides the performance evaluation results. Finally, we conclude the paper in Section 5.
2 Related Work Research on radio properties indicates that wireless links between low power sensor devices are extremely unreliable [10–12]. In particular, the authors in [10] showed that there is a large transitional region in wireless link quality that is characterized by significant levels of unreliability and asymmetry, significantly impacting the performance of higher-layer protocols. They provide a comprehensive analysis of the major causes of unreliability and asymmetry.
Probability-based Data Forwarding
147
Specifically, they derive expressions for the distribution, expectation, and variance of the packet reception rate as a function of distance, as well as for the location and extent of the transitional region. These expressions incorporate important environmental and radio parameters such as the path loss exponent and shadowing variance of the channel, and the modulation, encoding, and hardware variance of the radios. To cope with such wireless link unreliability, many schemes have been proposed in the link layer, network layer, transport layer, and so on. In this paper, we focus on the protocols in the network layer and link layer. 2.1 Protocols in The Network Layer Based on a recently developed link loss model, Zamalloa et al. studied the performance of a wide array of forwarding strategies, via analysis, extensive simulations and a set of experiments on motes [7]. They found that the product of the packet reception rate and the distance improvement towards destination (P RR × Distance) is a highly suitable metric for geographic forwarding in realistic environments. In [8], the authors introduced the concept of expected transmission count metric (ETX) that finds high-throughput paths on multi-hop wireless networks. ETX minimizes the expected total number of packet transmissions (including retransmissions) required to successfully deliver a packet to the ultimate destination. The ETX metric incorporates the effects of link loss ratios, asymmetry in the loss ratios between the two directions of each link, and interference among the successive links of a path. In contrast, the minimum hop-count metric chooses arbitrarily among the different paths of the same minimum length, regardless of the often large differences in throughput among those paths, and ignoring the possibility that a longer path might offer higher throughput. Lee et al. proposed a new link metric called normalized advance (NADV) for geographic routing in multi-hop wireless networks [18]. NADV selects neighbors with the optimal trade-off between proximity and link cost. Coupled with the local next hop decision in geographic routing, NADV enables an adaptive and efficient cost-aware routing strategy. Depending on the objective or message priority, applications can use the NADV framework to minimize various types of link cost. In [20], D. T. Nguyen et al. proposed a novel multi-ACK-based data forwarding scheme to minimize the energy consumption for unnecessary data retransmissions of the single ACK-based retransmission mechanism. The next hop forwarder selection significantly affects the energy efficiency of communications. Hence, they also developed a new next hop forwarder selection metric, called effective energy consumption (EEC), which makes their proposed data forwarding scheme suitable for geographic routing protocols. Mathematical analysis and simulation results demonstrated that the multi-ACK-based data
148
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
forwarding scheme can save much energy, reduce the total amount of traffic load, and significantly increase the energy efficiency of the network. 2.2 Protocols in The Link Layer In [21], the authors presented a survey on reliable communication protocols for WSNs. They showed that retransmission-based loss recovery is an active and efficient way to overcome the problem of unreliable links. This mechanism can be implemented at the link layer by using hop-by-hop loss recovery. In this method, a pair of neighboring sender and receiver is responsible for loss detection, and in turn enables quick and energy-efficient retransmission within one hop. The hop-by-hop loss detection can be further categorized into receiver-based or sender-based according to the place where packet loss is detected. In the sender-based loss detection, the sender detects packet loss either timer-based or by overhearing. In the timer-based detection, a sender starts a timer each time it transmits a packet. If it does not receive any acknowledgment from the targeted receiver before the timer expires, it infers the packet lost. Taking the advantage of the broadcast nature of wireless channel, the sender can listen to the targeted receiver to see if the packet, which it sent to the receiver previously, has been forwarded, and detect packet loss in a passive and indirect way. In the receiver-based loss detection, a receiver infers packet loss when it observes out-of-sequence packet arrivals. There are three ways to notify the sender: ACK (Acknowledgement), NACK (Negative ACK), and IACK (Implicit ACK). Both ACK and NACK rely on special control messages, while Implicit ACK (IACK) [22] just piggybacks ACK information in the header of data packets. In IACK [22], if a packet is overheard being forwarded again, it implies that the packet has been successfully received and acknowledged simultaneously. The IACK avoids control message overhead and could be more energy-efficient. However, the application of IACK depends on if sensor nodes have the capability to correctly overhear the physical channel. In case that the transmission is corrupted before overhearing or the channel is not bidirectional or sensor nodes access the physical channel using TDMA-based (Time Division Multiple Access) protocols, IACK could be unreliable or impossible. Previous works frequently used an ACK-based retransmission mechanism to increase the packet delivery ratio [7,8,18,20]. In the retransmission mechanism [14, 15], a node sends a data packet to a next hop and waits for an ACK message. If the next hop receives the data packet, it responds with an ACK message to the sender node. After a certain timeout duration, if the sender node does not receive the ACK message, it retransmits the same data packet. These steps are repeated until the sender node receives an ACK message. Because of the unreliable nature of wireless links, there may be situations that the data packets actually arrive at the next hop, but the ACK messages fail to arrive at the sender node. This leads to unnecessary data retransmissions, thus wasting energy. This motivates our work.
Probability-based Data Forwarding
149
3 Preliminaries 3.1 Assumptions and Notation In this paper, mathematical analysis and simulations are done based on the following assumptions: •
Wireless links between nodes are bidirectional and the link qualities of both directions may not be equal [8, 10]. • Nodes know their location, one-hop neighbor location, and the position of the final destination and also they know the link qualities to their neighbors, which are decided by the packet reception rate (PRR) [7, 8, 18]. Similar to the work in [8], the values of P RRin and P RRout can be measured using dedicated link probe packets. Each node broadcasts link probes of a fixed size, at an average period τ . To avoid accidental synchronization, τ is jittered by up to ±0.1τ per probe. Because the probes are broadcasted, nodes do not acknowledge or retransmit them. Every node remembers the probes it receives during the last ω seconds, allowing it to calculate the P RR from the sender at any time t as: P RR(t) =
Count(t − ω, t) ω/τ
Count(t − ω, t) is the number of probes received during the window ω, and ω/τ is the number of probes that should have been received. In the case of the link X → Y , this technique allows X to measure P RRin , and Y to measure P RRout . Because Y knows it should receive a probe from X every t seconds, Y can correctly calculate the current loss ratio even if no probes arrive from X. Each probe sent by a node X contains the number of probe packets received by X from each of its neighbors during the last ω seconds. This allows each neighbor to calculate the P RRout to X whenever it receives a probe from X. Let us summarize the notation used in this paper in Table 1. 3.2 Probabilistic Model for Energy Consumption Analysis We assume the value of Kout as a random variable which follows Geometric random distribution [19], i.e., depending on the link quality between two sensor nodes, Kout varies. Therefore, given a P RRout , the probability that Kout equals k is measured by: P r[Kout = k] = (1 − P RRout )k−1 P RRout Since we consider a maximum number of RT retransmissions, Kout can range from 1 to RT. So, the probability P rRT is derived as follows:
150
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo Table 1. Descriptions of notation.
Notation Description P RR Packet reception rate P RRout PRR of outgoing link for sending out a packet P RRin PRR of incoming link for receiving an ACK message Kout Number of packet retransmissions up to the first success Kin Number of ACK message retransmissions up to the first success E[Kout ] Expected number of packet retransmissions up to the first success E[Kin ] Expected number of ACK message retransmissions up to the first success RT Data retransmission threshold which is given by a number of transmissions P rRT Probability for successfully sending a data packet after RT edata Amount of energy consumed for transmitting a data packet eACK Amount of energy consumed for transmitting an ACK message Pt Output power Pr Received power η Path loss exponent d0 Reference distance P L(d0 ) Power decay for the reference distance I Current consumption V Supply voltage Tbyte The amount of time to transmit a byte
P rRT = P [Kout ≤ RT ] =
RT
P r[Kout = k]
k=1
=
RT
(1 − P RRout )k−1 P RRout
k=1
= 1 − (1 − P RRout )RT
(1)
For the random variable Kout , we use the expected value of Kout , denoted by E[Kout ], which is given by: E[Kout ] = =
∞ k=0 ∞
kP r[Kout = k] k(1 − P RRout )k−1 P RRout
k=0
=
1 P RRout
Probability-based Data Forwarding
151
Similarly, the expected value of Kin , denoted by E[Kin ], is given by: E[Kin ] =
1 P RRin
3.3 Link Layer Model In the simulation of our work, we use a realistic link layer model introduced in [10], which is based on the log normal path loss model [13]. According to the log normal path loss model the received power (Pr ) at a distance d is a random variable in dB given by: d + N (0, σ) (2) Pr (d) = Pt − P L(d0 ) − 10ηlog10 d0 where Pt is the output power, η is the path loss exponent (rate at which signal decays with respect to distance), N (0, σ) is a Gaussian random variable with mean 0 and variance σ 2 , and P L(d0 ) is the power decay for the reference distance d0 . For a transmitter-receiver distance d, the signal-to-noise ratio (Υd ) at the receiver is also a random variable in dB, and it can be derived from Eq. 2: Υd = Pr (d) − Pn = Pt − P L(d0 ) − 10ηlog10
d d0
+ N (0, σ) − Pn
(3)
= N (μ(d), σ) where μ(d) is given by: μ(d) = Pt − P L(d0 ) − 10ηlog10
d d0
− Pn
The values of the signal-to-noise ratio from Eq. 3 can be inserted on any of the available bit-error-rate expressions available in the communication literature. When Manchester encoding and NCFSK modulation schemes are used, the PRR for a distance d between a transmitter and a receiver becomes a random variable that is given by: γd 1 P RRd = (1 − exp−10 10 2
1 1.28
)ρ×8f
where γ is the signal to noise ratio in dB; ρ is the encoding ratio (ρ = 2 for Manchester encoding); f is the frame length in bytes.
152
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
3.4 Energy Consumption Model We consider only the energy consumption for packet transmissions. More specifically, we do not consider other kinds of energy consumption, e.g., energy spent in state (active/idle/sleep) transitions. For a node in the transmitting/receiving state, the power consumption, P, can be obtained by: P =I ×V where I denotes the current consumption; V is the supply voltage. Given P , the energy consumption, e, in one state can be obtained by: e=P ×T where T is the time duration spent on that state. Simulations in this study use the power model used in the Mica2 hardware platform to measure the energy consumption. Table 2 shows the Mica2 power model [16]. Table 2. Power model for the Mica2. The mote was measured with the micasb sensor board and a 3V power supply.
Mode Current Mode Rx 7.0 mA Tx (-5 dBm) Tx (-20 dBm) 3.7 mA Tx (0 dBm) Tx (-19 dBm) 5.2 mA Tx (+4 dBm) Tx (-15 dBm) 5.4 mA Tx (+8 dBm) Tx (-8 dBm) 6.5 mA Tx (+10 dBm)
Current 7.1 mA 8.5 mA 11.6 mA 17.4 mA 21.5 mA
4 Probability-based Data Forwarding The goal of our proposed PDF scheme is to minimize the number of unnecessary data retransmissions and thus save energy. The retransmission mechanism of PDF is similar to that of the pure ACK [14, 15]. In PDF, however, after a number of data retransmissions, defined as retransmission threshold, which is sufficient for the data packet to arrive successfully at the next hop, the sender node stops sending the data packet even if it does not receive an ACK message. To achieve the goal, there is one problem to be solved – what are the suitable values for the retransmission threshold? In the following, we probabilistically analyze the packet retransmission mechanism to find the suitable values.
Probability-based Data Forwarding
153
4.1 Energy Consumption of Pure ACK Scheme Probabilistically, one packet arrives successfully at the next hop with E[Kout ] data transmission trials. For each of successfully-transmitted packets, the next hop responds with one ACK message. Eventually, E[Kout ] × E[Kin ] data packets and E[Kin ] ACK messages should be sent so that the sender node can receive one message successfully as shown in Fig. 3. Given this probabilistic behavior, the expected energy consumption is given by: epure−ACK = E[Kin ] × (E[Kout ] × edata + eACK )
(4)
E[ K out ] × E[ K in ] data transmissions
TX node
RX node E[ K in ] ACK transmissions
Fig. 1. Expected number of data transmissions and ACK transmissions in pure ACK.
4.2 Energy Consumption of PDF Scheme With E[Kout ] data transmissions, one packet arrives successfully at the next hop. Therefore, for some applications in which the energy consumption is more important than the reliability, the retransmission threshold can be set to be E[Kout ]. As shown in Fig. 4, the expected energy consumption of PDF, eP DF , can be measured as follows: eP DF = E[Kout ] × edata + eACK
(5)
E[ K out ] data transmissions
TX node
RX node 1 ACK transmission
Fig. 2. Expected number of data transmissions and ACK transmissions in PDF.
154
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
4.3 Energy Advantage of PDF Scheme From Eq. 2 and Eq. 3, the ratio of the expected energy consumption of PDF to that of pure ACK is given by: eP DF epure−ACK
E[Kout ] × edata + eACK E[Kin ] × (E[Kout ] × edata + eACK ) 1 = E[Kin ]
=
(6)
Since E[Kin ] ≥ 1, Eq. 5 is always less than or equal to 1. For example, if 1 ≈ 0.6. That is, PDF can P RRin = 0.6, E[Kin ] ≈ 1.667. Then, Eq. 5 is 1.667 reduce the energy consumption of pure ACK by 40% (i.e., 1−0.6 = 0.4). 1 Using the proposed PDF scheme, nodes can save a large amount of energy that is otherwise consumed for unnecessary data transmissions. However, on the downside, the packet delivery ratio of the PDF scheme is slightly smaller than that of pure ACK. That is because using PDF, a sender node stops sending a data packet after a suitable number of retransmissions even if it does not receive an ACK message, but using the pure ACK, a sender node retransmits the data packet until the data packet is successfully received by a next hop.
5 Performance Evaluation The work of PDF is motivated by the unnecessary data retransmissions due to the ACK failures of the pure-ACK based data forwarding scheme. Such failures happen more frequently when the link quality for ACK transmission is low. Thus, we use the one-hop data forwarding over links with varying quality to evaluate the performance of the PDF scheme and compare it with the pure ACK scheme. To have a better view on the performance of PDF, we use multi-hop data forwarding in networks having a realistic link layer as in [7, 10]. 5.1 Methodology We use a simulator built in Java and the same parameters as in [7, 14–16]. Table 3 summarizes those parameters. For Mica2 motes, the data rate in bits is 19.2kbps [7,10,17] and the energy consumption is calculated as follows. The amount of time to transmit one byte, Tbyte , is given by: Tbyte =
8×1 (s) 19200
Probability-based Data Forwarding
155
Table 3. Simulation parameters.
Parameters Physical Layer Medium Access Layer Modulation Encoding Pt V η σ d0 P L(d0 ) Radio Transmission Range Data Rate Data Packet Size ACK Message Size
Values IEEE 802.15.4 standard IEEE 802.15.4 standard NCFSK Manchester +4dBm 3V 4.7 4.6 1m -105dBm 30m 19.2kbps 100 bytes 11 bytes
In the reception state with the output power Pr , the current consumption, Ir , is a constant and so is the energy consumption, (er ), for one byte. This (er ) is given by: er = Pr × Tbyte = Ir × V × Tbyte 8 = 7 × 10−3 × 3 × = 8.75 × 10−6 (J) 19200 Given Ir = 7.0mA and V = 3V as shown in Table 2. The amount of energy consumed to transmit one byte, et , is given by: et = Pt × Tbyte = It × V × Tbyte 8 = 14.5 × 10−6 (J) = 11.6 × 10−3 × 3 × 19200 Therefore, the total energy consumed to transmit and receive one byte, ebyte , is calculated by: ebyte = er + et = (8.75 + 14.5) × 10−6 = 23.25 × 10−6 (J) In one-hop data forwarding, we compared the performance of PDF with that of pure ACK in two scenarios: • •
i) The value of P RRout is a random value between 0.01 and 1. The value of P RRin varies from 0.1 to 1 with 0.1 increment. ii) The value of P RRin is a random value between 0.01 and 1. The value of P RRout varies from 0.1 to 1 with 0.1 increment.
156
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
For each value of the P RRin and P RRout , 10000 data packets are sent and the average results are obtained. In data forwarding process, we use two metrics to select next hops – PRRxDistance and NADV. For each metric, we use the pure ACK scheme and the PDF scheme to forward data packets. In this simulation, nodes are deployed uniformly at random [7], and for each pair of the nodes, we use the same link model as in [7] and [10] to generate the one-hop packet reception rate. A node is considered as a real neighbor of another one if the link qualities of the both directions between them are equal to or greater than 0.01. We run 100 experiments in two different scenarios: i) varying densities in networks of 1000 nodes and ii) varying network sizes with a fixed density (6 real neighbors/range). A node is considered as a real neighbor of another node if the P RRs between these two nodes for both directions are greater than 0.01. In each simulation run, 100 source and destination pairs are randomly chosen to send one data packet and the results are computed as the average of the 10000 runs. Evaluation Metrics: We use the following three metrics to evaluate the performance of the schemes: • •
Energy consumption: Average amount of energy consumption to transmit data packets from source nodes to destination nodes. Energy efficiency: Number of bits successfully delivered to the destination node for each unit of energy spent by the network in communication events.
Fig. 3. Energy consumption of schemes with varying P RRin in one-hop data forwarding.
Probability-based Data Forwarding
•
157
Packet delivery ratio: Percentage of packets sent by the source node that reach the destination node.
5.2 Energy Consumption One-hop data forwarding Fig. 4 and 4 show that the energy consumption of the proposed scheme, PDF, is much smaller than that of the pure ACK, especially when P RRin and P RRout are low, since PDF can minimize the number of unnecessary data retransmissions.
Fig. 4. Energy consumption of schemes with varying P RRout in one-hop data forwarding.
Multi-hop data forwarding From Fig. 5, we can see that PDF reduces much energy consumption of PRRxDistance and NADV. The energy consumption of PDF PRRxDistance is very close to that of PDF NADV because both PRRxDistance and NADV use PDF data forwarding scheme and they both select reliable links to forward data packets. However, the energy consumption of pure-ACK NADV is much smaller than that of pure-ACK PRRxDistance since NADV considers the link qualities of two directions when selecting a next hop. For example, when the number of nodes is 600, the energy consumptions of pure-ACK PRRxDistance, PDF PRRxDistance, pure-ACK NADV, and PDF NADV are 88.9mJ,
158
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
32.5mJ, 51.1mJ, and 32.2mJ, respectively. That is, PDF reduces the energy ≈ 0.6344) consumption of pure-ACK PRRxDistance by 63.44%(i.e., 88.9−32.5 88.9 and pure-ACK NADV by 36.99%(i.e., 51.1−32.2 ≈ 0.3699). 51.1
Fig. 5. Energy consumption of schemes under various network sizes in multi-hop data forwarding.
As shown in Fig. 6, for the node densities from 1 to 6, when node density increases, the energy consumption increases proportionally, since the packet delivery ratio increases dramatically and thereby makes routing paths longer. But, for the node densities from 7 to 10, when node density increases, the energy consumption decreases, because the packet delivery ratio does not increase much and nodes can find neighbors with good quality links to forward data packets. 5.3 Energy Efficiency One-hop data forwarding Fig. 7 and 8 show the energy efficiency of PDF is much greater than that of pure ACK, especially when P RRin and P RRout are low, since PDF can save much energy for unnecessary data retransmissions. As shown in Fig. 8, when the link quality of P RRout increases from 0.9 to 1.0, the energy efficiency rockets up, because we use the ceiling function when calculating the values of 1 retransmission thresholds. For instance, 0.9 = 2 while 11 = 1.
Probability-based Data Forwarding
159
Fig. 6. Energy consumption of schemes under various node densities in multi-hop data forwarding.
Fig. 7. Energy efficiency of schemes with varying P RRin in one-hop data forwarding.
Multi-hop data forwarding From Fig. 9 and 10, we can see that PDF significantly improves the energy efficiencies of PRRxDistance and NADV. As shown in Fig. 10, for instance, when the node density is 5, the energy efficiencies of pure-ACK PRRxDis-
160
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
Fig. 8. Energy efficiency of schemes with varying P RRout in one-hop data forwarding.
Fig. 9. Energy efficiency of schemes under various network sizes in multi-hop data forwarding.
tance, PDF PRRxDistance, pure-ACK NADV, and PDF NADV are 3.844, 9.245, 5.830, and 9.185, respectively. That is, PDF improves the energy efficiency of pure-ACK PRRxDistance by 140.50%(i.e., 9.245−3.844 ≈ 1.4050) 3.844 ≈ 0.5755). and pure-ACK NADV by 57.55%(i.e., 9.185−5.830 5.830
Probability-based Data Forwarding
161
Fig. 10. Energy efficiency of schemes under various node densities in multi-hop data forwarding.
5.4 Packet Delivery Ratio One-hop data forwarding Fig. 11 shows the delivery ratio of the proposed PDF scheme is a bit lower than that of the pure ACK scheme. As shown in Fig. 12, when P RRout is around
Fig. 11. Packet delivery ratio of schemes with varying P RRin in one-hop data forwarding.
162
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
Fig. 12. Packet delivery ratio of schemes with varying P RRout in one-hop data forwarding.
0.8, the delivery ratio of PDF is very close to the value of pure ACK; when P RRout increases from 0.4 to 0.5, the delivery ratio of PDF decreases from 0.811 to 0.773, since we use the ceiling function when calculating the retrans-
Fig. 13. Packet delivery ratio of schemes under various network sizes in multi-hop data forwarding.
Probability-based Data Forwarding
163
Fig. 14. Packet delivery ratio of schemes under various node densities in multi-hop data forwarding. 1 mission thresholds. For example, when P RRout = 0.4, RTP DF = 0.4 = 3; then the successfully-data-transmitting probability of PDF is 1 − (1 − 0.4)3 = 1 = 2; then 0.784 (refer to Eq. 1); and when P RRout = 0.5, RTP DF = 0.5 the successfully-data-transmitting probability of PDF is 1 − (1 − 0.5)2 = 0.75 (refer to Eq. 1).
Multi-hop data forwarding It can be seen in Fig. 13 and 14 the delivery ratios of PRRxDistance and NADV using pure ACK are slightly higher than those using the proposed PDF scheme. As mentioned above, however, the proposed scheme significantly improve the energy efficiency of PRRxDistance and NADV.
6 Conclusion In this paper, we proposed a novel probability-based data forwarding (PDF) scheme with an ultimate goal of minimizing the unnecessary energy consumption while transmitting data over unreliable wireless links in wireless sensor networks. PDF sets a retransmission threshold depending on the probability of sending out a data packet successfully, thus becoming probability-based. Mathematical analysis and simulation results demonstrated that our proposed scheme significantly reduces the use of energy for data transmission and thus increases the energy efficiency.
164
Dang Tu Nguyen, Wook Choi, and Hyunseung Choo
Acknowledgement This research was supported in part by MKE and MEST, Korean government, under ITRC NIPA-2010-(C1090-1021-0008) and WCU NRF (No. R31-2008000-10062-0), respectively. Dr. Choo is the corresponding author.
References 1. I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci, “A survey on sensor networks,” IEEE Communications Magazine, vol. 40, pp. 102–114, 2002. 2. Chonggang Wanget et al., “A survey of transport protocols for wireless sensor networks,” IEEE Network Magazine, vol. 20, pp. 34–40, 2006. 3. D. Couto, D. Aguayo, D. Bicket J. and Morris R., “A high-Throughput Path Metric for Multi-hop Wireless Routing,” Wireless Network 11, 4, pp. 419-434, 2005. 4. C. Gui and P. Mohapatra, “Power conservation and quality of surveillance in target tracking sensor networks,” Proc. MobiCom ’04, pp. 129–143, 2004. 5. M. T. Ha, T. D. Le, and H. Choo, “Employing a Novel Two Tiered Network Structure to Extend the Lifetime of WSNs,” Proc. WCNC, pp. 1–6, 2009. 6. http : //www.xbow.com/products/P roduct pdf f iles/ W ireless pdf /M ICA2 Datasheet.pdf. 7. 802.15.4-2003: IEEE Standard for Information Technology Part 15.4: Wireless Medium Access Control and Physical Layer specifications for Low-Rate Wireless Personal Area Networks, 2003. 8. B. Latr, P. D. Mil, I. Moerman, B. Dhoedt, and P. Demeester, “Throughput and Delay Analysis of Unslotted IEEE 802.15.4,” Journal of Networks, Vol. 1, No. 1, May 2006. 9. S. Lee, B. Bhattacharjee, and S. Banerjee, “Efficient geographic routing in multihop wireless networks,” Proc. Mobihoc, pp. 230–241, 2005. 10. Michael K. Molloy, “Fundamental of Performance Modeling,” Macmillan, New York, 1988. 11. D. T. Nguyen, W. Choi, M. T. Ha, and H. Choo, “A Novel Multi-ACK Based Data Forwarding Scheme in Wireless Sensor Networks,” Proc. IEEE WCNC ’10, pp. 1–6, 2010. 12. T. Rappaport, “Wireless Communications”, Prentice Hall, PTR Upper Saddle River, NJ, 2002. 13. V. Shnayder, M. Hempstead, B. Chen, G. W. Allen, and M. Welsh, “Simulating the Power Consumption of Large-Scale Sensor Network Applications,” Proc. SenSys ’04, pp. 188–200, 2004. 14. A. Woo et al., “Taming the Underlying Challenges of Reliable Multihop Routing in Sensor Networks,” Proc. SenSys, pp. 14–27, 2003. 15. A. Woo and D. C. Culler, “A transmission control scheme for media acess in sensor networks,” Proc. of ACM Mobicom’01, pp. 16–21, 2004. 16. M. Z. Zamalloa, K. Seada, B. Krishnamchari, and A. Helmy, “Efficient Geographic Routing over Lossy Links in Wireless Sensor Networks,” ACM Transactions on Sensor Networks, 2008.
Probability-based Data Forwarding
165
17. M. Z. Zamalloa and B. Krishnamachari, “An Analysis of Unreliability and Asymmetry in Low-Power Wireless Links,” ACM Transactions on Sensor Networks, 2007. 18. J. Zhao and R. Govindan, “Understanding packet delivery performance in dense wireless sensor networks,” Proc. Sensys, pp. 1–13, 2003.
A New Green-Scheduling Approach to Maximize Wireless Multimedia Networking Lifetime via Packet and Path Diversity Wei Wang1 and Sung Shin2 1
2
Department of Electrical Engineering and Computer Science, South Dakota State University, Brookings, SD 57007, USA
[email protected] Department of Electrical Engineering and Computer Science, South Dakota State University, Brookings, SD 57007, USA
[email protected]
Summary. Green computing has recently been proposed to reduce energy cost in computer systems. However, the application of green computing to Wireless Multimedia Networking (WMN) has seldom been reported in literature. In this paper we propose a new traffic scheduling approach in WMN to support green computing and energy efficient communications, and thus to improve network availability and reliability. The main contribution of the proposed approach is the network lifetime maximization for battery powered WMN by considering energy consumption and multimedia quality tradeoff. In the proposed approach, the multimedia packet and path diversity are jointly explored, and the residue energy discrepancy is minimized among nodes’ batteries subject to a lower bound of multimedia distortion requirement. Simulation results demonstrate that the proposed approach can significantly improve the energy utilization balance among WMN nodes compared with traditional media-quality optimized approach, and thus significantly extending the battery powered WMN network lifetime.
1 Introduction Green computing [R09] [G08] has recently been advocated in literature to reduce energy consumption in computer systems. For example, in a mobile and embedded wireless network system, energy efficiency rather than the network throughput becomes the major concern. In some extreme cases, for example, earthquake or tsunami disaster relief wireless mesh networks, the detriment of power supply lines and cable communication infrastructures are among the top of tremendous loss. In a temporary and randomly deployed wireless
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 9, © Springer Basel AG 2011
168
Wei Wang and Sung Shin
disaster relief network exclusively powered by battery, how to extend network lifetime and balance the traffic load are the key challenges. On the other hand, multimedia applications become dominant in wireless network environments especially disaster relief networks, such as voice calls and online video conferences for administration purposes, high resolution pictures and video sequences for dissemination media reporters, etc. In such Wireless Multimedia Networking (WMN) environment, both Quality of Service (QoS) and battery resource are important factors in system design, while the latter has largely been ignored in literature. Recent research in the area of WMN were predominantly targeted to multimedia QoS provision and optimization with stringent end to end latency constraint, while assuming the routers or forwarding nodes in multimedia based wireless networks have infinite power supply. In research [IWWZ09], the authors presented a real-world dual-radio mesh network for emergent communication. Crucial information carried in video and audio signals was transmitted among the mesh routers and the throughput performances were evaluated. In research [HXMM09], the authors proposed a multistate multipath scheme to resist network node failure in mesh topology. Various provisioning states were introduced Efficiency gains in terms of connection drop ratio and bandwidth decreases with various traffic loads were also presented. The authors in research [RKG09] presented detailed studies of multipath routing scheme for multiple description coded video streaming in 802.11 based wireless mesh networks. An enhanced version of guaranteed rate packet scheduling algorithm was also proposed to reduce the packet latency in wireless packet video networks. The research in [TAV07] proposed a distortion-driven packet scheduling approach for video streaming in multi-hop wireless networks. The overall multi-hop video transmission problem was formulated as a delay constrained distortion minimization problem by jointly considering path diversity and Medium Access Control (MAC) layer retry limit adaptation for important video packets. Similar research regarding multimedia delivery over multi-hop wireless networks can be found in [JCWF07] [WZ09] [S08] [MHSM08]. However, the primary goal of above mentioned approaches was to maximize the decoded multimedia quality and the receiver end, subject to certain bandwidth or latency constraints, while the critical battery energy constraint was not considered. Research works in Wireless Sensor Networks (WSN) put a lot of effort in energy efficiency, for example, MAC layer duty cycle management and sleep wakeup scheduling [YHE04] [VL03], as well as Physical (PHY) layer low power listening [PHC04] [RWAM05] etc. Such widely studied sensor network energy saving approaches can significantly reduce battery resource usage; however, they can not be directly applied to wireless multimedia networking especially
A New Green-Scheduling Approach
169
disaster relief networks. The reason is that MAC and PHY energy saving schemes in sensor networks are primarily design for low rate traffic low duty cycle data acquisition purpose, for example, acquisition of environmental temperature, soil humidity and sensing light intensity. The predominant multimedia traffic in terms of voice and video stream is so bandwidth intensive that exceeds the normal throughput capability of sensor networks. Different from above mentioned research works, we propose a new greencomputing traffic scheduling approach to maximize network lifetime rather than throughput or media quality. The major contribution of this approach is the improved energy balance throughout the wireless multimedia network nodes by unified exploration of multimedia packet and network path diversity. This paper is organized as follows. In section 2, we formulate the network lifetime maximization problem as a residue energy balancing problem. In section 3, we present the proposed green scheduling scheme for network residue energy balancing. In section 4 we show simulation results and in section 5 we reach a conclusion.
2 Problem Formulation Wireless multimedia networks can be applied to a wide variety of applications. Some applications such as the disaster relief networks or rural area communications require efficient utilization of battery resource, since the routers or nodes may not have permanent power supply. In such networks, communication energy efficiency becomes the paramount goal besides QoS. Let ei denote the residue energy of node i in the graph G formed by all these wireless forwarding nodes. Also let E [D] denote the expectation of distortion reduction (i.e. quality expectation after decoding at the receiver end) and Dmin denote the minimum requirement of decoded picture quality. Let N denote the total number of multimedia packets waiting for transmission, and ∂ denote the path selection strategy for each media packet. Since network lifetime is related to predicting future traffic attributes which may not be straightforwardly acquired, we optimize the residue energy balance instead in this paper. The better the energy balance usage among the nodes in networks, the longer network lifetime will be. The energy balance can be defined as the maximum difference between highest and lowest residue energy. Thus the overall problem can be formulated as: minimizing the residue energy difference (or, maximizing the energy balance) subject to minimum multimedia quality constraint.
170
Wei Wang and Sung Shin
∂k k=[0,N −1]
= arg min max (ei ) − min (ei ) ∀i∈G
(1)
∀i∈G
s.t.
E [D] ≥ Dmin
(2)
3 Proposed Green Scheduling Approach The goal to achieve maximum energy balance with multimedia quality constraint can be approached by optimal traffic scheduling, i.e. green scheduling as proposed in this paper. We assume the following communication pattern as shown in Figure 1. The source node performs media compression and transmits the media stream to a destination node, possibly via multiple paths composed of unreliable wireless links. The status information of residue energy on each forwarding node and the estimated link loss possibility are assumed to be infrequently conveyed by an overlay network. In the proposed green scheduling scheme, the source node controls the scheduling and dispatches each packet to corresponding path optimally.
To optimally dispatch multimedia packets at the source node, we need to build the connection between communication energy consumption on each hop, packet path selection, and the multimedia distortion expectation. Let Pt and Pr denote the transmission and receiving power respectively, L denote the payload length of one multimedia packet, Lh denote the packet header overhead and Lo denote the protocol overhead such as acknowledgement. Also let R denote the transmission data rate. Let etx and erx denote the energy costs of transmitter side and receiver side respectively, which can be estimated as follows.
A New Green-Scheduling Approach
171
Fig. 1. Illustration of wireless multimedia green scheduling in unreliable wireless networks.
etx = Pt ×
L + Lh + Lo R
(3)
erx = Pr ×
L + Lh + Lo R
(4)
Let e denote the residue energy of the data forwarding node, the residue energy can be updated according to the energy cost of forwarding those flowing through packets and the computational energy cost ecp . Usually computational energy is overlooked in the study for simplification since it is much lower compared with communication energy.
e⇐ e−
∂
erx −
∂
etx − ecp
(5)
172
Wei Wang and Sung Shin
Given the path selection strategy ∂ for each multimedia packet, the traffic load on each path can be determined accordingly, so as to the cumulative energy cost and residue energy in each wireless forwarding node. Furthermore, the expectation of multimedia distortion is also related to the path selection strategy ∂ for each multimedia packet, and we can quantify such relationship. Let p denote the end to end packet loss probability on a specific path, and l denote the packet loss probability on a specific wireless link. Also let d denote the distortion reduction of the multimedia packet, which means the multimedia flow at the decoder side will have quality gain of d if the corresponding packet is received error free at the end of the path. Considering multimedia packet importance diversity d and decoding diversity A (i.e. the decoding ancestor set. Ai denotes the set of packets that are the decoding ancestors of packet i), the expected overall distortion reduction can be expressed as follows.
E [D] =
N −1
di (1 − pi )
i=0
(1 − pj )
(6)
j∈Ai
In this equation the overall distortion reduction expectation is expressed as a summation of the distortion reduction all the packets in the multimedia stream, weighted with transmission success probability in the unreliable multihop wireless networks. To make contribution of the decoded media stream, a packet must be received without error, and the packets in the entire ancestor set must be received correctly. The end to end packet loss probability can be further expressed by the packet loss probability on each wireless link along the end to end wireless path.
p=1−
(1 − l)
(7)
∂
As shown in this equation, the cumulative path loss probability for a multimedia packet is directly related to the green scheduler: determination of the transmission path of one packet also determines the end to end loss probability of the same packet.
A New Green-Scheduling Approach
173
The design guideline of green scheduling can be stated as follows. For packets with higher distortion reduction contribution and more importance in multimedia decoding, the green scheduler dispatches them through communication path with lower end to end errors; for packets with lower distortion reduction contribution and less importance in media decoding, the green scheduler dispatches them via paths with higher end to end errors, and possibly with more residue energy in batteries. The proposed green scheduling algorithm for quality-assured and energy-balanced and network-lifetimemaximized wireless multimedia delivery is illustrated in Algorithm 1.
Algorithm 1. Green scheduling for wireless multimedia networking energy balancing 1. Define the input and output. Input: the residue energy e of each forwarding node, the estimated loss probability l of each wireless link, distortion reduction d of each multimedia packet, decoding ancestor set. A of each packet and minimum multimedia quality requirement Dmin . Output: path selection strategy ∂ of each multimedia packet. 2. For each available path, estimate the end to end packet loss probability p according to equation (7) using the packet loss probability l on each specific wireless link along the path. 3. Classify multimedia packets into m groups to reduce the number of independent output path selection strategies, where m equals to the number of available paths. Since the number of available paths is much smaller than the number of multimedia packet, the dimension of output path selection strategy ∂ will reduced to m. Set the initial residue energy discrepancy to maximum σmin = ∞. For each combination of packet group and path selection, do the following steps 4-5. 4. Calculate the energy cost of transmitting each packet and update the residue energy of each node according to equation (5). Calculate the expected overall distortion reduction according to equation (6) with regards to the end to end packet loss probability. 5. Calculate the residue energy difference σ = max (ei ) − min (ei ) and update the optimal solution if necessary. If σ < σmin and E [D] ≥ Dmin then σmin = σ;
∀i∈G
∀i∈G
174
Wei Wang and Sung Shin
Record the path selection strategy for the m groups of multimedia packets [∂0 , ∂1 , ......, ∂m−1 ]. Else go back to step 3 and check the next possible combination. 6. Done, output the path selection strategy for the m groups of multimedia packets [∂0 , ∂1 , ......, ∂m−1 ] as the optimal solution.
4 Numerical Simulation In this section we perform numerical simulation study to evaluate the proposed green scheduling approach in terms of network lifetime (evaluated by maximum energy discrepancy among forwarding nodes) and multimedia distortion performances. In comparison we also evaluate the network lifetime and multimedia distortion performances of traditional approaches targeting to maximize multimedia service quality rather than network lifetime. We denote the proposed green scheduling approach as “Green Sched” and traditional approach as “MaxQual Sched”. According to our simulation results, the proposed green scheduling approach can significantly improve the residue energy balancing throughout the network over traditional maximum quality scheduling approach. The simulation parameters are stated as follows. We use a standard H.264 codec named JM software as our multimedia source coder and akiyo cif with size of 258*288 pixels per picture as the standard input video source. The video frame rate is 10fps, and intra frame coding period is set as 5, with B frame disabled. Entropy coding mode is set to Context Adaptive Binary Arithmetic Coding (CABAC) for better compression performance. At network side we use a simple topology as illustrated in Figure 1, with three disjoint paths and three wireless hops on each path. Simulation packet loss probability on each link has also been illustrated in this figure. Transmission power is 20 mW and receiving power is 15 mW. Transmission data rate is 10 Mbps, link layer packet header is 6 bytes and acknowledgement packet overhead is 10 bytes.
A New Green-Scheduling Approach
175
Fig. 2. Maximum energy discrepancy for various distortion requirements.
Figure 2 illustrated the network lifetime performance with regards to different multimedia distortion requirements. As we have discussed earlier, the network lifetime is evaluated in terms of residue energy difference among the wireless nodes, i.e. σ = max (ei ) − min (ei ). Thus the smaller the residue en∀i∈G
∀i∈G
ergy difference, the better the energy balance among the whole networks, and the longer the network lifetime will be. From this figure we can clearly see, the network lifetime and multimedia service quality can be balanced in the proposed approach. The proposed approach can achieve low residue energy difference and thus better network lifetime when the multimedia service quality requirement is low (e.g. 10-20 dB measured in PSNR). The energy balance performance of the proposed approach become close to that of traditional quality optimized approach when the service quality requirement is high. In other words, the proposed approach can provide a tradeoff between network lifetime and service quality. When the service quality requirement is high, both traditional approach and the proposed approach achieve similar network lifetime performance; however, significant network lifetime gain can be acquired when the quality of service requirement is decreased. This is because in the proposed approach, both network path diversity and multimedia packet diversity are explored. Important multimedia packets
176
Wei Wang and Sung Shin
Fig. 3. Multimedia distortion with various distortion requirements.
with large distortion reduction and more decoding-dependent children packets are transmitted via the paths with low cumulative end to end packet error rates(i.e. high reliability), and thus the multimedia service quality can be effectively guaranteed. On the other hand, the unimportant multimedia packets with small distortion reduction and less decoding-dependent multimedia packets are transmitted via the paths with high cumulative end to end packet error rate (i.e. low reliability) and the network level energy balancing is achieved. In traditional quality optimized approach, such diversity is not explored and packet transmission is scheduled to go through the path with lowest cumulative end to end packet error rate regardless of packet and path diversity. This is the reason why the performance curve of the tradition approach is a constant line. Although such scheduling may achieve better multimedia service quality by exploiting the most reliable path, the energy balancing and thus the network lifetime is sacrificed. Figure 3 illustrates the overhead of the proposed green scheduling approach. The proposed green scheduling has lower multimedia service quality than traditional quality optimized approach, especially when the service quality requirement is low where the traditional approach does not consider the minimum quality (i.e. distortion reduction) bound. The proposed green
A New Green-Scheduling Approach
177
Fig. 4. Maximum energy discrepancy with increase of time
scheduling explores the distortion bound and relaxes the service quality provision to achieve better network lifetime. Figure 4 shows the network lifetime performance evaluated in terms of network level energy balancing with the increase of time. With the increase of time both approaches have larger discrepancy of residue energy in the wireless forwarding nodes’ batteries. However, the speeds of such deterioration are not the same for these two approaches. In this figure we can see, the proposed green scheduling approach has significantly lower slope of residue energy discrepancy than traditional quality optimized approach. Again, the reason is in the proposed green scheduling approach the network path diversity and multimedia packet diversity are both explored. Traffic load is efficiently balanced among the network paths while the lower bound multimedia service quality is guaranteed.
178
Wei Wang and Sung Shin
5 Conclusion In this paper we have proposed a new green scheduling approach to achieve extended network life by improving residue energy balance performance among the forwarding nodes in wireless multimedia networks. In the proposed approach, multimedia packet diversity with different perception importance and network path diversity with different end to end packet loss probabilities are jointly explored, and the residue energy discrepancy has been minimized with a lower bound of multimedia service quality guarantee. Simulation results demonstrated that the proposed approach can significantly improve the energy balance throughout the networks by considering the tradeoff between residue battery energy and multimedia service quality.
A New Green-Scheduling Approach
179
References [R09] Want, R. : How Green Is Green. IEEE Pervasive Computing, vol. 8, no. 1, pp.2 - 4, Jan. 2009 [G08] Goth, G. : The Net’s Going Green: Multipronged Approach Might Save Costs, Energy – and the Climate. IEEE Internet Computing. vol. 12, no. 1, pp.7 9, Jan. 2008 [IWWZ09] Iqbal, M., Wang, X., Wertheim, D., Zhou, X.: SwanMesh: a multicast enabled dual-radio wireless mesh network for emergency and disaster recovery services. Journal of Communications. vol. 4, no. 5, pp. 298-306, Jun 2009 [HXMM09] Huang, S. , Xia, M. , Martel, C. , Mukherjee, B. : A multistate multipath provisioning scheme for combating node failures in telecom mesh networks. IEEE Military Communications Conference. pp.1 - 5, Oct. 2009 [RKG09] Rong, B. , Kadoch, M. , Guizani, M.: Multipath routing for multiple description video communications over wireless mesh networks. IEEE Wireless Communications. vol. 16, no. 4, pp.24 - 30, Aug. 2009 [TAV07] Tong, X. , Andreopoulos, Y. , van der Schaar, M. : Distortion-Driven Video Streaming over Multihop Wireless Networks with Path Diversity. IEEE Trans. Mobile Computing. vol. 6, no. 12, p.1343 - 1356, Dec. 2007 [JCWF07] Jurca, D. , Chakareski, J. , Wagner, J.-P. , Frossard, P. : Enabling adaptive video streaming in P2P systems,” IEEE Communications Magazine. vol. 45, no. 6, pp.108 - 114, Jun. 2007 [WZ09] Wang, P. , Zhuang, W. : A collision-free MAC scheme for multimedia wireless mesh backbone. IEEE Trans. Wireless Communications, vol. 8, no. 7, pp.3577 - 3589, Jul. 2009 [S08]
Song, L. :“Wireless Mesh Infrastructure Supporting Broadband Internet with Multimedia Services. IEEE Int. Conf. Circuits and Systems for Communications. pp.792 - 796, May. 2008
[MHSM08] Mao, S. , Hou, Y. , Sherali, H. , Midkiff, S. : Multimedia-Centric Routing for Multiple Description Video in Wireless Mesh Networks. IEEE Network. vol. 22, no. 1, pp.19 - 24, Jan. 2008 [YHE04] Ye, W. , Heidemann, J. , Estrin, D. : Medium Access Control With Coordinated Adaptive Sleeping for Wireless Sensor Networks. IEEE/ACM Transactions on Networking. vol. 12, no. 3, pp.493 - 506, Jun. 2004
180
Wei Wang and Sung Shin
[VL03] van Dam, T. , Langendoen, K. : An adaptive energy efficient MAC protocol for wireless sensor networks. Proc. ACM Conf. Embedded Networked Sensor Systems (SenSys). Los Angeles, CA, Nov. 2003 [PHC04] Polastre, J. , Hill, J. , Culler, D. : Versatile low power media access for wireless sensor networks. Proc. ACM Conf. Embedded Networked Sensor Systems (SenSys). Baltimore, MD, Nov. 2004 [RWAM05] Rhee, I. , Warrier, A. , Aia, M. , Min, J. : Z-MAC: a hybrid MAC for wireless sensor networks. Proc. ACM Conf. Embedded Networked Sensor Systems (SenSys). San Diego, CA, pp.90 – 101, Nov. 2005
Design of a reliability enhancement scheme for the grid-topology mesh network Junghoon Lee1 and Gyung-Leen Park2 1
2
Dept. of Computer Science and statistics, Jeju National Univ., Rep. of Korea
[email protected] Dept. of Computer Science and statistics, Jeju National Univ., Rep. of Korea
[email protected]
Summary. This paper first designs a robust routing-scheduling scheme for the gridtopology traffic light network, aiming at enhancing the correctness and timeliness of control applications by the reliable transmission of monitor and control messages. Targeting at the slot-based WirelessHART protocol, the joint routing and scheduling scheme decides the route between the controller and each node, allocating time slots using well-known Dijkstra’s algorithm. A virtual link model, taking a two-hop splitmerge path as a single-hop link, can find the slot schedule that combines the primary and secondary paths to complement the inflexibility of the static slot assignment. Next, a reliability enhancement scheme is addressed for the sake of improving the message delivery ratio from the sensor node to the controller. To this end, each node maintains a retry queue, not discarding the undelivered message as in the conventional standard. Through the slots inevitably wasted due to the channel error in the previous slots, the stored message is retransmitted according to the distance to the controller. Simulation results show that the proposed scheduling scheme can enhance the delivery success ratio by up to 10.9 % and operates robustly on node and link errors. In addition, the retransmission scheme can further improve the message delivery ratio by up to 29.4 % and reduce the message inter-arrival time by up to 4.2 % for the given experiment parameters.
1 Introduction Compared with the traditional wired process control systems, wireless process control has the potential to save maintenance costs as well as to make installation much easier and flexible [Han09]. WirelessHART (Wireless Highway Addressable Remote Transducer) is the first open wireless communication standard specifically designed for process control applications [HCF07]. It is a slot-based wireless mesh networking technology operating in the 2.4 GHz radioband. Its key advantages lie in its design for reliability, security, and efficient power management [Han09]. In particular, WirelessHART is designed to tolerate the transient instability of wireless channels by adopting advanced techniques such as channel hopping, channel blacklisting, and time-synchronized S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 10, © Springer Basel AG 2011
182
Junghoon Lee and Gyung-Leen Park
messaging [Bah04]. In a WirelessHART network, a network manager is responsible for maintaining communication schedules, or slot allocation, to guarantee meeting the time constraint of delay-sensitive messages [Son08]. Under the control of the network manager, node join and leave operations can be provided for efficient process control. Slot allocation is performed based on the routing protocols, and WirelessHART currently defines graph routing and source routing [Son08]. Each hop of a routing path is mapped to the individual slots. Each node, namely, a field device, transmits or relays a message according to this schedule, waking up at the slot it is associated with. A superframe is the complete set of slot assignments in a single control loop. The superframe schedule is downloaded to each device, which repeats the message exchange according to the schedule until a new superframe schedule is downloaded. The network manager can generate routes for the various purposes, for example, balancing the network load, minimizing the latency, or improving the reliability. Our previous work has designed a routing scheme which can integrate the alternative path in the grid style network [Lee10]. A slot assignment, which actually coincides with the routing scheme, can be built on top of the split-merge operation, adapting the path according to the current channel condition on each slot. It can significantly improve the message delivery ratio in the monitoring and controlling phases of a control loop. How to route a message is the main issue in this mesh network and the routing scheme depends on the node distribution, namely, topology, and the communication protocol. In the road network, traffic lights can install wireless communication interfaces to provide stable network access to the passing-by vehicles. They have sufficient power provision and their locations are highly secure. On such a traffic light network, it is possible to implement a monitor-andcontrol application when the network includes sensors and actuators [IEC08]. A lot of devices such as speed detectors, pollution meters, and traffic signal controllers, can participate in this network. Moreover, vehicles can also carry a sensor device and report the collected sensor data to a static node when connected. Particularly, traffic lights are placed in each intersection of Manhattan-style road networks, so the traffic light network is highly likely to have a grid topology. The grid style network has many alternative paths that can be integrated into the network schedule. In the typical control loop scenario, messages are exchanged between the controller and each of sensor or actuator nodes. For the message from a node more than one hop away from the controller, a series of time slots are assigned, while each slot carries one-hop sequence. A single-hop message transmission can succeed only if the channel condition is good during the scheduled slot time. Not to mention, an end-to-end message delivery can succeed only if all single-hop transmissions succeed. A message transmission failure in a slot inevitably results in the bandwidth waste along the succeeding slots belonging to the end-to-end path. In this case, the scheduled sender has no message to transmit. For example, suppose that slot t is assigned to the transmission
Design of a reliability enhancement scheme for the grid-style networks
183
from N2,0 to N1,0 , while t + 1 to that from N1,0 to N0,0 , respectively. If the transmission in slot t fails, slot t + 1 is wasted as N1,0 has no message to send. This situation is more serious for the communication path involving the large number of hops. In the mean time, a sensor node generates a message and sends repeatedly with a given period. One collection and control round corresponds to the superframe of the network schedule. Even though such a sensor message has strict time constraints, the delay of one or more rounds can be generally tolerable [Ahm10]. In this regard, this paper is to first address a routing and scheduling scheme for the traffic light network having the grid topology and analyze its performance focusing on the effect to the loop length and how this scheme works on link or node failures. After implementing the slot allocator, we measure the performance with diverse parameter setting. Then, a message recovery scheme is designed, based on the assumption that the system can accept the delay of one or more rounds. Our scheme makes a node retransmit messages undelivered in the previous round through the idle slot, giving precedence to the message from the node farther away from the controller. To say nothing of the success ratio improvement, this scheme can reduce the consecutive message loss for each sensor node. This paper is organized as follows: After outlining the problem in Section 1, Section 2 describes the background and related work. Section 3 explains the recovery scheme in detail. After the performance measurement results are demonstrated in Section 4, Section 5 summarizes and concludes this paper with a brief introduction of future work.
2 Background and related work 2.1 Routing protocols Wireless mesh networks are cost-effective solutions for ubiquitous high-speed services, and its performance depends on the routing mechanism. Routing has been extensively studied in wireless mesh networks, and most routing schemes are based on the shortest path algorithm [Kod05]. The path cost is different according to the main goal of each routing scheme, including actual distance, transmission rate, and error characteristics. In the wireless process control system where the central routing mechanism is taken, the traffic characteristics are given in advance while network access is generally predictable. Accordingly, it is possible to jointly allocate channels, route a message set, and schedule each transmission. After all, the routing procedure is executed repeatedly and the schedule is distributed to each node. In addition, multipath routing makes it possible to find a node-disjoint or link-disjoint path to enhance the reliability of message delivery in spite of node or link failures [Adi06].
184
Junghoon Lee and Gyung-Leen Park
Traffic information cannot always be accurately provided to the communication manager [Wan07]. To deal with this case, Wang et al. have proposed a joint routing-scheduling scheme that achieves robust performance under traffic information uncertainty. It focuses on the worst case optimal performance under a range of traffic conditions, taking into account the interference among links. This interference is critical and unique in a wireless sensor network. As long as the traffic variation is within the estimation range, routing and scheduling does not need to be recomputed and redistributed. This scheme also considers the possibility to exploit the oblivious routing with the decentralized MAC, for example, IEEE 802.11, in case the centralized scheduling is hard to implement. Zaidi et al. have suggested an enhancement for standard routing protocols such as DSDV (Destination Sequenced Distance Vector) and OLSR (Optimized Link State Routing) [Zai08]. Called RIC (Routing Inconsistency Check), this scheme allows some routers to passively listen to the data flows and routing control messages in their neighborhood, compare the routing information including source ID, destination ID, TTL (Time-To-Live) with their states, try to determine the potential causes when inconsistencies are found, and send updates to the nodes causing inconsistent routing behavior. In case the node would not change its behavior after a number of updates have been sent, the special RIC router will inform the network manager and the malfunctioning node will be isolated. This approach requires that each node should have at least one RIC in its radio range on fixed topology. 2.2 WirelessHART Just like other wireless technologies such as Zigbee [Gis08] and Bluetooth [Mul00], WirelessHART operates on the IEEE 802.15.4 2.4 GHz radioband [IEC08]. It includes 16 frequency channels spaced by 5 MHz guard band. The data link layer provides time-division access on top of the time synchronization process, which is carried out continuously during the whole network operation time [Han09]. The time axis is divided into 10 ms time slots and a group of consecutive slots is defined to be a superframe. To meet the robustness requirement of industrial applications, WirelessHART designates a central network manager that determines the routing and communication schedules. This schedule can be provisioned to the field devices a priori as part of system design and also updated via a channel that is reserved for this purpose. The manager decides the path between a source and each destination to assign the (sender, receiver) pair of each time slot along the path. The network operation of each node is time-driven, and a device wakes up by the timer interrupt on its sending and receiving slots [Son08]. One of the most interesting features of WirelessHART is that each slot runs CCA (Clear Channel Assessment) before the message transmission as shown in Figure 1 [IEC08]. Due to the half-duplex nature of current wireless systems, collision detection is not applicable. Instead, automatic CCA
Design of a reliability enhancement scheme for the grid-style networks
185
before each transmission and channel blacklisting is used to avoid a specific interference area and also to minimize interference to others. This procedure takes just several bit time. The 802.15.4 standard specifies that CCA may be performed using energy detection, preamble detection, or the combination of the two [Ram07]. In addition, there are also other reliable channel estimation methods available for the MAC layer to obviate erroneous communication over an unclear channel [Cha07]. If the channel is detected not to be clear, the sender will neither proceed nor it will try another recovery action; the specific action is not defined in the standard. In some special case like a grid network, an alternative path can be tried within a single slot by switching channel frequency to forward the message to the secondary destination [Lee10].
Source TsCCAOffset TsCCA TsRxTx TsTxOffset TsError
TsMaxPacket TsRxAckDelay TsAckWait
Destination TsRxOffset
TsRxWait
TsTxAckDelay
TsAck
Fig. 1. WirelessHART time slot
3 Routing and recovery scheme 3.1 System model and split-merge operation Downtowns of many modern cities have a Manhattan-style road network, at which some researches on vehicular networks are targeting [Che08]. The traffic light network forms a grid network in such cities, as each traffic light node is placed at each crossing of the road network, as shown in Figure 2 [Jaa05]. If we assume that each traffic light is equipped with a wireless communication interface taking a directional antenna, each node can exchange messages directly with its vertical and horizontal neighbors. Two nodes in the diagonal of a rectangle do not have a direct connection, as there may be obstacles like a tall building that blocks the wireless transmission. In this network, a central controller is assumed to be located at the fringe of a rectangular area, for this architecture makes the determination of the communication schedule simple and systematic. In Figure 2, N0,0 is the controller node. Any grid network can be transformed into this network by partition and rotation [Lee10]. In each control round, every monitoring message is reported from the respective
186
Junghoon Lee and Gyung-Leen Park
nodes to the controller and in response the corresponding control action is delivered to each node oppositely.
N0,0 V1,0
H0,1 0.57
V2,0
H1,1 0.89
H2,1 1.57
N3,0
H3,1 1.32
H 1,2
V2,2 H2,2 1.23
H3,2
V1,3 H 1,3
H2,3 1.53
H3,3 1.13
1.79
N2,3
V3,3
1.54
1.27
N1,3 V2,3
1.71
N3,2
N0,3
0.51
N2,2
V3,2
0.68
H0,3 0.79
1.23
N1,2
1.53
1.79
N3,1
N0,2 V1,2
1.26
N2,1 V3,1
0.96
H0,2 1.39
1.01
N1,1 V2,1
1.89
N2,0 V3,0
V1,1
0.62
N1,0
N0,1
0.76
N3,3
Fig. 2. 4 × 4 grid and sample message delivery ratio (link error rate in %)
Our previous work has proposed the split-merge operation for better reliable communication [Lee10]. As an example, for a transmission from N0,0 to N1,1 , N0,0 , senses a channel status for V1,0 at slot i. If it is clear, it sends to N1,0 according to the original schedule. Otherwise, instead of discarding the transmission, it sends to N0,1 after switching channels (split operation). Here, N0,1 (the receiver on the alternative path) as well as N1,0 (the receiver on the primary path) must listen to the channel simultaneously at slot i, and this is the overhead cost for enhanced reliability. At slot i + 1, either N1,0 or N0,1 sends the packet to N1,1 . N0,1 on the secondary route must send, if it has to, after a small delay at least as large as one channel switch time and T sRxOf f set specified in the original standard. N1,1 first tries to receive from N1,0 on the primary route. If the packet arrives, it receives as scheduled. Otherwise, the node switches channel to H0,1 on the secondary route (merge operation). This operation can work without significantly degrading the network throughput as the CCA and channel switch time is less that 10 % of a single time slot. It can be applied to a rectangular path and the grid network has many rectangular paths. After all, the split-merge operation makes it possible to take both paths according to the current channel status even in the static slot schedule.
Design of a reliability enhancement scheme for the grid-style networks
187
3.2 Slot schedule The routing scheme decides the routes which can maximize the delivery success ratio. In the control loop scenario, traffic goes from and to N0,0 . Namely, each node sends and receives a message to and from the controller node once in the control round. Even if it is desirable to take the route which has the minimum number of hops to the destination, another detour can be advantageous in terms of delivery ratio and transmission delay. In process control applications, transmission reliability is most important. Each link has its own error characteristics due to different power level, obstacle distribution, and so on. The change of link error characteristics can be estimated in many ways [Cha07], but we assume that the probing result is always correct, as the correctness of channel probing is not our concern. For a node, there are many paths, that is, a series of links or nodes, from the controller, and each of them has different (estimated) success probability and hop length. A path is selected by the scheduler periodically according to the change in the error characteristics of each link. From now on, we will just mention the uplink case for simplicity, as uplink and downlink are symmetric. For the given cost graph having the link error rate, Dijkstra’s shortest path algorithm can find the best route having the lowest error rate (best success rate). For this purpose, the error rate of each link is converted to (estimated) success ratio by subtracting the error rate from 1.0. After all, they can be used interchangeably. Each expansion step of the shortest path algorithm selects the node that has the best success probability, and then the success probabilities to its neighbor nodes are updated by the product of success ratio of the connection link and the success probability to the expansion node, if necessary. With all end-to-end paths in the control loop, the superframe schedule is completed by allocating a slot to a (source, destination) pair for each hop of all end-to-end paths as in other routingallocation schemes [Wan07]. In the mean time, if this shortest path scheme is to take into account the split-merge operation, the link cost must be reestimated. Our scheme finds the path with the lowest error rate by modeling the split-merge operation as a single virtual link, V , to apply the well-known shortest path algorithm. To begin with, each link has its own error rate, which can be obtained by the long-term and short-term observation. Additionally, the link error rate for the rectangular 2-hop path can be estimated as shown in Figure 3. This figure shows a rectangular portion consists of 4 nodes and 4 links having the error rate from e1 to e4 . F1 is the error rate estimation for the case the Ni+1,j+1 → Ni,j+1 → Ni,j is selected as primary path. (1 − e2 )(1 − e1 ) is the probability that the channel from Ni+1,j+1 → Ni,j+1 is good at time slot t and also the channel from Ni,j+1 → Ni,j is good at time slot t+1. The channel Ni+1,j+1 → Ni,j+1 is not good with the probability of e2 . In that case, the secondary route is tried, and its success probability is e2 (1 − e3 )(1 − e4 ). F2 can be estimated in the same way.
188
Junghoon Lee and Gyung-Leen Park
Ni,i e3 Ni+1,i
e1 V e4
Ni,i+1 e2
F 1 = (1 −e 1 ) (1 −e 2 ) + e 2 (1 −e 3 ) (1 −e 4 ) F 2 = (1 −e 3 ) (1 −e 4 ) + e 4 (1 −e 1 ) (1 −e 2 )
Ni+1,i+1 Fig. 3. Split-merge operation
This scheme is able to cope with the node or link failure easily. To begin with, for the detection of link or node break, each node basically exchanges HELLO messages, as in most wireless communication systems. When a node detects a link break, it reports the topology change to the controller [Buc07]. How accurately and promptly this break can be detected is another problem and this paper assumes that the detection is always correct and reported to the controller within a reasonable time bound [Kan10]. In addition, the WirelessHART standard exclusively allocates a channel for network management purpose. For a link failure, the error rate of that link will be changed to 1.0. For a node failure, the error rate of four surrounding links will be set to 1.0. The error rate of the virtual links will be updated if they are affected by the state change. Finally, a new routing decision and the corresponding slot allocation are created and propagated to each node. We have implemented a router and slot allocator for the given grid topology and the link error distribution. Figure 4 shows the slot allocation result for the link error distribution in Figure 2, where the link error rate is marked next to each link. In this example, for the 4 × 4 grid, 50 slots are allocated for uplink transmissions in a control round. If we do not consider the virtual links and just try to minimize the number of hops, 48 slots will be assigned. In this figure, the rows having * are the first slots of end-to-end transmissions. For example, slots 39 through 43 are for the transmission from N2,3 to N0,0 , while slot 39 is the first of this end-to-end transmission. The operation column indicates whether the slot performs a split operation, a merge operation, or a normal message transmission. For a split operation, two destinations are shown while two sources are involved for a merge operation. A split operation comes with a merge operation as they are executed in the adjacent slots for a rectangle. 3.3 Retransmission scheme As mentioned previously, the sender wakes up and tries to send a message to the receiver node at each slot boundary. Indispensably, the receiver also wakes up at the same time. Some slots run the regular transmit/receive operation while others run the split-merge operation. After the sender transmits its message, the receiver replies an acknowledgment within T sAckW ait, making it possible for the sender to know whether the transmission has been success-
Design of a reliability enhancement scheme for the grid-style networks Slot 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Op. Source(s) N1,0 N0,1 N2,0 N1,0 Sp N1,1 Mg N1,0 ,N0,1 N0,2 N0,1 N3,0 N2,0 N1,0 Sp N2,1 Mg N2,0 ,N1,1 N1,0 Sp N1,2 Mg N1,1 ,N0,2 N0,1 N0,3 N0,2 N0,1 N3,1 Sp N3,2 Mg N3,1 ,N2,2 Sp N2,1 Mg N2,0 ,N1,1
Destination(s) N0,0 N0,0 N1,0 N0,0 N1,0 , N0,1 N0,0 N0,1 N0,0 N2,0 N1,0 N0,0 N2,0 , N1,1 N1,0 N0,0 N1,1 , N0,2 N0,1 N0,0 N0,2 N0,1 N0,0 N3,2 N3,1 , N2,2 N2,1 N2,0 , N1,1 N1,0
Slot * 25 * 26 * 27 28 * 29 30 * 31 32 * 33 34 35 * 36 37 38 * 39 40 41 * 42 43 44 * 45 46 47 48 49
Op. Source(s) N1,0 Sp N2,2 Mg N2,1 ,N1,2 Sp N1,1 Mg N1,0 ,N0,1 N1,3 Sp N1,2 Mg N1,1 ,N0,2 N0,1 Sp N3,2 Mg N3,1 ,N2,2 Sp N2,1 Mg N2,0 ,N1,1 N1,0 Sp N2,3 Mg N2,2 ,N1,3 Sp N1,2 Mg N1,1 ,N0,2 N0,1 Sp N3,3 Mg N3,2 ,N2,3 Sp N2,2 Mg N2,1 ,N1,2 Sp N1,1 Mg N1,0 ,N0,1
Destination(s) N0,0 N2,1 , N1,2 N1,1 N1,0 , N0,1 N0,0 N1,2 N1,1 , N0,2 N0,1 N0,0 N3,1 , N2,2 N2,1 N2,0 , N1,1 N1,0 N0,0 N2,2 , N1,3 N1,2 N1,1 , N0,2 N0,1 N0,0 N3,2 , N2,3 N2,2 N2,1 , N1,2 N1,1 N1,0 , N0,1 N0,0
189
*
*
*
*
*
Fig. 4. Slot allocation for the link error distribution of Figure 2
ful. The undelivered message can be kept in the node for future retransmission. Conventionally, slots are not allocated for the retransmission in a static schedule, as the transmission error happens unpredictably, and allocating for all possible cases brings too much overhead. In the mean time, the receiver node which didn’t receive the message will be a sender node in some of the next slots unless it is the final destination. This node has no message to send, wasting many slots. In Figure 2, assume that N3,3 sends to N0,0 along the path of 6 hops, which are mapped to 6 slots one by one. If a message started from N3,3 fails, subsequent 5 slots have no message to relay. This situation is more serious for the larger grid which has more multi-hop transmissions. However, the unused slot can be used for the retransmission of messages undelivered in the previous rounds. To this end, each node maintains a retry queue, which stores a failed message until its delay tolerance bound doesn’t expire. Particularly, for the monitoring phase which keeps collecting the status of each sensor, the sensor value of the previous round is still valid. Here, the node can implement several priority-based policies to select the message to retransmit first. In the monitoring operation, the accuracy is affected by the
190
Junghoon Lee and Gyung-Leen Park
consecutive loss of messages from a specific sensor node. The node more hops away from the controller more suffers from the consecutive losses. As a result, each node orders the queue by the distance from the controller. For the retried message, the routing path for the remaining path doesn’t need to be changed. The static slot schedule can deliver all messages to the controller in the same route, as it decides the path based on the slot error rate.
4 Simulations This section evaluates the performance of our scheme via simulation using SMPL, which provides a simple but essential discrete event trace library [Mac87]. The 4 × 4 grid is mainly selected for the experiment, and every wireless link is assumed to be directional. That is, a link is used for one single (source, destination) pair. By default, the link error distributes exponentially with the given average error rate. We have first implemented a slot allocation procedure based on the virtual link model described in Subsection 3.2. In the simulation, only the uplink graph was considered for simplicity, as uplink and downlink communications are symmetric and calculated completely in the same way. Hence, in our model, each node transmits messages to the controller node one by one according to the slot assignment as described in the previous section. The experiment consists of two parts, namely, one for the performance of the message transmission based on the proposed routing-allocation scheme, and the other for the buffered retransmission. 4.1 Slot allocation This section measures the performance of the routing-allocation scheme and compares with the general grid schedule. Here, the grid schedule takes a route without split-merge operations and it is generated also by means of Dijkstra’s shortest path algorithm. The performance metric includes the success ratio of all end-to-end messages, the loop length, and the effect of node or link failures. In addition, the slot error rate and the square grid dimension are the main performance parameters. The first experiment measures the success ratio according to the slot error rate and the grid dimension. For each slot error rate value ranging from 0.0 to 0.5, 500 sets are generated and the results are averaged. Figure 5 shows the effect of slot error rate for the 4 × 4 square grid. Here, the curve marked with SM is the proposed scheme to represent the routing-allocation scheme based on the split-merge operation. The performance gap increases along with the slot error rate, growing up to 6.7 %. Nodes in the diagonal of the grid can achieve much better success ratio due to the split-merge operation, while those on the same row and column with the controller cannot expect any improvement [Lee10]. In addition, Figure 6 shows the success ratio according to the grid dimension from 3 to 12. For a large grid, the end-to-end path has
Design of a reliability enhancement scheme for the grid-style networks
191
more hops, so the success ratio drops. The proposed scheme is less affected by the increased number of hops, showing the performance improvement of 10.9 % for the 12 × 12 grid. 1 "Grid" "SM"
Success ratio
0.9 0.8 0.7 0.6 0.5 0.4 0
0.1
0.2 0.3 Slot error rate
0.4
0.5
Fig. 5. Effect of slot error rate to success ratio
0.8
"Grid" "SM"
Success ratio
0.7 0.6 0.5 0.4 0.3 3
4
5
10 9 8 7 6 Square grid dimension
11
12
Fig. 6. Effect of grid dimension to success ratio
Figure 7 and Figure 8 show the loop overhead brought by the split-merge operation for the 4 × 4 grid. After routing and scheduling, both grid and SM schemes create their own slot assignment tables. The ratio of two table lengths is defined as the loop overhead. As shown in Figure 7, when the slot error rate is 0.02, the loop overhead reaches 27 %, and begins to decrease. It means that a path having more hops can have better success ratio. However, its effect is not significant. Anyway, the overhead ratio is stabilized from the point of 0.12, indicating that better reliability yields about 12 % increase in response time. Figure 8 plots the loop overhead according to the grid dimension when
192
Junghoon Lee and Gyung-Leen Park
the slot error rate is fixed to 0.1. This figure indicates that the loop overhead is less affected by the grid dimension, as it decreases quite slowly. Actually, the loop overhead will be 0, if every link has the same error rate. 0.3 "LoopOverhead"
Loop overhead
0.25 0.2 0.15 0.1 0.05 0 0
0.1
0.2 0.3 Slot error rate
0.4
0.5
Fig. 7. Effect of slot error rate to loop length
0.4
"LoopOverhead"
0.35 Loop overhead
0.3 0.25 0.2 0.15 0.1 0.05 0 3
4
5
9 10 8 7 6 Square grid dimension
11
12
Fig. 8. Effect of grid dimension to loop length
Figure 9 and 10 plot the effect of node failures to the success ratio in both grid and SM schemes. The slot error rate is fixed to 0.1 in the 4 × 4 grid. For each given number of node failures, the failed node is randomly selected and the trial is repeated 500 times. As shown in Figure 9, the increase in the number of node failures beyond 10 cuts down the success ratio almost to zero in both schemes. Even though the SM scheme outperforms the grid routing scheme for the whole range, the performance gap is meaningless when more than 2 nodes fail. Hence, the node failure is fatal to the performance of the split-merge operation and its routing procedure, especially when the failed
Design of a reliability enhancement scheme for the grid-style networks
193
node is closer to the controller. Figure 10 shows the effect of node failures for the dimension of 4 through 12. The slot error rate is set to 0.1 and 10 % of nodes are assumed to fail. The failed node is also selected randomly. For the same node failure ratio, the SM scheme achieves better performance especially on a larger grid by up to 8.3 % when the dimension is 12. 0.9 "Grid" "SM"
0.8
Success ratio
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0
2
4 6 8 10 12 Number of node failures
14
16
Fig. 9. Effect of number of node failures
0.8
"Grid" "SM"
0.75 Success ratio
0.7 0.65 0.6 0.55 0.5 0.45 0.4 4
5
10 9 8 7 6 Square grid dimension
11
12
Fig. 10. Effect of grid dimension on node failures
Figure 11 shows the effect of link failures to the success ratio. Here again, the slot error rate is also fixed to 0.1 in the 4 × 4 grid. As contrast to the node failure case where even a single failure causes surrounding 4 links to be unreachable simultaneously, the link failure has less effect to the success ratio. Up to 20 out of 24 link failures, some nodes are still reachable from the controller. As in the case of node failures, if a failed link is participating in the split-merge operation, the damage to the success ratio will be more serious.
194
Junghoon Lee and Gyung-Leen Park
Both schemes show the almost same success ratio when more than 8 links fail, while the performance improvement gets smaller for more link failures. Figure 12 plots the success ratio for the grid dimension ranging from 4 to 12 on the link failure situation. 25 % of links are assumed to fail. Interestingly, the success ratio is highest in the 6 × 6 grid, and then decreases according to the increase of grid dimension. We think that even a smaller portion of link failures can do much harm to the small grids, namely, 4 × 4 and 5 × 5 grids. 0.9 "Grid" "SM"
0.8
Success ratio
0.7 0.6 0.5 0.4 0.3 0.2 0.1 0 0
5
10 15 Number of link failures
20
Fig. 11. Effect of number of link failures
0.9
"Grid" "SM"
0.85 Success ratio
0.8 0.75 0.7 0.65 0.6 0.55 0.5 4
5
10 9 8 7 6 Square grid dimension
11
12
Fig. 12. Effect of grid dimension on link failures
4.2 Buffered retransmission For the performance analysis of the buffered retransmission, two main performance metrics are the delivery success ratio and message inter-arrival time.
Design of a reliability enhancement scheme for the grid-style networks
195
Success ratio
In monitoring applications, consecutive message losses from a specific sensor node may result in missing of importance status change. This can be parameterized by the message inter-arrival time [Var06]. Our simulation is to investigate how much the proposed retransmission scheme improves those performance criteria, comparing with the basic split-merge scheme, or SM in short, which transmits and relays messages according to the shortest path routing scheme and discards the undelivered message. The first experiment measures the success ratio according to the validity interval of sensor messages. If the validity interval is 1.0, it means that the system can tolerate the delay up to 1 round. The result is shown in Figure 13, where the proposed scheme is plotted as BR to denote the buffered retransmission. In this experiment, the slot error rate is set to 0.1, distributing exponentially. It must be mentioned that the SM scheme has already improved the success ratio quite a lot over the conventional shortest path routing scheme, as shown in Subsection 4.1. The success ratio of the SM scheme is 85.8 %, regardless of the validity interval. The proposed scheme can benefit from the retry within the validity interval. The success ratio increases significantly along with the increase of the tolerance bound, reaching 95.2 % when the bound is 2.0. In this figure, the success ratio of the SM scheme remains constant, as it does not consider message retransmission.
0.96 0.95 0.94 0.93 0.92 0.91 0.9 0.89 0.88 0.87 0.86 0.85
"SM" "BR"
0
0.5
1 Validity interval
1.5
2
Fig. 13. Validity interval vs. success ratio
Figure 14 shows the effect of slot error rate to the success ratio when the validity interval is fixed to 1.0. Here again, the experiment measures the system-wide delivery ratio, equally counting the success ratio of all nodes irrespective of the hop distance from the controller. The success ratio indispensably decreases according to the increase of the slot error rate. However, even a single round tolerance bound can significantly improve the delivery ratio by up to 28.3 % when the slot error rate is 0.3. In case the error rate is high, long-hop communication is more affected, resulting in the overall perfor-
196
Junghoon Lee and Gyung-Leen Park
mance degradation. Anyway, Figure 14 indicates that the BR scheme enlarges the performance gap on the high slot error rate.
1 "SM" "BR"
0.95
Success ratio
0.9 0.85 0.8 0.75 0.7 0.65 0.6 0.55 0.5 0
0.05
0.1
0.15
0.2
0.25
0.3
Slot error rate
Fig. 14. Slot error rate vs. success ratio
The message inter-arrival time is defined as the difference of the arrival times of the two consecutive successfully delivered messages started from the same node. The message inter-arrival time is critical to the accuracy of the monitoring application. Without any transmission error, the inter-arrival time would be as large as 1 control round, as each node sends a sensor message to the controller once a round and the static schedule does not bring any delay jitter. Figure 15 plots the average message inter-arrival time according to the validity interval. The slot error rate is set to 0.1. For the 4 × 4 grid selected for the experiment, 48 slots constitute a single collection round after the slot allocation. For the node closer to the controller, the inter-arrival time must be short and stable, as its delivery success ratio is quite high. Oppositely, for the node many hops away from the controller, the inter-arrival time gets larger due to high message loss rate. One message loss can lead to the addition of 1 round to inter-arrival time. However, the retransmission scheme can make some inter-arrival time less than 1 round when the undelivered message is recovered, greatly enhancing the average message inter-arrival time. As shown in Figure 15, the inter-arrival time for the SM case is 61.6 slots, that is, about 1.28 rounds. The proposed scheme can reduce the average inter-arrival time by up to 59.1 slots when the validity interval is 2.0. Additionally, Figure 16 plots the effect of the slot error rate to the message inter-arrival time. In this experiment, the validity interval is set to 1.0. When the slot error rate is 0, the average inter-arrival time is 48 slots, which coincides with the number of slots in a single collection round. From this point, the interarrival time almost exponentially increases along with the increase of the slot error rate. For the small error rate, the improvement is not so significant. It
Design of a reliability enhancement scheme for the grid-style networks
197
Inter-arrival time (slot time)
64 62 60 58 56 54
"SM" "BR"
52 50 0
0.5
1 Validity interval
1.5
2
Fig. 15. Validity interval vs. inter-arrival time
is less than 0.6 slots until the error rate is 0.05. However, when the error rate approaches 0.3, the SM scheme suffers from the uncontrollable inter-arrival time. It reaches 123.5 slots. On the contrary, our scheme can reduce up to 20.5 slots. The slot error rate is very critical to the inter-arrival time.
Inter-arrival time (slot time)
130 "SM" "BR"
120 110 100 90 80 70 60 50 40 0
0.05
0.1 0.15 0.2 Slot error rate
0.25
0.3
Fig. 16. Slot error rate vs. inter-arrival time
Figure 17 plots the effect of grid dimension to the average message interarrival time. The slot error rate is set to 0.1 and the validity interval is set to 1.0 round. The experiment changes the grid dimension from 3 to 7. For a large grid dimension, the average number of hops for the end-to-end transmission also increases, reducing the delivery success ratio. The proposed scheme achieves the reduction of inter-arrival time by 1.0 %, 2.6 %, 5.6 %, 8.7 %, and 11.8 %, respectively, for each grid dimension of 3 through 7. This result indicates that for a larger grid, the improvement brought by the split-merge operation is already significant.
198
Junghoon Lee and Gyung-Leen Park
Inter-arrival time (slot time)
500 "SM" "BR"
450 400 350 300 250 200 150 100 50 0 3
3.5
4
4.5 5 5.5 Dimension
6
6.5
7
Fig. 17. Grid dimension vs. inter-arrival time
Maximum inter-arrival time (slot time)
Finally, Figure 18 shows the maximum inter-arrival time according to the slot error rate. This experiment also sets the validity interval 1.0 round on the 4 × 4 grid. Actually, it corresponds to the maximum inter-arrival time of the message from the node farthest away from the controller, namely, N3,3 in 4 × 4 grid. Compared with the average inter-arrival time case, the averagemaximum ratio is quite high, reaching up to 16.7 when the slot error rate is 0.29. Even though the proposed scheme can achieve the reduction of 34.2 % when the slot error rate is 0.3, the average-maximum ratio is still high. It is the problem to be solved as future work, especially paying attention to the fairness of the reception ratio among the sensor nodes.
1800
"SM" "BR"
1600 1400 1200 1000 800 600 400 200 0 0
0.05
0.2 0.15 0.1 Slot error rate
0.25
0.3
Fig. 18. Slot error rate vs. maximum inter-arrival time
Design of a reliability enhancement scheme for the grid-style networks
199
5 Concluding remarks Based on the WirelessHART standard and the split-merge operation, this paper has designed a robust message routing-scheduling scheme for the grid topology sensor network and measured its performance, mainly focusing on node or link failures. The grid topology wireless mesh network targets at the Manhattan-style traffic light network, where each traffic light acts as a sensor and actuator node, inviting a variety of vehicular applications. A virtual link model, taking a two-hop split-merge path as a single-hop link, can find the slot schedule that combines the primary and secondary paths to complement the inflexibility of the static slot assignment. It also copes with the topology change caused by a node or link failure by adjusting the error rate of specific links. Next, aiming at enhancing the message delivery ratio from the sensor node to the controller, a reliability enhancement scheme has been designed. Each node maintains a retry queue, not discarding the undelivered message as in the conventional standard. Through the slots to be wasted inevitably due to the slot error in a previous slot, the stored message is retransmitted. The simulation result, obtained by the extensive experiment using a discrete event scheduler, reveals that the proposed scheduling scheme can enhance the delivery success ratio by up to 10.9 % and operates robustly on node and link errors. In addition, the retransmission scheme can further improve the message delivery ratio by up to 29.4 % and reduce the message inter-arrival time by up to 4.2 % for the given experiment parameters. As future work, we are planning to design a retransmission policy capable of improving fairness, reducing the maximum inter-arrival time, and the like. In our current design, even the regular message transmission can be possibly suppressed to enhance fairness and give precedence to the urgent message undelivered and kept in the intermediate node.
References [Adi06]
Adibi, S., Erfanu, S.: A multipath routing survey for mobile ad-hoc networks. IEEE Consumer Communications and Networking Conference, 984–988 (2006) [Ahm10] Ahmadi, H., Abdelzaher, T., Gupta, I.: Congestion control for spatiotemporal data in cyber-physical systems. The 1st ACM/IEEE International Conference on Cyber-Physical Systems, 89–98 (2010) [Bah04] Bahl, P., Chandra, R., Dunagan, J.: SSCH: Slotted seeded channel hopping for capacity improvement in IEEE 802.11 ad-hoc wireless networks. Proc. of the 10th annual international conference on Mobile computing and networking, 216–230 (2004) [Buc07] Bucciol, P., Li, F., Fragoulis, N., Vandoni, L.: ADHOCSYS: Robust and Service-Oriented Wireless Mesh Networks to Bridge the Digital Divide. IEEE Globecom Workshops, 1–5 (2007)
200 [Cha07]
Junghoon Lee and Gyung-Leen Park
Chang, N., Liu, M.: Optimal channel probing and transmission scheduling for opportunistic spectrum access. ACM International conference on Mobile computing and networking, 27-38 (2007) [Che08] Chen, J., Chen, C., Jan, R., Li, R.: Expected link life time analysis in MANET under Manhattan grid mobility model. ACM Modeling, Analysis and Simulation of Wireless and Mobile Systems, 162–168 (2008) [Gis08] Gislason, D.: ZIGBEE Wireless Networking. Newnes (2008) [Han09] Han, S., Song, J., Zhu, X., Mok, A. K., Chen, D., Nixon, M., Pratt, W., Gondhalekar, V.: Wi-HTest: Compliance test suite for diagnosing devices in real-time WirelessHART network. The 15th IEEE Real-Time and Embedded Technology and Applications Symposium, 327–336 (2009) [HCF07] Hart Communication Foundation: Why WirelessHARTT M ? The Right Standard at the Right Time. available at http://www.hartcomm2.org, (2007) [IEC08] International Electrotechnical Commission: IEC/PAS 62591: Industrial communication networks - Fieldbus specifications - WirelessHART communication network and communication profile (2008) [Jaa05] Jaap, S., Bechler, M., Wolf, L.: Evaluation of routing protocols for vehicular ad hoc networks in city traffic scenarios. The 5th International Conference on Intelligent Transportation Systems Telecommunications (2005) [Kan10] Kandhalu, A., Lakshmanan, K., Rajkumar, R.: U-Connect: A low-latency energy-efficient asynchronous neighbor discovery protocol. International Conference on Information Processing in Sensor Networks. 350–361 (2010) [Kod05] Kodialam, M., Nandagopal, T.: Characterizing the capacity region in multi-radio multi-channel wireless mesh networks. ACM MobiCom, 73–87 (2005) [Lee10] Lee, J., Song, H., Mok, A. K.: Design of a reliable communication system for grid-style traffic control networks. The 16th IEEE Real-Time and Embedded Technology and Applications Symposium, 133–142 (2010) [Mac87] MacDougall, M.: Simulating Computer Systems: Techniques and Tools. MIT Press (1987) [Mul00] Muller, N.: Bluetooth Demystified. McGraw-Hill TELECOM (2000) [Ram07] Ramchandran, I., Roy, S.: Clear channel assessment in energy-constrained wideband wireless networks. IEEE Wireless Magazine, 70–78 (2007) [Son08] Song, J., Han, S., Mok, A. K., Chen, D., Nixon, M., Lucas, M., Pratt, W.: WirelessHART: Applying wireless technology in real-time industrial process control. The 14th IEEE Real-Time and Embedded Technology and Applications Symposium, 377–386 (2008) [Var06] Varga, P.: Analyzing Packet Interarrival Times Distribution to Detect Network Bottlenecks. IFIP International Federation for Information Processing, 17–29 (2006) [Wan07] Wang, W., Liu, X., Krishnaswamy, D.: Robust routing and scheduling in wireless mesh networks. IEEE Conference on Sensor, Mesh and Ad Hoc Communications and Networks, 471-480 (2008) [Zai08] Zaidi, Z., Landfeldt, B.: Monitoring assisted robust routing in wireless mesh networks. Mobile Network Applications, 54–66 (2008)
A Reliable Watchdog Protocol with Two-way Mutual Confirmation in Wireless Multi-Hop Networks Dongseung Shin1 and Dongkyun Kim2 and Jinwook Lee3 1
2
3
Kyungpook National University, 1370 Sankyuk-dong, Book-gu, Daegu 702-701, Republic of Korea.
[email protected] Kyungpook National University, 1370 Sankyuk-dong, Book-gu, Daegu 702-701, Republic of Korea.
[email protected] † Samsung Electronics, Co., Ltd., 416 Maetan-3dong, Yeongtong-gu, Suwon 443-742, Republic of Korea.
[email protected]
Summary. With the growth of wireless multi-hop ad hoc networks, the secure communication is challenging for the networks. Due to the broadcast nature of a radio wave, a data packet can be easily captured by unintended nodes. In addition, those unintended and malicious nodes can drop or modify the data packet. Hence, a watchdog protocol is required to handle those malicious attacks. In this paper, we therefore propose a reliable watchdog protocol at MAC layer, called two-way mutual confirmation (TWMC) watchdog protocol. In this protocol, a data packet is forwarded only if a watchdog node and a receiver node mutually confirm the data forwarding. Through ns-2 based simulations, it verified that the TWMC watchdog protocol significantly improves the misbehavior detection ratio as compared to an existing watchdog protocol. Due to using additional control frames, it however has a low throughput as a trade-off with the high detection of misbehavior.
1 Introduction With the growth of wireless multi-hop ad hoc networks, the interest in the security for the networks also increases. In the wireless multi-hop ad hoc networks, a data packet is delivered through multi-hop transmissions because the transmission range of each node is smaller than the distance between a source and destination nodes. In addition, due to the broadcast nature of the communication media (i.e., a radio wave), nodes have difficulty in communicating securely, that is, unintended nodes can easily overhear other nodes’ communications. This characteristic raises a security problem in wireless ad hoc networks and makes nodes suffer from the threat of attacks. †
Dongkyun Kim is the corresponding author.
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 11, © Springer Basel AG 2011
202
Dongseung Shin and Dongkyun Kim and Jinwook Lee
There are a lot of attacks in communication protocols, such as sniffing, DoS (Denial of Service), smurfing, spoofing, etc. In order to handle those problems, many researchers have proposed solutions such an authentication technique with a security key. However, other types of attacks, such as a data dropping and data modification in a misbehaving node, have appeared in wireless ad hoc networks [8]. The misbehaving node is usually called a malicious node or a selfish node. The data dropping is a kind of a DoS attack in which a misbehaving node refuses to forward a packet in order to save its energy or to disturb other nodes’ packet delivery. In addition, a malicious node might modify the packet with faking data. These attacks can be handled by monitoring the node’s proper forwarding. In order to cope with the aforementioned attacks, a lot of schemes have been proposed [4] [14] [8]. In [4] and [14], a previous hop node monitors a sender node’s proper forwarding to a receiver node of a sender node. If the previous hop node detects misbehaving of the sender node, it informs a source node of the misbehaving and the source node tries to find another path. In [8], the source establishes multiple paths and uses a primary path for data packet transmissions and other secondary paths for monitoring the packet delivery over the primary path. Among them, only [4] has considered the monitoring at the MAC layer and others at the network layer. In addition, [4] does not operate well if a collision occurs at a watchdog or a receiver node. In this paper, a new watchdog mechanism, called two-way mutual confirmation (TWMC) watchdog protocol, operating at the MAC layer is proposed. In this mechanism, when a source node tries to forward a data packet to a receiver node, a watchdog node notifies the sender of its monitoring. After the data transmission of the sender, the watchdog node requests the sender to reply with the confirmation of the successful reception at the receiver. The rest of paper is organized as follows. In Section 2, we review related works in research on detection of misbehaving nodes and address our motivation. In Section 3, we define our system model. We describe our TWMC in Section 4. Then the performance of the proposed protocol through the simulation study is evaluated in Section 5. Finally, concluding remarks with future works are given in Section 6.
2 Related Works There are many existing schemes which attempt to address misbehaving problems of selfish nodes for secure communications in wireless multi-hop networks. In [14], those schemes are classified into several categories. We partially revise such a classification with three categories: 1) Credit Based, 2) Reputation Based, and 3) Acknowledgement Based Schemes. Here, major characteristics of each category are described in brief.
Watchdog Protocol with Two-way Mutual Confirmation
203
2.1 Credit Based Schemes Credit based schemes belong to most representative protocols for the purpose of providing reliable networking services [1] [3] [2]. These schemes make use of a virtual payment mechanism to request for packet relaying services. In [1], both the packet purse model and packet trade model were proposed. The concept of money (called nuggets in those models) and service charge is introduced. Nodes which want to send a packet should be charged pay. Also, nodes which participate in forwarding the packet will be rewarded. Therefore, a selfish node has to forward packets from others because it cannot earn money if it refuses to forward the packets. In addition, a malicious node cannot try to perform a DoS attack because the cost of generating a lot of DoS attack packets is very expensive. However, the credit based schemes require additional overheads for maintaining such a payment system (e.g., control packets for purchase). 2.2 Reputation Based Schemes Reputation based schemes [4] [5] are considered as alternative solutions for selfish operations. In these schemes, each node on a routing path monitors whether its next hop node forwards the packet properly and manages the list of misbehaving nodes or unreliable paths. In [4], the concept of a watchdog and a pathrater is proposed. When a node transmits a packet, it becomes a watchdog node and it starts to monitor the proper transmissions of its next hop node. In order to monitor, the watchdog node listens for the transmission of its next hop node in its promiscuous mode. If the next hop node does not transmit in a given timeout or the sender transmits a modified data packet, the watchdog node detects the occurrence of a misbehaving. After that, it accuses the next hop node as a selfish node and updates the rate for the selfish node. Subsequently, a source node will have to choose an alternative path excluding the selfish node. CONFIDANT [5] aims for isolating misbehaving nodes which deny any cooperation. In CONFIDANT, a node monitors its neighbor nodes for checking whether a neighbor node behaves as a selfish node, by listening for the transmissions of the neighbor node. If the node detects a misbehaving node, it sends an ALARM message to all other nodes in the network. Then, all other nodes record the reputation for the misbehaving node and take a proper action such as re-routing. 2.3 Acknowledgement Based Schemes Some acknowledgement based approaches [6] [7] [8] were proposed to detect selfish nodes. They try to identify the correct reception of data packets which are transmitted from the original sender by using an end-to-end or hop-by-hop acknowledgement packet.
204
Dongseung Shin and Dongkyun Kim and Jinwook Lee
In ODSR (On-Demand Secure Routing) [6], it is assumed that only source and destination nodes are trusted. In ODSR, the secured routing is guaranteed through three steps: 1) route discovery with fault avoidance, 2) byzantine fault detection, and 3) link weight management. The source finds multiple paths towards the destination node. During transmissions of data packets, the source receives an acknowledgement corresponding to each transmitted data packet. If the source does not receive an acknowledgement, it sets the link weight for the path. Other paths are found and used when the link weight is below a threshold. In MARS [8], multiple paths are used to detect a misbehaving node. A source node transmits a data packet on the shortest path and an INF message on another path. If the data packet does not arrive at the destination node while the INF message successfully arrived at the destination node, the destination detects that there exists at least one misbehaving node on the shortest path and informs the source of the unreliability of the shortest path. 2ACK [14] requires an acknowledgement from a two-hop neighbor node on a path between source and destination nodes. A sender node (say, S) receives an acknowledgement from its next hop node (say, N 1) when it forwards a data packet. In addition, it waits for an acknowledgement from its two-hop neighbor node (say, N 2). If N 1 forwards the data packet to N 2 normally, N 2 will response with an acknowledgement to S. Therefore, if S receives an acknowledgement from N 2, it is confirmed that the data packet is successfully forwarded. 2.4 Our Classification In this paper, those researches handling misbehaving problems are classified according to a layer at which the detection of misbehaving takes place. Hence, following classes have been defined as: 1) network layer schemes, 2) upper layer schemes, and 3) MAC layer schemes. The network layer schemes detect a misbehaving in the network layer. They exchange specific control messages such as an acknowledgement in order to find a misbehaving node on a path between source and destination nodes. 2ACK [14], ODSR [6] and MARS [8] belong to the network layer schemes. In the upper layer level schemes, the secure operations take place at an upper layer of the network layer. Hence, transport protocols or applications are responsible to the secure communications. The packet purse model and packet trade model [1] can be classified into the network layer scheme because the payment mechanism might be implemented in applications. The MAC layer schemes detect a misbehaving by monitoring other’s transmissions. In these schemes, a node delivers a packet to its next hop node. The node monitors the channel and overhears the next hop node’s transmissions in its promiscuous mode. The node detects the misbehaving if the next hop node does not forward the packet or forwards a modified packet. Upon detecting the misbehaving a node sends an alarm to an upper layer (e.g. a routing
Watchdog Protocol with Two-way Mutual Confirmation
205
protocol in the network layer). Watchdog/Pathrater [4] and CONFIDANT [5] belong to these schemes. If the applications have to be responsible for the reliable communication, all applications will suffer from designing the secure mechanism. On the other hand, if the misbehaving detection mechanism is implemented in the MAC layer, protocols in upper layers can be more transparent and have less burden for the reliability. Therefore, an attention is payed to the MAC layer schemes such as the watchdog mechanism in [4]. However, the watchdog mechanism has some weaknesses of ambiguous collisions and receiver collisions [4]. From Figure 1, consider that nodes A, B, and C are a watchdog, sender and receiver nodes, respectively. Node B just forwards a data packet to node C but node A fails to monitor the forwarding due to a disturbance from node S. Also, from Figure 2, node A succeeds in monitoring the forwarding of node B but node C fails to receive the data packet due to the interference from node D.
S
A
B
C
D
Fig. 1. Ambiguous collision
S
A
B
C
D
Fig. 2. Receiver collision
These collisions hamper the proper operations of watchdog processes. Therefore, the TWMC (two-way mutual confirmation) watchdog protocol is proposed in order to address this problem by mutual confirmation of a watchdog node and a receiver node.
3 802.11 Mechanism and System Model The TWMC watchdog protocol runs on top of 802.11 MAC protocol [11]. In this section, 802.11 DCF mechanism is presented, followed by the description of our supposed network model. 3.1 802.11 DCF Mechanism The 802.11 DCF standard [11] is one of CSMA/CA-based MAC protocols with an RTS/CTS/DATA/ACK exchange in its DCF mode (see Figure 3).
206
Dongseung Shin and Dongkyun Kim and Jinwook Lee
In addition, it has a NAV (Network Allocation Vector) setting mechanism as virtual sensing technique. Sender
RTS
DATA ACK
CTS
Receiver
DIFS
Contention Window
NAV(RTS) NAV(CTS)
Other SIFS
SIFS
SIFS
SlotTime
Fig. 3. RTS/CTS/DATA/ACK and NAV setting in 802.11
First, a sender sends an RTS in order to inform its neighbor nodes including a receiver node of the sender’s transmission. Likewise, the receiver sends a CTS in order to ask its neighbors not to disturb their communication. The RTS and CTS frames contain a duration which indicates the time remained till completing their communication. The duration is denoted by N AVRT S and N AVCT S for the RTS and CTS, respectively. All nodes receiving the RTS or CTS set their own NAV values to N AVRT S or N AVCT S and become silent for the duration of NAV values. N AVRT S and N AVCT S are determined according to Equation 1.
N AVRT S = 3 · SIF S + CT ST ime + DAT AT ime + ACKT ime N AVCT S = 2 · SIF S + DAT AT ime + ACKT ime
(1)
After exchanging the RTS and CTS frames, the sender sends its DATA frame to the receiver. If the receiver receives the DATA frame successfully, it replies with an ACK to the sender. At the end of the transmission, all nodes wait for DIFS and defer their transmission during a contention window in order to avoid a collision caused by the contention to a wireless medium. In 802.11 DCF, an IFS (Inter Frame Space) value is introduced between transmissions of frames in order to avoid such a collision among frames. SIFS (short IFS) and DIFS (DCF IFS) are shown in Figure 3 as an example. SIFS is the small time interval between frames. On the other hand, DIFS is the time taken to decide that the wireless medium is idle and start to access the medium. Each of IFS values is summarized in Table 1 according to the 802.11a specification. The relationships between IFS values are shown in Figure 4. 3.2 System Model For simplicity of explanation, we suppose a network model as in Figure 5. All nodes are stationary so that no packet loss occurs due to their mobility. A
Watchdog Protocol with Two-way Mutual Confirmation
207
DIFS PIFS SIFS
Slot Time
First Backoff Slot
Medium Busy D1
Rx/Tx M1
D2
D2 CCAdel
D2 CCAdel
M2
CCAdel M2
Rx/Tx D1 = aRxRFDelay + aRxPLCPDelay D2 = D1 + Air Propagation Time
M2 Rx/Tx
Rx/Tx
Rx/Tx = aRXTXTurnaroundTime M1 = M2 = aMACPrcDelay
CCAdel = aCCATime − D1
Fig. 4. Timing relationships in 802.11 Table 1. IEEE 802.11 IFS values
Characteristics Tslot SIF S DIF S
Value 9μs 16μs 34μs
Definition Slot time SIFS time DIFS = SIFS + 2 × Slot time
node communicates directly only with other nodes which are situated within its omni-directional transmission range R, and it communicates indirectly with nodes which are out of R. In addition, it is assumed that there exists no channel error in their communications. A sender s received a data packet from a watchdog node w and forwards it to a receiver r. In addition, node w and node r are not in the transmission range R of each other. The notations that were used for network model are summarized in Table 2.
Ns-r-w
R Nw-s
w
s
r
d(w,s)
Ns+w
Ns+r Ns-r-w
Fig. 5. Network model
Nr-s
208
Dongseung Shin and Dongkyun Kim and Jinwook Lee Table 2. Notations used in this work
Notation Description s r w Na Na−b Na+b R D(a,b) Tf rame
a sender node a receiver node a watchdog node a set of the neighbor nodes of the node a, e.g., Ns is all the neighbor nodes of the sender a set of the neighbor nodes of the node a except the neighbor nodes of b a set of the neighbor nodes of nodes a and b the transmission range the distance between nodes a and b the time duration that a frame is transmitted
4 Two-way Mutual Confirmation Watchdog Protocol 4.1 Goals and Assumptions The goal of this watchdog mechanism is to confirm whether s forwards an exact copy of the packet under mutual confirmations of w and r and the operations should take place at the MAC layer. This means that the watchdog node can not only capture every relaying packet of its neighbor but also examine whether the neighbor is a misbehaving node. To achieve this goal, an existing IEEE 802.11 MAC protocol [11] is tailored with three fundamental rules; Mutual Confirmation, Reliable Communication, and Simultaneous Reception. Mutual Confirmation In fact, w does not care about the packet reception of r because they are out of their transmission range. Therefore, they mutually confirm that w monitored the successful forwarding of s and also confirm that r successfully received a data packet from s. If the mutual confirmation fails, w reports the misbehaving to a source node and the data packet will not be forwarded anymore. Reliable Communication The watchdog process can be successful only if the three players (i.e. w, s, and r) properly perform their expected works and no communication fails. Therefore, the collision problems described in Section II should be solved for the reliability of watchdog protocol. In this mechanism, a clear to send (CTS) frame and an acknowledgement frame are used to achieve reliable communication. Simultaneous Reception In order to guarantee proper operations of the TWMC watchdog protocol, w and r should be enabled to receive the same data packet transmitted by s. If s controls its transmission power, either w or r might not
Watchdog Protocol with Two-way Mutual Confirmation
209
receive the packet. Therefore, s should keep its transmission power to reach both w and r. From above rules, some assumptions are made. It is first assumed that the misbehaving takes place at the network layer and the MAC layer always operates properly. Since many researches handle misbehaviors in the network layer and they do not consider those in the MAC layer, it is believed that such assumptions are reasonable. The channel is error free and the transmission power is fixed. In addition, since this scheme runs on top of a MAC protocol, a static routing is used in order to provide a path which is already set-up between the source and destination nodes. 4.2 Operations In the TWMC watchdog protocol, each node maintains a table for transmitted data packets (denoted by T X T ABLE). When w delivers a data packet to its next hop node, w is aware of s from its routing table. Then, w adds a pair of the data packet, the MAC address of s, a misbehaving counter into its T X T ABLE. The misbehaving counter indicates the number of misbehavings of s and the value is initially set to 0. When the medium is idle, s prepares to forward a data packet. Before forwarding the data packet, s broadcasts a wRTS frame to its neighbors. Upon receiving the wRTS frame, r first replies to s with a wCTS frame in order to notify its readiness to receive. After replying of r, w also replies to s with a wCTS frame in order to notify its readiness to monitor. If s receives wCTS frames from both w and r, s transmits a data frame to w and r. Otherwise, s restarts to transmit a wRTS frame repeatedly up to predefined retransmission count. Both of w and r receive (or overhear) the data frame. Upon receiving the data frame, r replies to s with a wACK frame in order to notify its successful reception. On the other hand, upon overhearing the data frame, w first checks the overheard data packet with the original data packet in its T X T ABLE. If both data packets are the same, w confirms the proper forwarding of s and it replies to s with a wACK frame in order to notify its successful confirmation of the forwarding of s. Otherwise w increases the misbehaving counter for s. If the misbehaving counter exceeds a predefined threshold value, w considers that s is the misbehaving node and finally may perform further operations such as reporting to upper layer, making penalty and etc. However, these further operations are out of scope of this paper and will be left for future works. After s receives wACK frames from both of w and r, s finally transmits a wCFM frame to w and r. Upon receiving the wCFM frame, r forwards the received data packet to its next hop node, and w finally confirms the successful forwarding of s and the successful reception of r. If w cannot receive the wCFM frame, it also increases the misbehaving counter and does corresponding operations.
210
Dongseung Shin and Dongkyun Kim and Jinwook Lee
The operations are illustrated in Figure 6.
Nw-s
s
w wRTS
r
Nr-s
wRTS wCTS
wCTS
DATA DATA
wACK wACK wCFM
wCFM
Fig. 6. Sequence of exchanging frames
4.3 Frame Structures As mentioned before, the TWMC watchdog protocol is a tailored version of IEEE 802.11 MAC protocol. Four control frames of wRTS, wCTS, wACK, and wCFM and one DATA frame are defined. Each control frame has a similar structure to those of IEEE 802.11 MAC protocol. In general, the routing table at the network layer maintains the network address of neighbor nodes. However, since this watchdog mechanism operates at the MAC layer, the network address of a node is not applicable to the TWMC watchdog protocol. Thus, control frames related to w should keep track of the MAC address of w. Upon receiving any type of frames, a node updates its lists. Therefore, a watchdog address field is added into wRTS and wCFM frames. The structure of control frames is shown in Figure 7. The wCTS and wACK frames are not modified from the original CTS/ACK frame. Although the intended receiver of a wRTS frame is r, w should participate in the communication as a watchdog node. Hence, s first broadcasts a wRTS frame including the MAC address of r and w. Upon receiving the wRTS, r and
Watchdog Protocol with Two-way Mutual Confirmation
211
w become aware that w is the watchdog node of the communication. After then, they reply with their wCTS frame. Similar to the wRTS frame, s transmits a wCFM frame with the MAC address of r and w in order to notify the result of the communication. Octets : wRTS & wCFM
2 Frame Control
Octets : wCTS & wACK
2
2 Duration
2
Frame Control
Duration
6 Receiver Address 6 Receiver Address
6 Watchdog Address
6 Transmitter Address
4 FCS
4 FCS
Fig. 7. Structures of control frames
4.4 Setting NAV Now, how to update NAV (network allocation vector) will be explained. The communication of s, r, and w must be protected from interferences. Hence, neighbor nodes of s, r, and w, (e.g. Ns , Nr and Nw ) should defer their transmission while the communication of s, r, and w is in progress. Since the TWMC watchdog protocol uses additional control frames as compared to IEEE 802.11, the formula for NAV should be redefined. The formula of NAV is defined for each control frame (see Equation 2). Note that TwCT S and TwACK are equal because the size of those frames is the same. ⎧ ⎨ N AVwRT S = 6 · SIF S + 4 · TwCT S + TDAT A + TwCF M N AVwCT S (r) = 5 · SIF S + 3 · TwCT S + TDAT A + TwCF M ⎩ N AVwCT S (w) = 4 · SIF S + 2 · TwCT S + TDAT A + TwCF M
(2)
Since nodes Ns are in the transmission range of node s, nodes Ns except nodes r and w defer their transmission with N AVwRT S after receiving a wRTS frame. Similarly, since nodes Nr are within the transmission range of r, they update their NAV to N AVwCT S (r). Also, nodes Nw update their NAV to N AVwCT S (w). After setting NAV, Ns , Nr and Nw will defer their transmissions with their NAV values. The timing relation is also illustrated in Figure 8. 4.5 Discussions The TWMC watchdog protocol can detect a single misbehaving node through the mutual confirmation of r and w. However, there might be two or more
Fig. 8. Timing relation
Nw
Nr
Ns
w
r
s
time
DIFS
SIFS
wRTS
TwRTS
wCTS
TwCTS
wCTS
wACK
TwACK
NAV(4 · SIFS + TwRTS + 2 · TwCTS + TDATA)
NAV(5 · SIFS + TwRTS + 3 · TwCTS + TDATA)
NAV(6 · SIFS + TwRTS + 4 · TwCTS + TDATA)
DATA
TDATA
wACK
wCFM
TwCFM
212 Dongseung Shin and Dongkyun Kim and Jinwook Lee
Watchdog Protocol with Two-way Mutual Confirmation
213
misbehaving nodes in the network. Moreover, they might be adjacent neighbor nodes of each other and co-operate in collaborative misbehaving. In this section, the problem of two adjacent misbehaving nodes is described.
N2 S
N3
N4
N1
D M1
N5
N6
M2
FD
Fig. 9. Example of two adjacent misbehaving nodes
Figure 9 illustrates an example of two adjacent misbehaving nodes, M 1 and M 2. From the figure, a route with S − N 1 − N 2 − N 3 − N 4 − D is a correct route towards the destination node D. Even though a route with S − N 1 − M 1 − N 5 − N 6 − D is chosen, many schemes like [13] [14] [4] can detect the misbehaving node. These schemes utilize DSR [10] as their underlying routing protocol. In DSR, all intermediate nodes are recorded in a data packet. Hence, they can monitor whether or not a node normally forwards the data packet to its next hop node. However, M 1 might generate a false route reply message which contains M 1 and M 2 as consecutive intermediate nodes on a path. They cheat the source node into accepting the false route with S − N 1 − M 1 − M 2 − F D towards the false destination node F D. Hence, the source node S confuses the best route because the false route reply message might have a lower cost (e.g., hop distance) than other normal route reply messages. Therefore, the source node might choose the false route reply message and transmits data packets through the false path. In this case, when a data packet is transmitted, M 1 forwards the packet to M 2 but M 2 drops the packet. Schemes in [13] [14] [4] cannot detect such the misbehaving because M 1 operates as a normal node and those schemes cannot monitor the operations of two-hop neighbor node (i.e. M 2). In [14], although a node is allowed to receive an acknowledgement from M 2 for reliability, M 1 might generate a false acknowledgement from M 2. In order to handle this problem, 2ACK [14] was proposed to use a digital signature algorithm. However, the algorithm requires computational overheads which are very expensive for mobile nodes. In MARS [8], multiple paths are utilized in order to cope with this problem. Even though misbehaving nodes on a path might drop data packets, the source node can detect the
214
Dongseung Shin and Dongkyun Kim and Jinwook Lee
existence of a misbehaving node on the path because the destination node transmits a confirmation message through other paths. However, MARS allows only the existence of the misbehaving node to be known. It cannot identify the misbehaving node. As assumed in Section 4.1, misbehaving does not take place at the MAC layer. Unlike other schemes which aim for handling misbehaving at network or upper layers, this scheme operates at the MAC layer. Therefore, this scheme is more reliable than other schemes with respect to the detection ratio of misbehaving nodes. However, if misbehaving still occurs at the MAC layer, this scheme also fails to detect the misbehaving in case that M 1 can send a wCFM frame to N 1 with a fake confirmation of M 2. It is assumed the static routing protocol as the underlying routing protocol. Hence, each node on a path knows its next hop node towards the destination node. However, the TWMC watchdog protocol cannot respond to the above-mentioned problem properly because a node cannot obtain its two-hop neighbor node information easily. In order to handle these problems, a specific routing protocol needs to support the TWMC watchdog protocol. The development of the routing protocol is out of the scope of this paper. It will remain as a future work.
5 Performance Evaluation 5.1 Simulation Environments In this section, the TWMC watchdog protocol was evaluated using a network simulator. For the confidence evaluation, a numerical analysis is required. However, this research focuses on the detection of a misbehaving node at the MAC layer and the further operations (e.g., post processing the detected misbehaving) of an upper layer is not considered. Therefore, the numerical and comparative analysis remains for future works. In this work, the performance in throughput, misbehavior detection, delivery ratio and end-to-end delay with an existing watchdog protocol were simply compared. The TWMC watchdog protocol with a static routing protocol was implemented in the popular ns-2 simulator [12]. For comparative study, an existing watchdog protocol (denoted by WD) proposed in [4] was also implemented by tailoring IEEE 802.11 protocol (The pathrater protocol was not implemented because it was out of this paper’s considerations). A 5-hop chain topology with 6 nodes as in Figure 10 was constructed. On the path between the source node S and the destination node D, the third node M was assumed as a misbehaving node which intended to drop a data packet. The bandwidth was set to 2Mbps and the source node periodically generated the data traffic of 128 bytes in size. Other simulation parameters are summarized in Table 3.
Watchdog Protocol with Two-way Mutual Confirmation
215
M S
D Fig. 10. Chain topology Table 3. Simulation parameters
Parameter
Value
Distance between nodes 200m Data packet size 128 bytes Data traffic from 20 to 100 packets per second Packet drop rate of a misbehaving node 0 to 30% Routing protocol static routing Transport protocol UDP Simulation duration 60 seconds
5.2 Simulation Results and Analysis The traffic load of 100 packets per second was first set and then measured the performance in misbehavior detection with various packet drop rates (i.e. the packet drop probability of the misbehaving node). Figure 11 shows the number of dropped packets in a misbehaving node, and the number of misbehavior detections of the TWMC and WD. From Figure 11, the TWMC and WD have a lot of misbehavior detections more than the real number of dropped packets. Due to ambiguous collisions, WD has a low detection ratio of the misbehaviors. In many cases, a watchdog node fails to detect the misbehaviors due to collisions. Hence, WD shows a lot of false detections even though the misbehaving node properly forwarded packets. In contrast, the TWMC has less false detections than WD, because a receiver forwards packets only through mutual confirmation with a watchdog node. However, it is observed that the TWMC has some performance degradation in throughput (i.e. the number of received packets at a destination node). As shown in Figure 12, WD shows better performance than TWMC. Although the mutual confirmation contributes to the detection of misbehaviors, it produces a low throughput because a packet will not be forwarded without the confirmation. On the contrast, WD shows a high throughput because unconfirmed packets can be forwarded without the confirmation. The delivery ratio and end-to-end delay with various traffic loads from 20 to 100 packets per second were also measured. In this simulation, no misbehaving node was assumed. As shown in Figures 13 and 14, when the traffic load is low, the TWMC and WD show the same performance because mutual confirmations and collisions do not affect the communications. However, as the traffic load is larger, the performance of the TWMC decreases severely. The cause of the severe degra-
Dongseung Shin and Dongkyun Kim and Jinwook Lee The number of Misbehavior Detections
216
2500
TWMC WD Dropped Data
2000 1500 1000 500 0 0
10
20
30
Drop Rate (%)
Fig. 11. The number of misbehavior detections
The number of Received Packets
3000
TWMC WD
2000
1000
0 0
10
20
30
Drop Rate (%)
Fig. 12. The number of received packets
dation was investigated and it was found that the exposed terminal problem to a watchdog node occurred frequently. The exposed terminal problem is a phenomenon where a node is unnecessarily prevented from transmitting a packet due to communications of its neighbor nodes. In other words, the watchdog node cannot reply with wCTS frames because it is interrupted by its neighbors. On the contrast, only the receiver node is affected by the exposed terminal problem in WD. From Figure 15, s tries to transmit a data packet to r. When s transmits a wRTS frame, r and w have to reply with their wCTS frame. However, a node n which is a neighbor node might hinder w from replying a wCTS to s. For example, n might broadcast a wRTS in order to send its data packet to w. Then, w might reply with a wCTS to n, not s. For another example, as shown
Watchdog Protocol with Two-way Mutual Confirmation 120
TWMC WD
100 Delivery Ratio (%)
217
80 60 40 20 0 20
40
60
80
100
80
100
Load (packets / second)
Fig. 13. Delivery ratio
End-to-End Delay (second)
12
TWMC WD
9
6
3
0 20
40 60 Load (packets / second)
Fig. 14. End-to-end delay
in Figure 16, n replies with a wCTS in order to receive a data packet from m. In this case, w will become silent not to hamper the transmission between n and m. Due to these reasons, w will not properly reply with a wCTS to s. In fact, the TWMC watchdog protocol cannot avoid the performance degradation. However, since the malicious attack might raise severe problems in the networks, it is of the utmost importance to guarantee reliable communications with an acceptable level of performance degradation. Therefore, it is reasonable that the reliable communication and the performance degradation have their trade-off relations. The balanced points should be found with more research.
218
Dongseung Shin and Dongkyun Kim and Jinwook Lee
m
n
w
s
wRTS
r
wCTS
Fig. 15. Exposed terminal problem: scenario 1
m
n
w
wRTS
s
r
wCTS
Fig. 16. Exposed terminal problem: scenario 2
The delivery ratio and end-to-end delay in a 7 x 7 grid topology as in Figure 17 were also measured. In this topology, there were two data flows. No misbehaving node was assumed as well. As shown in Figures 18 and 19, the performance is worse, compared to that in the chain topology. The two flows cross each other so that a congestion may occur at the center node O. This therefore leads to the decreased performance for both of TWMC and WD. This performance degradation may not be desirable in a network where an adequate throughput is required. It seems that the exposed terminal problem occurs at a watchdog node because the backoff mechanism was not considered. In order to allow a watchdog node to properly reply with a wCTS, neighbor nodes should defer their transmissions for a longer time than in 802.11. The research of elaborating the backoff mechanism will be left for future works.
6 Conclusion In this paper, a reliable watchdog protocol to detect misbehaving nodes, called two-way mutual confirmation (TWMC) watchdog protocol was proposed.
Watchdog Protocol with Two-way Mutual Confirmation
219
Flow 1 S1
S2
O D2
Flow 2
D1
Fig. 17. Grid topology 120
TWMC WD
Delivery ratio (%)
100 80 60 40 20 0 20
40
60
80
100
Load (packets / second)
Fig. 18. Delivery ratio in the grid topology
In this protocol, not only a watchdog node but also a receiver node mutually confirms the data forwarding. When a source node forwards a data packet to the receiver, a watchdog node notifies the sender of its monitoring. After the transmission of the sender, the receiver node acknowledges its successful reception of the packet to the watchdog node. Finally, the watchdog and receiver nodes confirm the successful data forwarding and the receiver forwards the data packet to its next hop node. From ns-2 based simulation study, it was observed that the TWMC watchdog protocol significantly improves the detection ratio of misbehaviors. The
220
Dongseung Shin and Dongkyun Kim and Jinwook Lee
End-to-End delay (second)
18 15
TWMC WD
12 9 6 3 0 20
40
60
80
100
Load (packets / second)
Fig. 19. End-to-end delay in the grid topology
performance degradation of throughput and delay is unavoidable due to the exposed terminal problem especially when a traffic load is high. This is a trade-off relation. For the perfect operations of this protocol, a specific routing protocol which properly handles such misbehaving reports is required. In addition, an efficient backoff mechanism is required in order to improve the performance of the TWMC watchdog protocol. The development of such a routing protocol as well as the backoff mechanism which can support the TWMC watchdog protocol is planned. It is also necessary to numerically analyze the performance of the TWMC watchdog protocol in our future works.
Acknowledgement Authors are gratefully acknowledging the financial support by Defense Acquisition Program Administration and Agency for Defense Development under the contract UD100002KD.
References 1. Buttyan, L., Hubaux, J.-P.: Enforcing Service Availability in Mobile AdHoc WANs. IEEE MobiHoc (2000) 2. Hubaux, J.-P., Gross, T., LeBoudec, J.-Y., Vetterli, M.: Toward SelfOrganized Mobile Ad Hoc Networks: The Terminodes Project. IEEE Comm. Magazine (2001) 3. Jakobsson, M., Hubaux, J.-P., Buttyan, L.: A Micropayment Scheme Encouraging Collaboration in Multi-Hop Cellular Networks. Financial Cryptography Conference (2003)
Watchdog Protocol with Two-way Mutual Confirmation
221
4. Marti, S., Giuli, T., Lai, K., Baker, M.: Mitigating Routing Misbehavior in Mobile Ad Hoc Networks. MobiCom (2000) 5. Buchegger, S., Le Boudec, J.-Y.: Performance Analysis of the CONFIDANT Protocol: Cooperation of Nodes, Fairness in Dynamic Ad-Hoc Networks. MobiCom (2002) 6. Awerbuch, B., Holmer, D., Rotaru, C.-N., Rubens, H.: An On-Demand Secure Routing Protocol Resilient to Byzantine Failures. ACM Workshop Wireless Security (WiSe) (2002) 7. Xue, Y., Nahrstedt, K.: Providing Fault-Tolerant Ad-Hoc Routing Service in Adversarial Environments. Wireless Personal Comm., vol. 29, no. 3-4, pp. 367-388 (2004) 8. Zaho, L., Delgado-Frias, J. G.: MARS: Misbehavior Detection in Ad Hoc Networks. IEEE GLOBECOM (2007) 9. Perkins, C. E., Royer, E. M.: Ad-hoc On-Demand Distance Vector Routing. Second IEEE Workshop on Mobile Computer Systems and Applications (1999) 10. Johnson, D., Maltz, D.: Dynamic source routing in ad hoc wireless networks. Mobile Computing, pp. 153-181 (1996) 11. IEEE: Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) specifications. (2003). 12. McCanne, S., Floyd, S.: NS network simulator. URL: http://www.isi.edu/nsnam/ns (2010) 13. Balakrishnan, K., Deng, J., Varshney, P.K.: TWOACK: Preventing Selfishness in Mobile Ad Hoc Networks. IEEE Wireless Communcation and Networking (WCNC) (2005) 14. Liu, K., Deng, J., Varshney, P. K., Balakrishnan, K.: An Acknowledgement-Based Approach for the Detection of Routing Misbehavior in MANETs. IEEE Transactions on Mobile Computing, vol.6, no.5, (2007)
Energy Efficient Power Management for Multi-Mode Wireless Network Devices Bongjae Kim1 , Boncheol Gu2 , Jeongki Kim3 , Chaedeok Lim4 , and Jiman Hong5∗ 1
2
3 4 5
School of Computer Science and Engineering, Seoul National University, Korea
[email protected] School of Computer Science and Engineering, Seoul National University, Korea
[email protected] Embedded Software Research Dept., ETRI, Korea
[email protected] Embedded Software Research Dept., ETRI, Korea
[email protected] School of Computing, Soongsil University, Korea
[email protected]
Summary. In this paper, we analyze the network status of multi-mode wireless network devices with two different network communication modules using the Markov process. Power management is very important in wireless network devices with multiple network communication modules. We analyze the energy consumption rate of network devices according to the variation of network detection interval. We derive the optimal network detection interval by using the probabilistic analysis according to the state transition rate of networks and the energy consumption rate of network modules. We propose a heuristic network detection scheme that dynamically adjusts the network detection interval. We evaluated our scheme via simulation. The simulation results show that the energy consumption of our scheme is almost the same as that consumed in the optimal case under certain conditions.
1 Introduction The multi-mode wireless network device with multiple network communication modules in a single network device has received much attention because it can improve the quality of communication services [1] [2]. For example, most smart phones today support one or more wireless modules for data transfer such as 3G, GSM, WiBro and Wi-Fi [3] [4] [5] [6]. During network communication, changes in the availability or characteristics of an access network may result in a situation where already established network connections should to be moved from one network interface to another network interface [7] [8] [9] [10] [11]. Users can maintain the best internet connection according to network environment changes by using 3G, GSM and Wi∗
Corresponding author
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 12, © Springer Basel AG 2011
224
Bongjae Kim et al.
Fi. Most mobile handheld devices, such as smart phones, are battery operated [13] [14] [15]. For wireless mobile internet users the length of the battery life is one of the most important factors. Most mobile handheld devices have limited battery life. For example, smart phones have 1000 mA − 1500 mA lithium-ion battery. Because mobile devices are dependent on their battery power, it is important to minimize their energy consumption. The energy consumed by network interface can be significant, especially for smaller network devices [16] [17] [18] [19] [20]. If we simultaneously use multiple wireless devices, then energy consumption increases and battery life is reduced [21]. Therefore, energy consumption should be optimized. Generally, the energy consumption of network detection, idle, and data receiving/transmitting is almost the same across wireless communication modules [22] [23]. If the network device is located outside the scope, then it is important to switch the network communication module to sleep mode, and it is important to detect the network status per appropriate interval after switching to wake-up mode. We can improve energy efficiency by using the above-mentioned mechanism. However, it is hard to find the optimal detection interval when using this mechanism. In this paper, we analyze the average energy consumption per time unit of wireless network devices with dual network modules according to network detection interval. Based on the results, we obtain a optimal network detection interval that minimizes the average energy consumption per unit of time. Generally, too short a network detection interval will consume a lot of energy because network detection cost is increased. Therefore, an energy efficient power management scheme is required for network detection. If we know the exact environmental changes of a network, then we can obtain optimal energy consumption for data communication. However, we do not exactly know the changes in real world. We propose the heuristic network detection scheme for minimizing energy consumption. Our scheme dynamically adjusts the network detection interval by approximating the previous activation patterns of the network. We present the simulation results to show the efficiency of our scheme in terms of energy consumption. The simulation results show good performance compared with that of the optimal case. The energy consumption of our scheme is almost the same as that consumed in the optimal case under certain conditions. The rest of this paper is organized as follows. Section 2 explains some related works. Section 3 explains energy efficient power management. In section 4, we present the simulation results. Finally, we conclude this paper in section 5.
Energy Efficient Power Management
225
2 Related Works There have been many research efforts to reduce energy consumption in multimode wireless network devices by selecting a more energy efficient network interface. In [7], J. Ylitalo et al. introduced an architecture that allows a user to dynamically create and modify interface selection policies, and thus control how the network interfaces are used in a multihoming environment. This architecture makes it possible to define policies for different connections. In [8], M. Nam et al. proposed WISE. WISE adaptively selects a more energy-efficient network interface. WISE takes into consideration only the energy consumption of each NIC, but it also considers the network throughput. In [9], M. Z. Chowdhury et al. proposed some new functionality in MIH(Media Independent Handover) to save power. The current battery power level has been considered as the interface selection parameter. For a lower battery level environment, the MN(Mobile Node) will select an interface that consumes less power. M. Z. Chowdhury et al. also considered QoS and QoE levels. In [10], F. Juanjuan et al. proposed the Autonomic Interface Selection Architecture (AISA). ASIA selects a servicing interface dynamically and automatically for every application by using network interface decision policies. Also, ASIS can sense and interpret changes in the network. In [11], J. Puttonen et al. proposed a solution for intelligent network interface selection and vertical handover control for heterogeneous multi-access environments. The vertical handover controller system in this solution, called VERHO, utilizes input from several cross-layer sources, the Mobile IPv6 protocol and network interface selection to achieve both proactive and intelligent vertical handovers between a variety of network interfaces. Network interface selection algorithms provide flexibility in interface selection. In [12], J. Bonnin et al. proposed the profiles management mechanism associated with an adaptable and reconfigurable middleware for supporting multiple network interfaces. The proposed middleware takes into account preferences given by the owner, the users, and the applications. The proposed middleware includes adaptation mechanisms and relies on profiles handling to feed the handover decision algorithm. But, these works only concentrated on reducing energy consumption for multi-mode wireless network devices and did not consider the network detection interval for network detection. It also very important issue to reduce energy consumption. In this paper, we focus on the network detection interval to reduce energy consumption.
226
Bongjae Kim et al.
Ȝ
0(off)
1(on)
ȝ Fig. 1. State Transition Diagram of Primary Network(PN)
3 Energy Efficient Power Management 3.1 System Model A multi-mode wireless network device can communicate through PN(Primary Network) module and AN(Alternative Network) module for data communication. We assume that PN is the first approach for network communication because energy consumption is smaller than that of AN, but PN’s network coverage is smaller than that of AN. The use of PN is restrictive. On the other hand, we assume that AN’s energy consumption is bigger than PN’s energy consumption because AN has wide network coverage. We assume that PN can be used anywhere, anytime for network communication because PN’s network coverage is wide. We assume that PN’s status is either available state(on state) or not available state(off state) as time passes. Figure 1 shows the state transition diagram of PN via the Markov process [24] [25]. The activation rate of PN is λ. The deactivation rate of PN is μ. We can present the situation that a mobile user moves randomly with the network devices by using this model. Figure 2 shows PN’s status changes and the use patterns of the network by the network detection interval. When PN is changed from on state to off state, the network device causes the PN module to change the mode from wake-up mode to sleep mode. The network device starts the PN detection operation periodically according to the detection interval. AN is used when PN is not available. When PN becomes available again, the network device makes the AN module change the mode from wake-up mode to sleep mode. PN is used for communication this time by the network device. If we define network cycle as the period that a consecutive use of PN and PN occurs only one time, respectively, then we can denote the random variables TA , TP to be independent of each other as the usage time of AN and PN, respectively. Therefore, the usage patterns of a network device can be modeled according to the alternation renewal process [26] [27]. We can analyze and calculate the average energy consumption per unit time by using the network cycle.
Energy Efficient Power Management
227
Primary network status On state Off state
Network in use PN
į(Network detection interval)
AN TA
TP
TA
TP
1 Network Cycle
Network detection operation
Fig. 2. An Example of Network Usage Patterns of Device
Table 1 shows some notations and definitions used in this paper to model the energy consumption and determine the optimal network detection interval. 3.2 Energy Consumption Model and Optimal Network Detection Interval By one network cycle, we can present CN , CD , and Ctotal , respectively, as follows. CN denotes the average energy consumption AN, PN per unit time. CD denotes the average energy consumption for PN detection per unit time. Ctotal denotes the average energy consumption per unit of time.
CN =
αE[TP ] + βE[TA ] E[TP ] + E[TA ]
(1)
γE[X] E[TP ] + E[TA ]
(2)
CD =
αE[TP ] + βE[TA ] γE[X] + E[TP ] + E[TA ] E[TP ] + E[TA ] αE[TP ] + βE[TA ] + γE[X] = E[TP ] + E[TA ]
Ctotal =
(3)
228
Bongjae Kim et al. Table 1. Notations for Energy Consumption Model
Notation
Description
TP TA E[TP ] E[TA ] λ μ α β γ δ δoptimal P Non P Nof f P Non (δ) P Nof f (δ) X
PN’s usage time during a cycle, random variable AN’s usage time during a cycle, random variable Expected value of PN’s usage time during a cycle Expected value of AN’s usage time during a cycle PN’s state transition rate to on state from off state PN’s state transition rate to off state from on state PN’s energy consumption rate per unit time AN’s energy consumption rate per unit time (β > α) Energy consumption for PN detection per one time PN detection interval Optimal PN detection interval Probability that PN is on state after PN detection interval (δ) Probability that PN is off state after PN detection interval (δ) Probability that PN is on state after δ Probability that PN is off state after δ The number of PN detection operations during TA , random variable(= TA /δ) Average energy consumption AN, PN per unit time Average energy consumption for PN detection per unit time Average energy consumption per unit time (= CN + CD )
CN CD Ctotal
Ctotal can be presented as the summation of CN and CD like in the equation (3). In the above equation (3), the expected value of the random variable TP is calculated by the memoryless property of the exponential distribution as follows. E[TP ] can be calculated easily.
E[TP ] =
1 μ
(4)
The random variable TA is the amount of time that the time required for detecting PN at first, after PN is not available by checking at an interval of δ. Each network detection is bernoulli trials to detect PN’s network status per δ interval. The result of each network detection operation is off state(0) or on state(1). The probability of off state(0) or on state(1) can be calculated by the transient state probability of the continuous Markov process as follows.
Energy Efficient Power Management
229
P [PN is off state after t seconds] =
λ −(λ+μ)t μ + e λ+μ λ+μ
(5)
P [PN is on state after t seconds] =
λ −(λ+μ)t λ − e λ+μ λ+μ
(6)
Therefore, we can present P Non , P Nof f respectively as follows.
P Non =
λ −(λ+μ)δ λ − e λ+μ λ+μ
(7)
λ −(λ+μ)δ μ + e λ+μ λ+μ = 1 − Pon
P Nof f =
(8)
The random variable X is the number of PN detection operations until PN is detected at first. The random variable X obeys the geometric distribution as follows. P (X = n) = P Nof f (δ)n−1 P Non (δ),
n≥1
(9)
The expected value of a geometrically distributed random variable X is 1/p. In this case, p is P Non (δ). The expected value of X is calculated as follows.
E[X] =
1 P Non (δ)
Therefore, the expected value of TA is as follows.
(10)
230
Bongjae Kim et al.
E[TA ] = δE[X] δ = P Non (δ)
(11)
We can calculate E[TP ], E[TA ], and E[X] using the above equations respectively. We know α, β, γ, and δ respectively. Finally, we can obtain Ctotal as follows.
Ctotal = CN + CD γE[X] αE[TP ] + βE[TA ] + = E[TP ] + E[TA ] E[TP ] + E[TA ] αE[TP ] + βE[TA ] + γE[X] = E[TP ] + E[TA ] αE[TP ] + βδE[X] + γE[X] = E[TP ] + δE[X] αE[TP ] + (βδ + γ)E[X] = E[TP ] + δE[X] =
P] α E[T E[X] + βδ + γ
E[TP ] E[X]
= α+ = α+ = α+
+δ
(β − α)δ + γ E[TP ] E[X]
+δ
(β − α)δ + γ P Non (δ) μ
+δ
(β − α)δ + γ − e−(λ+μ)δ ) + δ
λ μ(λ+μ) (1
(12)
Ctotal value varies according to α, β, γ, λ, and μ. If we reduce Ctotal , then we can reduce the energy consumption of network communication. We can calculate the optimal network detection interval (δoptimal ) for network detection as follows.
δoptimal = arg min Ctotal δ
(13)
Figure 3 shows the energy consumption per unit of time according to the network detection interval. Optimal means that the network device uses both
Energy Efficient Power Management
231
1.5
1.45
Ctotal
1.4
1.35
1.3
1.25
1.2 0
50
100
150
200
250
300
į Ȗ=0.1
Ȗ=0.5
Ȗ=1.0
Optimal
Fig. 3. Ctotal according to δ
(λ = μ = 1/120, α = 1, β = 1.5) AN and PN without network detection. Network detection cost (CD ) is not required. If Coptimal means the average energy consumption per unit of time in case of the optimal case, then we can calculate Coptimal as follows.
Coptimal =
αE[TP ] + βE[TA ] E[TP ] + E[TA ]
(14)
Based on figure 3, we can observe the optimal network detection interval. For example, the optimal detection interval is about 7 seconds when λ = μ = 1/120, α = 1, β = 1.5, and γ = 0.1. If we use this network detection interval, then we can minimize the energy consumption. In this case, Ctotal is about 1.27. Optimal detection interval is 16 and 23 in case of γ = 0.5 and γ = 1.0, respectively. If we use only the AN for network communication, then we can obtain Ctotal as 1.5 because of λ = μ = 1/120, α = 1, β = 1.5, and γ = 0.1. If we use only the PN for network communication, then we can obtain Ctotal as 1.0. Coptimal is 1.25 in case of λ = μ = 1/120, α = 1, and β = 1.5. We can figure out that if the network detection cost is relatively small, then a shorter network detection interval is more efficient in terms of energy con-
232
Bongjae Kim et al. 4
3.5
3
Ctotal
2.5
2
1.5
1
0.5 0
50
100
150
200
250
300
į Į=1, ȕ=1
Į=1, ȕ=2
Į=1, ȕ=3
Į=1, ȕ=4
Fig. 4. Ctotal according to α, β
(λ = μ = 1/120, γ = 1.0) sumption. The effectiveness of energy consumption is decreased by increasing the network detection cost(γ). Figure 4 shows Ctotal according to α, β. In figure 4, γ is 1.0 and α is equal to network detection cost (γ). Based on figure 4, if α is equal to β, then network detection is unnecessary in terms of minimizing energy consumption. Figure 4 shows similar patterns of Ctotal in other cases. 3.3 Heuristic Network Detection Scheme We propose a heuristic network detection scheme that can dynamically adjust the network detection interval. In the real world, we do not exactly know the activation patterns of PN and AN. Therefore, we cannot minimize the average energy consumption by using the optimal network detection interval. However, we can approximate the activation patterns of PN and AN by using the previous usage time of PN and the number of detection operations at one network cycle. In other words, we can approximate λ and μ of the equation (12). λ menas PN’s state transition rate to on state from off state. μ means PN’s state transition rate to off state from on state. By using the approximated usage time of PN and AN, we can obtain the approximated optimal detection interval for the next network detection
Energy Efficient Power Management
233
through δoptimal = arg minδ Ctotal . Too short a network detection interval will consume a lot of energy; however, we can still obtain the approximated optimal network detection interval. This scheme is very effective for reducing the energy consumption of network detection operation. Table 2. Notations for Heuristic Network Detection Scheme
Notation
Description
δinitial δcurrent λapprox
Initial PN detection interval Current PN detection interval Approximated PN’s state transition rate to on state from off state Approximated PN’s state transition rate to off state from on state Expected use time of AN at i th network cycle Expected use time of PN at i th network cycle The number of PN detection operations PN’s usage time during i th network cycle AN’s usage time during i th network cycle PN detection interval according to approximated λapprox , μapprox at current state
μapprox T A (i) T P (i) NDT TP (i) TA (i) δnew
The algorithm shows the process of our heuristic network detection scheme in detail and Table 2 shows some notations and descriptions used for describing the algorithm of our scheme. If we use our heuristic network detection scheme, then energy consumption can be efficiently minimized. The simulation results showed that our scheme achieves good performance compared to that of the optimal case. Our heuristic network detection scheme includes 4 phases that are initialization, changing the network from AN to PN, changing the network from PN to AN, and network detection. Each phase performs different operations. Network detection interval (δcurrent ) is allocated as δinitial at initialization. δinitial is a constant value of the initial network detection interval. The network device performs PN network detection operation every δcurrent interval. The number of PN network detection operation (NDT ) is counted per each network detection interval. If PN is detected, then the network connection is changed to PN from AN. In case of changing the network from AN to PN, TA (i) is calculated as TA (i) = NDT × δcurrent . The number of PN network detection operation (NDT ) is initialized to 0. TA (i) is usage time of AN during i th network cycle. In case of changing the network from PN to AN, TP (i) is calculated as the estimated use time of PN at i th network cycle. T A (i) and T P (i) are calculated. Then, we can find the approximated λapprox and approximated
234
Bongjae Kim et al. Table 3. The Algorithm of Our Heuristic Network Detection Scheme
Algorithm. Heuristic Network Detection Scheme In case of initialization : Do initialization TP (i), TA (i) Do initialization T A (i), T P (i) Do initialization λcurrent , μcurrent Do initialization network detection Interval(δinitial ) Do initialization the number of PN detection operations(NDT ) End initialization In case of changing the network from AN to PN : Calculate TA (i) at i th network cycle : TA (i) = NDT × δcurrent NDT = 0 // initialize NDT Do handover End changing the network from AN to PN In case of changing the network from PN to AN : Calculate TP (i) : TP (i) = estimated use time of PN at i the network cycle A (i) Calculate T A (i) : T A (i) = T A (i−1)×(i−1)+T i T P (i−1)×(i−1)+TP (i) Calculate T P (i) : T P (i) = i Approximate λapprox : λapprox = T 1(i) A Approximate μapprox : μapprox = T 1(i) P Do calculation of δnew by using both λapprox and μapprox δcurrent = δnew // assign new network detection interval Do handover End changing the network from PN to AN Per each network detection interval : Do PN detection operation NDT = NDT + 1 If(PN detection == SUCCESS) Change the network from AN to PN End each network detection interval
Energy Efficient Power Management
235
μapprox . In other words, we can obtain the approximated state transition rate of PN as λapprox and μapprox . By using the above approximated state transition rate of PN, we can acquire δnew at the current state. δcurrent is changed to δnew . We can optimize the network detection cost by δnew .
4 Performance Evaluation We evaluated the performance of our proposed scheme in terms of the average energy consumption per unit of time. We used the simulation method for performance evaluation. We compared our scheme with the optimal case and Optimized Fixed Interval (OFI), we analyzed the relative energy consumption between them. Optimal case Optimal case is that the network device uses both AN and PN without network detection operations by exactly knowing the activation points of PN and AN.The average energy consumption of the optimal case is always smaller than those of others. But, the optimal case is ideal and unrealistic. Optimized Fiex Interval(OFI) OFI uses fixed interval for network detection that is calculated by the network usage time of PN and AN of the optimal case. However, in the real world, the OFI scheme is unrealistic because we do not know the network usage time of AN and PN in advance. Our scheme Our scheme dynamically adjusts the network detection interval by approximating the previous activation patterns of the network. Our scheme does not require any pre-knowledge of activation patterns of the network in advance. Therefore, our scheme is a realistic method. 4.1 Simulation Environments Figure 5 shows an example of the simulation environment. Based on figure 5, the network field is divided into a PN area and AN area. The network field is 1000m × 1000m. Mobile Node(MN) uses PN and AN alternatively by moving the network field. We used the random mobility model for MN’s mobility model. MN can also move the field freely. MN’s mobility is from 1m/s to 20m/s. To avoid network area overlapping, we used the non-overlapping arrangement method for each PN area, as is shown in figure 5. Each PN area does not overlap. Each PN’s radius is 100m. The number of PN area is from 5 to 25. The initial PN’s detection interval is 10 seconds, and the maximum
236
Bongjae Kim et al.
PN’s detection interval is 300 seconds. In other words, the dynamic network detection interval is used from 10 seconds to 300 seconds in our heuristic network detection scheme. But, OFI uses a fixed interval. Table 4 shows some parameters and values used in the simulation for performance evaluation.
Network Field
PN’s radius
AN area
Mobile Node(MN)
PN area
PN’s coverage
AN’s coverage
Fig. 5. An Example of Simulation Environments
Table 4. Simulation Parameters
Parameter
Value
Network filed MN’s mobility The number of PN area Each PN’s radius Each PN’s distribution Initial PN’s detection interval Maximum PN’s detection interval
1000m × 1000m 1m/s − 20m/s 5 − 25 100m Random 10s 300s
We performed the simulation by changing the parameter values α, β, and γ, respectively. We performed each simulation 100 times. We used the average for the simulation results.
Energy Efficient Power Management
237
4.2 Simulation Results Figure 6 shows the energy consumption per unit time of optimal case, OFI, and our scheme according to network detection cost (γ). We can observe that our heuristic scheme shows good performance compared with optimal case and OFI. If we only use PN during the communication, then we will obtain the average energy consumption per unit time as 1.0. On the other hand, if we only use AN during the communication, we will obtain the average energy consumption per unit time as 1.5. Because α = 1, β = 1.5.
Energy Consumption/s (Ctotal)
1.4000 1.3500 1.3000 1.2500 1.2000 1.1500 1.1000 1.0500 1.0000 Į=1, ȕ=1.5, Ȗ=0.1 Optimal
Į=1, ȕ=1.5, Ȗ=0.5
Our scheme
Į=1, ȕ=1.5, Ȗ=1.0
Optimized Fixed Interval
Fig. 6. Energy Consumption According to γ
(MN’s mobility = 1m/s, The Number of PN Area = 15) Based on figure 6, the energy efficiency is improved. The average energy consumption of the optimal case is 1.246, and our scheme is 1.259 in case of α = 1, β = 1.5, and γ = 0.1. The average energy consumption of OFI is 1.259. In case of γ = 0.5 and γ = 1.0, the average energy consumptions of our scheme are 1.272 and 1.281 respectively. If we define Coptimal and Courscheme as the energy consumption of the optimal case and our scheme, respectively, then the minimum Courscheme /Coptimal is about 1.01. The maximum Courscheme /Coptimal is about 1.03. In addition, we can figure out that energy consumption is increased as the network detection cost (γ) is increased. Figure 7 shows the energy consumption according to α, β. The simulation result is very similar to the result shown in figure 6. Our heuristic network detection scheme shows good energy consumption compared with those of the optimal case and OFI. Figure 8 the presents energy consumption per unit of time according to the number of PN area. We define the coverage of PN area as follows.
238
Bongjae Kim et al.
Energy Consumption/s (Ctotal)
3 2.5 2 1.5 1 0.5 0 Į=1, ȕ=1 Optimal
Į=1, ȕ=2 Our scheme
Į=1, ȕ=3
Į=1, ȕ=4
Optimized Fixed Interval
Fig. 7. Energy Consumption According to α, β
(γ = 1, MN’s mobility = 1m/s, The Number of PN Area = 15)
The coverage of PN area =
total size of PN area Network fieldsize
(15)
If the number of PN area is 5, then the coverage of PN area is 0.157. If the number of PN area is 25, then the coverage of PN area is 0.785. Figure 9 shows the coverage of PN area according to the number of PN area. Energy consumption per unit of time is decreased as the number of PN area is increased because the coverage of PN area is increased. The opportunity of using PN is increased. Figure 10 presents the energy consumption per unit of time according to the mobility of MN(Mobile Node). Figure 11 presents the performance cap betwwen our scheme and OFI according to MN’s mobility. The performance gap can be calculated as follows.
Performance gap =
COF I Courscheme
(16)
Based on figure 11, the performance gap between OFI and our schemes is increased as MN’s mobility is increased. The performance gap is about 1.003 when MN’s mobility is 5. When MN’s mobility is 20, the performance gap is about 1.018. Our scheme shows better performance when MN’s mobility is high because OFI only uses fixed detection interval by optimal case’s total communication time of AN and PN for calculating optimized fixed detection
Energy Efficient Power Management
239
Energy Consumption/s (Ctotal)
1.6 1.5 1.4 1.3 1.2 1.1 1 5
10
Optimal
15
20
25
The number of PN area Our scheme Optimized Fixed Interval
Fig. 8. Energy Consumption According to The Number of PN area
(α = 1, β = 1.5, γ = 1, MN’s mobility = 1m/s) 0.90 The Coverage of PN Area
0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 5
10
15
20
25
The Number of PN Area
Fig. 9. The Coverage of PN Area According to The Number of PN Area
interval. In this case, the activation rate and deactivation rate of PN are not considered. Contrastively, our scheme dynamically adjusts the network detection interval at the current state by considering the activation rate and deactivation rate of PN. Our scheme approximates the activation patterns of PN and AN during the network communication. By using these approximated activation patterns, our scheme adjusts the network detection interval dynamically. Based on the above experiment results, the optimal case always shows better performance than our proposed scheme and OFI. However, our scheme shows good performance compared with the optimal case and OFI. Our scheme is a realistic method
240
Bongjae Kim et al.
Energy Consumption/s (Ctotal)
1.45 1.4 1.35 1.3 1.25 1.2 1.15 1.1 1.05 1 1 Optimal
5
10
15
20
MN's mobility(m/s) Our scheme Optimized Fixed Interval
Fig. 10. Energy Consumption According to MN’s mobility
(α = 1, β = 1.5, γ = 0.1, The Number of PN area = 15) Performance Gap(C OFI / Cour scheme)
1.020 1.018 1.016 1.014 1.012 1.010 1.008 1.006 1.004 1.002 1.000 1
5
10
15
20
MN's mobility(m/s)
Fig. 11. Performance Gap between Our Scheme and OFI According to MN’s mobility
(α = 1, β = 1.5, γ = 0.1, The Number of PN area = 15) that reduces energy consumption by using the network detection operation. In addition, our scheme shows a certain level of performance compared with that of the optimal case. Therefore, we can say that our scheme is efficient in terms of energy consumption for multi-mode wireless network devices.
Energy Efficient Power Management
241
5 Conclusion Energy efficiency is a very important issue in mobile wireless network devices because most mobile handheld devices, such as smart phones, are operated by battery. Therefore, we need to reduce energy consumption by using efficient power management. Also, optimization scheme on the operating system level and application level can be applied for reducing energy consumption. In this paper, we analyzed the energy consumption rate of network devices according to the variation of network detection interval. We derived the optimal network detection interval by using probabilistic analysis according to the state transition rate of the network and the energy consumption of network modules. In the above results, we showed the existence of the optimal network detection interval. We proposed a heuristic network detection scheme for minimizing network detection costs. We can efficiently minimize the energy consumption of multi-mode wireless network devices by using our scheme. The simulation results show that our scheme is efficient.
Acknowledgement This research was supported by the Electronics and Telecommunicatons Research Institute (ETRI) under the program of Development of Embedded SW Common Platform for Information and Industrial Devices, and by the MKE(The Ministry of Knowledge Economy), Korea, under the ITRC(Information Technology Research Center) support program supervised by the NIPA(National IT Industry Promotion Agency) (NIPA-2010-(C1090-1021-0010)).
References [1] [2]
[3]
[4] [5] [6] [7]
U. Varshney and R. Jain: Issues in emerging 4G wireless networks. Computer, vol. 34, no. 6, 94–96 (2001) P. Bahl, A. Adya, J. Padhye, A. Walman: Reconsidering wireless systems with multiple radios. ACM SIGCOMM Computer Communication Review, vol. 34, no. 5, 39–46 (2004) N. Balasubramanian, A. Balasubramanian, A. Venkataramani: Energy consumption in mobile phones: a measurement study and implications for network applications. 9th ACM SIGCOMM conference on Internet measurement conference, 280–293 (2009) 3GPP, http://www.3gpp.org WiFi, http://www.wi-fi.org WiBro, http://www.wibro.or.kr J. Ylitalo, T. Jokikyyny, T. Kauppinen, A. J. Tuominen, J. Laine: Dynamic Network Interface Selection in Multihomed Mobile Hosts. Hawaii International Conference on System Sciences, vol. 9, 315–324 (2003)
242 [8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18] [19]
[20]
[21]
[22]
Bongjae Kim et al. Minji Nam, Nakjung Choi, Yongho Seok, Yanghee Choi: Wise: energyefficient interface selection on vertical handoff between 3G networks and WLANs. 15th IEEE International Symposium on Personal, Indoor and Mobile Radio Communications (PIMRC’04), 692–698 (2004) Mostafa Zaman Chowdhury, Yeong Min Jang, Choong Sub Ji, Sunwoong Choi, Hongseok Jeon, Junghoon Jee, Changmin Park: Interface selection for power management in UMTS/WLAN overlaying network. 11th international conference on Advanced Communication Technology, 795–799 (2009) Feng Juanjuan, Chen Shanzhi, Hu Bo, Shi Yan: An Autonomic Interface Selection Method for Multi-interfaces Mobile Terminal in Heterogeneous Environment. 2009 WRI World Congress on Computer Science and Information Engineering, 107–111 (2009) Jani Puttonen, Gabor Fkete, Tapio Vki, Timo Hinen : Multiple Interface Management of Multihomed Mobile Hosts in Heterogeneous Wireless Environments. 2009 Eighth International Conference on Networks, 324–331 (2009) Jean-Marie Bonnin, Imed Lassoued, Zied Ben Hamouda: Automatic Multi-Interface Management Through Profile Handling. Mobile Networks and Applications, Volume 14, Number 1, 14–17 (2009) R. N. Mayo and P. Ranganathan: Energy Consumption in Mobile Devices: Why Future Systems Need Requirements Aware Energy Scale-Down. Lecture Notes in Computer Science, Volume 3164, 26–40 (2005) Kaisen Lin, Aman Kansal, Dimitrios Lymberopoulos, Feng Zhao: Energyaccuracy trade-off for continuous mobile device location. 8th international conference on Mobile systems, applications, and services, 285–298 (2010) Richard Gass, Christophe Diot: An Experimental Performance Comparison of 3G and Wi-Fi. Passive and Active Measurement, Vol. 6032, 71–80 (2010) LM Feeney, M Nilsson: Investigating the Energy Consumption of a Wireless Network Interface in an Ad Hoc Networking Environment. IEEE INFOCOM, (2001) L. Zhong, N. K. Jha: Energy efficiency of handheld computer interfaces: limits, characterization and practice. International Conference On Mobile Systems, 247–260 (2005) M. A Viredaz, L. S Brakmo, W. R Hamburgen: Energy Management on Handheld Devices. Queue, vol. 1, no. 7, 44–52 (2003) E. Rantala, A. Karppanen, S. Granlund, P. Sarolahti: Modeling energy efficiency in wireless internet communication. 1st ACM workshop on networking, systems, and applications for mobile handhelds, 67–68 (2009) Sergiu Nedevschi, Lucian Popa, Gianluca Iannaccone, Sylvia Ratnasamy, David Wetherall: Reducing network energy consumption via sleeping and rate-adaptation. 5th USENIX Symposium on Networked Systems Design and Implementation, 323–336 (2008) T. Pering, Y. Agarwal, R. Gupta, R. Want: CoolSpots: Reducing the Power Consumption of Wireless Mobile Devices with Multiple Radio Interfaces. MobiSys’06, June 19–22 (2006) S. Chandra: Wireless network interface energy consumption. Multimedia Systems, vol. 9, no. 2, 185–201 (2003)
Energy Efficient Power Management [23]
[24] [25] [26] [27]
243
Jean-pierre Ebert, Brian Burns, Adam Wolisz: A trace-based approach for determining the energy consumption of a WLAN network interface. European Wireless Conference, 230–236 (2002) D. Gross, J. F. Shortle, J. M. Thompson, C. M. Harris : Fundamentals of queueing theory, John Wiley and Sons (2008) S. M. Ross: Introduction to probability models. Academic Press (2007) S. M. Ross: Stochastic process, Wiley (1996) U. Narayan Bhat: An Introduction to Queueing Theory: Modeling and Analysis in Applications (Statistics for Industry and Technology), (2008)
An Efficient and Reliable flooding in MANETs Jinman Jung1 , Yookun Cho2 , Yeongkwun Kim3 , Sangho Yi4 , and Hyungbae Park5 1
2
3
4 5
School of Computer Science and Engineering, Seoul National University, Korea
[email protected] School of Computer Science and Engineering, Seoul National University, Korea
[email protected] Department of Computer Science, Western Illinois University, USA Y-Kim2@ wiu.edu INRIA Grenoble Rhˆ one-Alpes, France
[email protected] University of Missouri-Kansas City, USA
[email protected]
Summary. Flooding has been used in mobile ad-hoc networks (MANETs) because it is the simplest method for broadcasting messages over an entire network. Several reliable and energy-efficient flooding mechanisms have been developed in recent years. However, an appropriate mechanism which considers dynamic topology changes in MANETs has yet to be developed. Thus, in this paper, we propose an efficient and reliable flooding mechanism. The proposed mechanism uses both FPR and BPR (Forward and Backward Packet Recovery) methods to achieve more robust and reliable flooding. The mechanism enables the receivers to recover missed packets by using the redundant packets in FPR and the request packets for retransmission in BPR. Through analytical modeling, we investigate the impact of redundancy and optimal redundancy in terms of the energy-efficiency in FPR and BPR. In order to maximize the reliability while minimizing network overhead, our mechanism dynamically adjusts the redundancy according to network conditions. Simulation results show that our mechanism provides both increased reliability and energy-efficiency compared to the existing flooding mechanisms.
1 Introduction Broadcasting is a fundamental data dissemination technique, in which one node sends a message to all other nodes in the networks. Broadcasting can be used for route discovery, for network maintenance, or simply for propagating any control messages. A good broadcasting algorithm should achieve both higher throughput and lower energy consumption without significant decrease in reliability (in other words, reachability). The simplest implementation of broadcasting is flooding, in which all nodes rebroadcast messages when a node receives a packet for the first time [1–3].
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 13, © Springer Basel AG 2011
246
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
However, broadcasting by flooding mechanism may cause serious problems of contention, energy consumption, and collisions in the network. Packet losses due to contention or collisions can make it significantly unreliable. In [1], the authors refer to this problem as the broadcast storm problem. Many kinds of flooding mechanisms [1–5] have recently been developed to mitigate the aforementioned problems. However, reducing the number of redundant broadcasts (e.g. selective flooding) can also lead to a lower degree of reliability. Broadcasting is typically an unreliable transport mechanism especially because there is no other reliability mechanism for broadcasting at the MAC layer than acknowledgements and retransmission. Therefore, we have to design an appropriate error recovery mechanism to guarantee some level of reliability. In order to obtain higher reliability, most previous works used the acknowledgement [6,7] or overhearing [8] in the MAC or network layer. However, such schemes may incur significant network overhead. They also require an assumption that a node has a stable connectivity to the source. This is inappropriate for the MANETs which have dynamic changes of network topologies Many approaches have been proposed to solve the problem at the packet level [9, 10]. Pleisch et al [9] proposed an approach that relies on a compensation packet constructed from dropped data packets. The key idea is to extend selective flooding approaches by compensating for messages that are not rebroadcasted. The key configuration is to decide the compensation rate according to the network conditions. However, this protocol uses the predefined fixed compensation rate to recover missed packets without considering dynamic network environments. Drabkin et al. [10] presented a gossiping and recovery mechanism. This technique enables nodes which miss some messages to request retransmission from their neighbors. However, the periodic gossip packets and request packets may become another bottleneck of channel congestion. The challenge we face is reducing the network overhead while still providing higher delivery ratio through the entire network in MANETs. In this paper, we propose an efficient and reliable flooding in MANETs. The proposed scheme uses the hybrid of both FPR and BPR (Forward and Backward Packet Recovery) to achieve more reliability. We focus on the optimal settings for the amount of redundant packets and the number of request packets in terms of the energy-efficiency of recovery. Through analytical evaluation, we show the optimal settings of network parameter (i.e. the amount of redundancy, the number of request for retransmission) according to the estimated network conditions. Also, we present a flooding mechanism which can be individually self-adaptive to the dynamic network environment for minimizing energy consumption. Our scheme is validated through simulations using NovaSim [15] and evaluated its performance. Simulation results show that our scheme outperforms many of the existing flooding mechanisms. The rest of this paper is organized as follows. In Section 2, the system model is described. In Section 3, we introduce the FPR, BPR and analyze the optimal settings in FPR and BPR. In Section 4, we present an efficient and
An Efficient and Reliable Flooding in MANETs
247
reliable flooding mechanism capable of self-adaptation to varying network conditions. In Section 5, we evaluate the performance of our self-adaptive scheme with existing flooding mechanisms by simulation. Finally, we present our conclusion and the direction in which future research should be done.
2 SYSTEM MODEL 2.1 Network Model We consider a network with N mobile nodes randomly distributed in a square network of size L x L. The average node degree, denoted as d, represents the average number of 1-hop neighbors and is given by πr2 d=N 2 L
8r r2 1− + 3πL 2πL2
where r is the transmission range [11]. We assume that all nodes have the same wireless transmission range. Two nodes are considered as neighbors if they are in the transmission range of each other. Mobile nodes move according to the random direction mobility model (RDMM) [12]. In this model, mobile nodes choose a random direction and velocity at every epoch. We also assume that each node knows its velocity via a localization technique 1 such as the triangulation scheme (software-based) or GPS (hardware-based). We assume the message arrival at each node is a Poisson process with λm which is referred to the message arrival rate. Each message contains the Lh header including source id, sequence and hop count number and Lm message bits. We also assume that medium access control is done according to CSMA/CA protocol. 2.2 Reliability and Energy- Efficiency In MANETs, one of the major requirements is reliability. In this paper, we represent the reliability in terms of reachability which is the percentage of nodes that received the broadcast message successfully to the total number of nodes in the network. If the reliability is 1, it means that all the nodes in MANETs will receive the flooding message. However, in MANETs, flooding messages can be lost due to collision, contention, network partitioning, dropping, and so on. Then, let R0 is the origin reachability2 obtained by any flooding mechanism without a recovery process. The origin reachability can represent an approximation to the current network condition(e.g. node density). 1
This is not a critical assumption, because each nodes movement information is used only for adjusting parameters. 2 We can estimate the expected reachability of flooding in MANETs [13].
248
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
To achieve high levels of reliability, we need to design a recovery process, denoted as F, built into the existing flooding mechanisms. Assume that network conditions are stationary for a short-term. The total reliability by flooding with a recovery process F can be expressed by R(δ) = R0 + (1 − R0 )PF (δ)
(1)
RF (δ)
where PF (δ) is the probability of successful recovery when the message is not reached and RF (δ) is the increased reliability which is obtained by a recovery process F . However, because the additional redundancy(δ) causes higher network overheads, we should consider energy-efficiency of redundancy in a recovery process. The total energy consumed by flooding with a recovery process F can be represented by ε(δ) = ε0 + εF (δ)
(2)
where ε0 is the origin energy consumed by only existing flooding mechanisms and εF (δ) is the additional energy consumption which is increased by a recovery process F. Thus, the energy-efficiency of the redundancy in F is defined as η(δ) =
RF (δ) εF (δ)
(3)
One of our goals is to investigate the optimal redundancy (δ ∗ ) in our recovery process (i.e. FPR, BPR) for achieving maximum energy-efficiency. Table 1 shows some notations used in this paper.
3 The Reliable Flooding And Impact of Redundancy In this section, we present an efficient and reliable flooding mechanism based on the two recovery processes FPR and BPR. Also, we investigate the impact of redundancy in FPR and BPR by analytical modeling. Our recovery methods can be independently combined with any selective flooding. For simple analysis, we use the probabilistic flooding [3]. 3.1 Forward Packet Recovery Forward Packet Recovery Process(α) In this method, some compensation packets are proactively transmitted at a dynamic rate. Once a data packet is lost, the receiver uses the compensation packets to recover the lost data like FEC (Forward Error Correction).
An Efficient and Reliable Flooding in MANETs
249
Table 1. Notations used in this paper
Notation Description N L d r λm RF (δ) εF (δ) ηF (δ) α β c q
The total number of nodes The square area length of topology The average degree of nodes The effective communication radius The message arrival rate at each node which contains Lm data bits The increased reliability which is obtained by a recovery process F with redundancy δ The additional energy consumption which is increased by a recovery process F with redundancy δ The energy-efficiency of the recovery F with redundancy δ The forward packet recovery process The backward packet recovery process The compensation threshold which depends on redundancy in FPR The number of request packets in BPR
When a node performs selective flooding by selecting the minimum number of forwarding nodes or dropping the broadcast packet to reduce the number of broadcasts, some nodes may not receive the dropped packets. In this case, each node proactively constructs a compensation packet for the dropped packets, which is used in [9]. The compensation packet is composed of these dropped packets. Figure 1(a) shows the dropped packet which is composed of id and message payload. Figure 1(b) shows the compensation packet which is composed of dropped packets IDs and CP payload that are encoded by XOR operator. In order to adjust the compensation packet dynamically, the compensation packet header must include the number of packets contained in the compensation packet, denoted as c. It also has a list of all contained packets IDs as much as c. Thus, the higher compensation threshold (c), the less the redundancy (δ) in FPR. If the number of dropped packets exceeds the current c, the node broadcasts the compensation packet into MANETs. The number of compensation packets generated per one data packet is G(c) =
(1 − pf ) N R0 . c
(4)
Also, assuming large-scale networks, the probability that the number of compensation packet arrivals is equal to some integer k is given by P (k) =
G(c)k −G(c) e . k!
(5)
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park ID1
Msg1
ID2
Msg2
ID3
Msg3
c
ID1
ID2
ID3
...
IDc
CP Msg
···
250
IDc
Msgc
(a) Dropped Packets in Drop Buffer
(b) Compensation packet
Fig. 1. Composition of Compensation Packet
Efficiency of Redundancy in FPR First of all, for the analysis of the optimal redundancy in terms of energyefficiency in FPR process, we have to derive the probability of successful recovery as explained in the equation (1). The probability of successful recovery in FPR process, denoted as α(c), is dependent on the compensation threshold (c). If a node receives the compensation packet and the node has (c − 1) data packets, it can recover a missed packet by performing XOR operations. This means that one missing packet can be recovered by using (c − 1) valid data packets. Thus, for a missed packet, the probability of successful recovery by one compensation packet can now be evaluated through c as α1 (c) = R0c−1 .
(6)
Then, the probability of successful recovery by k compensation packets can be computed as αk (c) = 1 − (1 − α1 (c))k .
(7)
Therefore, on the average, the probability of successful recovery by the FPR can be derived from equations (5) and (7) as follows
α(c) =
∞
αk (c)P (k)
k=0
= 1 − e−
1−pf c
N R0c
.
(8)
For a missed packet, the reachability improved by FPR with compensation threshold (c) is
An Efficient and Reliable Flooding in MANETs
Rα (c) = (1 − R0 )α(c).
251
(9)
From the equation (1), for a data packet, the total reachability of flooding with FPR is R(c) = R0 + (1 − R0 )α(c).
(10)
Also, the compensation packets are generated with rate G(c) by a data packet. It is an energy-cost for improved reachability. The normalized energy consumed in flooding with FPR is given by εα (c) = G(c)
(11)
Thus, the energy-efficiency of the compensation c in α is given by ηα (c) =
Rα (c) εα (c)
(12)
1 0.9 0.8 0.7
Reliability
0.6 0.5 0.4 R = 0.5 0.3
R = 0.6 R = 0.7
0.2
R = 0.8 R = 0.9
0.1
R = 0.95 0
0
2
4
6
8 10 12 Compensation Threshold
14
Fig. 2. Impact of redundancy in FPR
16
18
20
252
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
1
Efficiency
R = 0.5 R = 0.6 R = 0.7 R = 0.8 R = 0.9 R = 0.95
0
2
4
6
8
10 12 14 Compensation Threshold
16
18
20
Fig. 3. Efficiency of redundancy in FPR
A plot for the equation (10), the total reliability, is shown in Figure 2 according to compensation threshold c for R0 = 0.5, 0.6, 0.7, 0.8, 0.9, 0.95. As mentioned earlier, the redundancy decreases as the compensation threshold (c) increases. We can see a decrease in the reachability as the redundancy decreases in all R0 . We can observe that the effect of redundancy is mitigated with higher R0 . We now examine the optimal compensation threshold. A plot for the equation (12) as a function of compensation rate(c) is illustrated in Figure 3 for the R0 =0.5,0.6,0.7,0.8,0.9 and 0.95. We can define the optimal compensation threshold as such c∗ = arg max ηα (c). c
(13)
We can see from this figure that the optimal redundancy exists in terms of energy efficiency. It requires approximately c = 2 to obtain maximum energyefficiency in R0 = 0.5 while it requires approximately c = 7 to obtain the maximum energy-efficiency in R0 = 0.8. Similarly, we can regard c =2, 3, 5, 7, 10 and 15 as the optimal compensation threshold (c∗ ) in R0 = 0.5, 0.6, 0.7, 0.8, 0.9 and 0.95, respectively. From this figure, It is clear that as R0 increases (under better network conditions), the optimal c∗ increases. In addition, we see that the BPR is more efficient rather than the FPR in higher R0 . In other
An Efficient and Reliable Flooding in MANETs
253
words, as the network condition becomes better, it is likely that the effect of redundancy by FPR grows more inefficient. 3.2 Backward Packet Recovery Backward Packet Recovery Process(β) In BPR process, packet losses can also be alleviated by using such retransmission mechanisms as ARQ (Automatic Repeat Request) schemes. BPR is a type of the recovery method in which the receiver sends a request for retransmission to neighbors by maintaining the list of missed packets (Lmp ). The Lmp is composed only of IDs of packets that have not been arrived yet at this node but known to a neighbor node. When a node receives a compensation packet, the node can obtain the subset of neighbor s received packet list from the compensation packet for FPR without extra cost . If some packet IDs on the compensation packet do not exist in the list of received packets (Lrp ), the receiver of the compensation inserts the IDs into the Lmp . Additionally, when a node receives a data packet, it checks whether the packet ID is in the Lmp or not. If it is in the list, the node removes the ID from the Lmp , and adds it to the Lrp . In addition, the sequence numbers that are extracted from the ID on the compensation packet can be used to determine missed packet. If the receiver detects a gap in the sequence number, it will add the IDs that are currently presumed to be missed into the Lmp . This way, each node will know most of the missed packets without exchanging the summary information like [10]. Efficiency of Redundancy in BPR Each node broadcasts a request packet for retransmission of the missed packets after the period Tm . If the missed packet is still not received before the timer of Tm . expires, it broadcasts a request packet that includes the ID of the missed packet for retransmission. Similar to FPR, in the analysis of the optimal redundancy in BPR, we have to derive the probability of successful recovery in BPR. Assume that all nodes can know most of missed packets by the IDs contained in the compensation packet and the sequence number. If there is at least one neighbor that has the same ID as contained in the request packet, the missed packet can be successfully recovered by BPR. The probability of successful recovery by one request packet in BPR is given by β = 1 − (1 − R0 )d
(14)
where d is the average number of neighbor nodes. From the equation (14), we can calculate the probability of successful recovery by q-th request packet in BPR.
254
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
β(q) =
q
(1 − β)k−1 β
k=1
= 1 − (1 − R0 )qd
(15)
For a missed packet, the reachability improved by BPR with the number of request (q) is Rβ (q) = (1 − R0 )β(q)
(16)
From the equation (1), the total reachability of flooding with BPR is R(q) = R0 + (1 − R0 )β(q)
(17)
1 0.9 0.8
Reachability
0.7 0.6 0.5 0.4
R = 0.5 R = 0.6 R = 0.7 R = 0.8 R = 0.9 R = 0.95
0.3 0.2 0.1 0
0
1
2 The number of request(q)
3
4
Fig. 4. Impact of redundancy in BPR
As shown in the Figure 4, not only can the increased q improve the reachability but it can also increase request packets and their responses. The normalized energy consumption for the BPR is simply estimated as εβ (q) = q.
(18)
Therefore, the efficiency of the redundancy in BPR is given by ηβ (q) =
Rβ (q) εβ (q)
(19)
An Efficient and Reliable Flooding in MANETs
255
Figure 5 shows the plot of the different efficiencies as function of the number of request (q) for R0 = 0.5, 0.6, 0.7, 0.8, 0.9 and 0.95 in BPR. In this figure, we see the decrease in energy-efficiency in all R0 due to the additive energy overhead.
0.5 R = 0.5 R = 0.6 R = 0.7 R = 0.8 R = 0.9 R = 0.95
0.45 0.4 0.35 0.3 0.25 0.2 0.15 0.1 0.05 0
1
2
3
4
5
6
7
8
9
Fig. 5. Efficiency of redundancy in BPR
The optimal request trials (q ∗ ) illustrated in figure 5 is 1 to maximize the energy-efficiency. However, in order to reach to better reliability, we can select higher q than q ∗ (=1). This is because the decrease of the efficiency is negligible in BPR, especially, since network conditions are better (when R0 is higher).
4 Self-Adaptive Mechanism 4.1 Strategies The results described in the previous section provide some insight into the notion that the recovery processes for reliable flooding have the different be-
256
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
haviors of efficiency under various network conditions. In better network conditions where the packet delivery rate is high, low compensation threshold can cause congestion and bandwidth waste. Therefore, since the current network condition is better, we have to increase the compensation threshold (c) for recovery (i.e. reduce the redundancy for recovery) in FPR. This indicates that BPR is more efficient rather than FPR under favorable conditions. These observations provide sufficient background for the dynamic settings of FPR and BPR. The self-adaptive recovery strategy according to the dynamic network conditions can improve the efficiency of recovery. The dynamic adjustment of these settings can be a reasonable approximation of the optimal redundancy for the dynamic topology at the next packet broadcast. In FPR, the lower redundancy (i.e. the higher compensation threshold) under network conditions with high packet delivery rates can maximize the reliability while minimizing network overhead. Therefore, we need to dynamically adjust compensation threshold for FPR at run-time while considering network conditions. For practical designs, if the compensation threshold exceeds a maximum value, the strategy for recovery should be changed to BPR. In this case, we construct the compensation packet which includes only the IDs of dropped packets without the compensation payload. Similarly in BPR, we can dynamically adjust the number of request packets according to the network conditions. The number of request packets for retransmission is increased when network conditions are favorable. The reason is that the adaptive recovery strategy grows more and more dependent on the BPR. In BPR, each node can broadcast periodically or aperiodically a request packet. For the periodic case, we introduce a new parameter, the time interval Tm . Every Tm , each node periodically broadcasts a request packet that includes the oldest ID in the Lmp . It is intuitive that a short Tm may cause the unnecessary request packet for a missed packet to arrive soon. In contrast, the longer Tm can reduce the amount of request packet. However, it can increase the end-to-end delay and decrease the reliability. Moreover, we observed that the information of Lmp is spread quicker by the faster node than the static node. This observation infers that we should dynamically adjust Tm according to the host mobility. Tm can be simply adjusted with the following simplified model3 as a function of velocity as in Equation (20) r Tm = θ( ) (20) v where r is the transmission range. This method works better in the high packet delivery conditions. In an aperiodic case, a node maintains the map which has the holders of missed packets. Then, the node waits to meet one of the holders 3
It is the link generation rate function [14].The link generation rate is proportional to the velocity of the node, so as the node is fast, the node requests more frequently.
An Efficient and Reliable Flooding in MANETs
257
on the map in order to request. The advantage is that it involves only one transmission per missed packet. However, this method may suffer from high buffer occupancy for the map and end-to-end latency. 4.2 Algorithm
Table 2. Notations and functions used in algorithm.
Notations
Description
c cinit cmin , cmax cd Pc , Pr , Pd
The current compensation threshold The initial value of c The maximum and minimum values of c, respectively The increment of c The compensation, received and dropped packets, respectively The list of missed packet IDs and received packet, reLmp , Lrp spectively Tm The time interval to send the request packet for a missed packet in Lmp Tc The time interval for checking redundancy packet mergeIDSet(Pa , Pb ) It merges set of IDs of Pa and Pb , and stores the result to Pa mergeData(Pa , Pb ) It merges packet data of Pa and Pb by using XOR operation, and stores the result to Pa packetN um(Pi ) It returns the number of contained packets in Pi idSet(Pi ) It returns IDs of Pi packetData(Pi ) It returns payloads of Pi broadcastP acket(Pi ) It broadcasts a packet Pi isExisting(Li , idk ) It returns true if x is same as idk in Li , otherwise it returns false f indP acket(Li , idk ) It returns x if x is same as idk in Li , otherwise it returns NULL It sets a timer for period Ti setT imer(Ti ) releaseT imer(Ti ) It releases a timer for period Ti adjustT imer(Ti , Vi ) It adjusts Ti according to the host velocity Vi isEmpty(Li ) It returns true if the list Li is empty. Otherwise, false It returns the last element of list Li getT ail(Li ) requestP acket(idk ) It broadcasts the request packet to neighbors for retransmission of the missed packet idk
Our self-adaptive mechanism can independently be combined with selective flooding. When dropping a packet for doing a selective flooding algo-
258
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park Table 3. Self-Adaptive Algorithm
Algorithm 1. Our Self-Adaptive Algorithm -Initialization: c = cinit - When dropping a packet for doing selective flooding: increase packetN um(Pc ); mergeData(Pc , Pd ); mergeIDSet(Pc , Pd ); if packetN um(Pc ) ≥ c then broadcastP acket(Pc ) endif - When the timer of Tc is expired: c = cmin ; if packetN um(Pc ) ≥ c then broadcastP acket(Pc ) endif setT imer(Tc ); - When receiving a compensation packet (Pc ): for all idx in Pc if isExisting(Lrp , idx ) == false then insert idx into Lmp ; end if end for perform F orwardP acketRecoveryP rocess - When receiving a data packet (Pr ): idx = idSet(Pr ); releaseT imer(Tc ); if isExisting(Lrp , idx ) then; c = c + cd ; if c ≥ cmax then c = cmax endif else remove idx from Lmp ; insert idx into Lrp ; endif setT imer(Tc ); - When receiving a request packet (Pr ): idx = idrequest in Pr ; if isExisting(Lrp , idx ) then broadcastP acket(f indP acket(idx )); else insert idx into Lmp ; endif - When the timer of Tm is expired: if isEmpty(Lmp ) == false then requestP acket(getT ail(Lmp )) endif adjustT imer(Tm , nodes movement); - When receiving a reply packet: perform BackwardP acketRecoveryP rocess
An Efficient and Reliable Flooding in MANETs
259
rithm, every dropped packet is combined with current compensation packet by the compensation threshold c. The number of contained packets in the compensation packet is incremented by one if it is lower than c. The ID of dropped packet is added to the compensation packet header by function mergeIDSet(Pa , Pb ) and the payload is operated by mergeData(Pa , Pb ) which returns the result of a bitwise XOR operation. If the size of compensation packet exceeds the current c, the node broadcasts the compensation packet Pc . At the same time, the c is incremented as cd when receiving a redundant packet. This means the host is in a dense area(favorable network condition) where it can successfully receive a large amount of rebroadcasts from its neighbors. If the value is higher than the maximum value cmax , it will be explicitly set to cmax . In contrast, for every time interval Tc , we reduce c to increase the amount of compensation at the host in sparser area if no broadcast packet is received within Tc . Each node maintains the additional list of missed packet IDs (Lmp ) that is estimated from IDs on the header of Pc . Therefore, when receiving Pc , the receiver inserts some ID on the Pc that has not yet been received into the Lmp . Then, if the receiver has all but one of the contained data packets, it performs the forward recovery process as in the MISTRAL [9]. If a packet of Lmp arrives within Tm , the ID of the packet which might be delayed in MANETs will be deleted from Lmp . When the timer of Tm is expired, the node broadcasts a request packet Pr for the oldest of which exists still in Lmp . In order to be more compatible with the dynamic network, Tm is adjusted by adjustT imer as a function of velocity to fit various host environments. Upon reception of a Pr , if the receiver of Pr has the packet that needs to be retransmitted, the node replies by retransmitting backward. Otherwise, it must also be inserted into Lmp because it is a new ID to the receiver.
5 Performance Evaluation In this section, we evaluate the performance of our mechanism. We compare the proposed mechanism with probability flooding [3] (pf = 0.65) and one of the best reliable broadcasting algorithms that use a fixed compensation recovery mechanism, MISTRAL [9] for various compensation thresholds (fixed c = 2, 5, 10). Our mechanism dynamically adjusts the compensation threshold for FPR and BPR at run-time. We used the periodic request method with dynamic Tm (by default 3) in this simulation. We considered the reachability and traffic overhead in the following metric: (1) the ratio of mobile nodes receiving the packet to the total number of mobile nodes, (2) the total number of transmission bytes. Using the NovaSim simulator [15], we evaluated this metric for the various nodes density and velocity. In each simulation, a source node sends flooding messages to the sink node during 1000 seconds, and then after a cool down period for the BPR process,
260
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
the simulation is terminated. Table 4 shows some of the important simulation parameters. Table 4. Parameters used in the simulation
Parameter
Configuration
Size of field 500m * 500m Distribution of nodes Random distribution Transmission range 80 m Mobility model Random direction mobility model Road model For every 1 second, a source node sends a data message to the sink node. MAC protocol CSMA/CA 2, 20 Cmin , Cmax Tm 3
Figure 6 shows the traffic overhead according to the density of the nodes. These simulations were carried out in a network with velocity of 2 m/s. For comparison, we set the rebroadcast probability of probabilistic flooding (PF) and MISTRAL and our proposed mechanism to 0.65. In addition, we simulate MISTRAL having various compensation thresholds (fixed c = 2, 5, 10). Since MISTRAL employs additional compensation packets, the traffic overhead of MISTRAL is higher than PF. As mentioned earlier, in MISTRAL, the traffic overhead decreases as compensation threshold increases because of lower frequency. In Figure 7 we see that our proposed mechanism shows better network performance than MISTRAL in terms of reachability in all densities. This is because a combination of forward and backward packet recovery mechanisms(FPR and BPR) are used for the packet losses. Nevertheless, the traffic overhead of our proposed mechanism is even lower than MISTRAL (for c ≤ 5, N > 200, where N is the total number of nodes in the network.). This is largely because the FPR is dynamically adaptive to network conditions (host density) and grows more and more dependent on BPR. Thus we can predict that the relative advantage of our proposed mechanism over MISTRAL will be increased as the network gets denser. Figure 8 shows the traffic overhead in the different velocities of the nodes. As mentioned in Section 4, the traffic overhead of our proposed mechanism slightly increases as the node mobility increases. The reason is that as the node increases in speed, the node requests more frequently. However, we achieved significantly higher reliability with lower cost through the dynamic adaptation. Figure 9 shows the impact of hosts velocity. Our adaptive broadcast outperforms MISTRAL in terms of the delivery ratio as the node mobility in-
An Efficient and Reliable Flooding in MANETs Probability Flooding
MISTRAL(c =10)
MISTRAL(c =2) 8.0E+06
Our Self-Adaptive
MISTRAL(c =5)
7.0E+06
Transmission Overhead(bytes)
6.0E+06 5.0E+06 4.0E+06 3.0E+06 2.0E+06
1.0E+06 0.0E+00 100
125
150
175
200
225
250
Number of Nodes
Fig. 6. Traffic overhead according to density Probability Flooding MISTRAL(c =2)
MISTRAL(c =10) Our Self-Adaptive
MISTRAL(c =5)
1 0.98
Reliability
0.96 0.94 0.92 0.9
0.88 0.86 100
125
150
175
200
225
Number of Nodes
Fig. 7. Reliability according to density
250
261
262
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park
creases. The nodes movement may contribute to efficient network partitioning and fast propagations of the information on the missed packet list to the all nodes of the networks. Thus, the higher the mobility, the greater the reliability.
Probability Flooding MISTRAL(c =2)
MISTRAL(c =10) Our Self-Adaptive
MISTRAL(c =5)
1 0.99 0.98
Reliability
0.97 0.96 0.95 0.94 0.93 0.92 0.91 0.9 0m/s
10m/s
20m/s
30m/s
velocity of node
Fig. 8. Traffic overhead according to velocity
6 Conclusion In this paper, we proposed an efficient and reliable method of flooding in MANETs. Our goal is to maximize the reliability of flooding while minimizing network overhead at packet-level. The proposed scheme uses a hybrid of both FPR and BPR (Forward and Backward Packet Recovery). We analyzed the impact of redundancy according to network conditions. Through the analysis, it is shown that there are optimal settings for the compensation threshold in FPR and the number of request packets in BPR in terms of energy-efficiency. In addition, we proposed the self-adaptive mechanism which dynamically adjusts the redundancy parameters to the optimal values in FPR and BPR according to network conditions. Moreover, the self-adaptive mechanism grows more dependent on BPR as the quality of the network conditions increase. Simulation results show that our scheme outperforms several existing flooding mechanisms. In our future work, we will focus on the analysis of end-to-end latency in FPR and BPR.
An Efficient and Reliable Flooding in MANETs Probability Flooding MISTRAL(c =2)
MISTRAL(c =10) Our Self-Adaptive
263
MISTRAL(c =5)
4.60E+06 4.50E+06
Transmission Overhead
4.40E+06 4.30E+06 4.20E+06 4.10E+06
4.00E+06 3.90E+06 3.80E+06 3.70E+06 3.60E+06 0m/s
10m/s
20m/s
30m/s
velocity of Nodes
Fig. 9. Reliability according to velocity
References [1] [2]
[3]
[4] [5]
[6]
[7]
[8]
S. Ni, Y. Tseng, Y. Chen, and J. Sheu. The Broadcast Storm Problem in a Mobile Ad Hoc Network. In Proc. of MOBICOM99,pages 151−162, 1999. C. Ho, K. Obraczka, G. Tsudik, and K. Viswanath. Flooding for Reliable Multicast in Multi-hop Ad Hoc Networks. In Proc. of the Intl Workshop on Discrete Algorithms and Methods for Mobile Computing and Communication, pages 64−71, 1999. Y. Sasson, D. Cavin, and A. Schiper. Probabilistic broadcast for flooding in wireless mobile ad hoc networks. In Swiss Federal Institute of Technology, Technical Report IC/2002/54, 2002. Q. Zhang and D. P. Agrawal. Dynamic probabilistic broadcasting in manets. J. Parallel Distrib. Comput., 65(2):220−233, Feb. 2005. S. Basagni, I. Chlamtac, V. R. Syrotiuk, and B. A. Woodward. A distance routing effect algorithm for mobility(DREAM). In Proc. IEEE/ACM Intl. Conf. on Mobile Computing and Networking MOBICOM, pages 76−84, 1998. S. Alagar, S. Venkatesan, and J. Cleveland, Reliable broadcast in mobile wireless networks, Proc. of Military Communications Conference (MILCOM95),pp. 236−240, Nov. 1995. J. J. Garcia-Luna-Aceves and Y. X. Zhang, Reliable broadcasting in dynamic network, Proc. of 1996 IEEE Intl Conf. on Communications (ICC96), vol. 3, pp. 1630−1634, Jun. 1996. Z. Haas, J. Halpern, and L. Li. Gossip-Based Ad Hoc Routing. In INFOCOM, pages 1707−1716, June 2002.
264 [9]
[10]
[11]
[12]
[13] [14] [15]
J. Jung, Y. Cho, Y. Kim, S. Yi and H. Park P. Stefan, B. Mahesh, MISTRAL: efficient flooding in mobile ad-hoc networks. Proceedings of the seventh ACM international symposium on Mobile ad hoc Network, 2006. Vadim Drabkin, Roy Friedman and Gabriel Kliot, RAPID: Reliable Probabilistic Dissemination in Wireless Ad-Hoc Networks, 26th IEEE International Symposium on Reliable Distributed Systems, Beijing, China, October 2007. C. Bettstetter, The Cluster Density of a Distributed Clustering Algorithm in Ad Hoc Networks, in Proceedings of the IEEE International Conference on Communications, vol. 7 pp. 4336−4340, June 2004. P. M. Melliar-Smith, E. Royer and L. Moser. An Analysis of the optimum node density for Ad Hoc mobile networks. In Proceedings of the IEEE International Conference on Communications, June, 2001. K. Viswanath and K. Obraczka, Modeling the performance of flooding in wireless multi-hop Ad hoc networks, Computer Communications 29, 2006. S. Cho and J. P. Hayes, Impact of Mobility on Connection Stability in Ad Hoc Networks, IEEE Communications Society, 2005. J. Jung, Y. Cho and Y. Kim, Virtual Protocol Stack Interface for Multiple Wireless Sensor Network Simulators, ACM SAC, 2010.
A Fast Agreement Protocol for Underwater Wireless Sensor Networks Hong Min1 , Sangil Eo2 , Joonhyouk Jang3 , Junyoung Heo4 and Gwangil Jeon5 1
2
3
4
5
Seoul National University 301-418, Deahak-dong, Gwanak-gu Seoul, Korea
[email protected] Seoul National University 301-418, Deahak-dong, Gwanak-gu Seoul, Korea
[email protected] Seoul National University 301-418, Deahak-dong, Gwanak-gu Seoul, Korea
[email protected] Hansung University 389, Samseon-dong, Seongbuk-gu Seoul, Korea
[email protected] Korea Polytechnic University 2121, Jeongwang-dong, Siheung-si Gyeonggi-do, Korea
[email protected]
Summary. Clustering protocol is a popular topology in underwater wireless sensor networks because of its energy efficiency. In clustering protocols, cluster heads manage and monitor their member nodes. When a cluster head fails, all member nodes detect and notify their neighbor nodes of the cluster head failure to avoid wasting energy caused by communication with the failed cluster head. Member nodes detect the failure of a cluster head using agreement protocol. This agreement protocol gathers status of their cluster head and decides whether or not a cluster head fails. Therefore, achieving a fast agreement among member nodes is important for saving energy. In this paper, we propose a fast agreement protocol for deciding cluster head failure. We compare our scheme with previous schemes via simulation in terms of delay and accuracy. The evaluation results show that the proposed scheme reduced the agreement latency and improved accuracy.
1 Introduction Underwater Wireless Sensor Networks (UWSNs) are significantly different from terrestrial sensor networks in many aspects, i.e., high latency, high error probability of each node and high communication cost. These characteristics of UWSNs make the exiting work for terrestrial sensor networks unsuitable for UWSNs [10], [23], [24], [25], [26] and [27] . Especially, energy saving and reliable communication are major concerns in UWSNs because sensor nodes are powered by batteries, which are hard to replace or recharge in an underwater environment and high error rate [18]. Therefore, node clustering, which
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 14, © Springer Basel AG 2011
266
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
has been widely studied in UWSNs, is an effective technique for improving energy efficiency and for simplifying the network architecture [2]. There are also many studies to improve the reliability of communication based on clustering protocol [12], [13] [14], [19]. Cluster-based UWSN is similar to traditional cluster-based WSNs. This Clustering protocol elects a cluster head and other nodes transmit sensing data to their cluster head. The cluster head transmits the collected data to an underwater sink that is specially designed to communicate with surface sink. In its role, the cluster head is more important in UWSNs than other nodes [17]. If a cluster-head failure is not accurately detected, it will unnecessarily execute a fault recovery process (cluster head re-election or network re-clustering) and thus waste an amount of energy in sensor networks. To avoid such energy waste, it is important to accurately detect cluster head failure [16]. In the fault detection mechanism, all member nodes gather their decisions of the cluster head failure and share the final agreement through the agreement protocol. Previous agreement protocols have shortcomings in terms of energy efficiency and accuracy, because these protocols do not consider the propagation delay and acoustic signal interference. We propose an efficient agreement protocol aiming to accurately and promptly detect cluster head failure in order to avoid unnecessary energy consumption. To reduce detection time, the proposed protocol uses a time division multiple access medium and uses a packet loss rate-reflected weight compensation function for achieving high accuracy. The rest of this paper is organized as follows. Section 2 describes the network architecture. In section 3, we propose the accurately fast detection mechanism. In section 4, we evaluate the proposed mechanism. Finally, we conclude the paper and present future work in section 5.
2 Underwater Sensor Networks The architecture of terrestrial wireless sensor networks is simple and its topologies had been studied by many researchers. The architecture and topologies of underwater wireless sensor networks are different from terrestrial sensor networks because underwater sensor nodes have some unique features. We explain unique features of underwater wireless sensor networks in terms of the architecture and clustering protocols. 2.1 Architecture A typical architecture of underwater wireless sensor networks is presented in Figure 1 and 2 [1]. In two dimension architecture, a group of sensor nodes are anchored to the bottom of the ocean. Sensor nodes are interconnected to one or more underwater sinks (uw-sinks) by wireless acoustic communication.
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
2QVKRUH &RQWURO&HQWHU 6XUIDFHVLQN 2FHDQVXUIDFH
6HQVRUQRGH 8QGHUZDWHUVLQN
Fig. 1. 2D architecture of UWSNs
2QVKRUH &RQWURO&HQWHU 6XUIDFHVLQN 2FHDQVXUIDFH
6HQVRUQRGH 8QGHUZDWHUVLQN $89
Fig. 2. 3D architecture of UWSNs
267
268
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
Uw-sinks are devices in charge of relaying data from sensor nodes located at the bottom of the ocean to a surface station. The surface station is equipped with an acoustic transceiver capable of handling multiple communications with the deployed uw-sinks. The surface station also supports a long rage RF (Radio Frequency) and satellite transmitter to communicate with the onshore sink and a surface sink. The onshore sink collects data from the surface station and sink and sends commands to them. Three dimension architecture of underwater wireless sensor networks is similar to two dimension one. Uw-sinks that are deployed on the ocean floor send their data to AUVs (Autonomous Underwater Vehicle) or other uwsinks that are neighbor of the surface sink because these uw-sinks can not communicate with the surface sink directly. 2.2 Clustering Protocols
Fig. 3. The concept of a clustering protocol
The UWSNs have some limitations such as harsh environment, high mobility, long propagation delay and limited communication bandwidth. In such conditions, communication failure occurs more frequently in UWSNs than terrestrial sensor networks. Therefore, a technique is needed for alternating the direct communication between the sensor nodes and surface station. The clustering or hierarchical protocol is a way to improve scalability, energy effi-
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
269
ciency and lifetime of the network in UWSNs. Figure 3 shows the concept of a clustering protocol. In [3], the authors proposed an energy efficient clustering protocol called DUCS (Distributed Underwater Clustering Scheme). This scheme is a distributed energy-aware routing protocol designed for UWSNs with random node mobility and that does not require location information. DUCS uses a randomized rotation of the cluster head among the sensors to avoid fast draining the batteries of underwater sensor nodes. Selected cluster heads broadcast an advertisement message to their neighbor nodes by using CDMA (Code Division Multiple Access). Each node that receives the advertisement message from the cluster head sends a join request message to its cluster head. When DUCS finishes the cluster composition phase, the cluster heads set up a TDMA (Time Division Multiple Access) schedule to coordinate the data transmission in its own cluster and sends this timetable to member nodes by using CDMA.
Fig. 4. Time line of clustering protocols
Figure 4 shows the time line of clustering based protocols. The operation of DUCS is divided into rounds. Each round is composed of a setup stage and steady stage. All clusters are formed during the setup stage, and data transmission occurs during the steady stage. A steady stage composes of several frames, and each frame is divided into time slots that are assigned to each member nodes for sending data to a cluster head without communication interference. There is some guard time (GT :δ) in order to avoid acoustic
270
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
collisions at the cluster head when two member nodes using adjacent time slots send their data message. In this scheme, the cluster head can calculate the delay and distance to each member nodes through the time-of-arrival approach that measures the round-trip time of an acoustic signal between the cluster head and a member node [21].
3 Distributed Agreement Protocol In clustering based protocols, distributed agreement protocol is used to detect the cluster head failure. A fast and reliable distributed agreement protocol can save energy consumption and reduce recovery latency. In this section, we explain design issues of distributed agreement protocol for underwater wireless sensor networks and suggest an efficient distributed agreement protocol. 3.1 Requirements The cluster head plays an important role of coordinating its cluster and collecting data from its cluster members in clustering protocols. When a failure occurs at the cluster head, member nodes should quickly and correctly detect the failure of the cluster head [17]. If the member nodes are unaware of the failure at the cluster head, they send meaningless data and waste their energy. Some member nodes determine that a failure of the cluster head occurs though the cluster head is operating properly. This wrong decision causes unnecessary energy consumption due to recovering and re-clustering the network. To detect a cluster head failure, member nodes gather their cluster head status and determine whether or not the cluster head fails by the distributed agreement protocol. Therefore, an efficient and accurate agreement scheme is needed to reduce energy consumption. 3.2 Previous Distributed Agreement Protocol In clustered UWSNs, many recovery schemes have been studied to enhance fault tolerance and reliability. These previous studies were focused on the recovery of a failed cluster. Because analyzing the cause of failure precedes the solution of a problem, an efficient and accurate fault detection scheme is more important than a recovery scheme. The typical fault detection scheme allows each cluster member to check the heartbeat sent by a cluster head and to detect the fault status of its cluster head independently. In this detection scheme, it takes long delays to decision and has low accuracy, because each node determines the failure of its cluster head by itself. Other proposed fault detection schemes such as the localized fault detection [5] and the gossiping based fault detection [6] are not suitable for UWSNs because they do not consider underwater environments.
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
271
u] uZ
u^ OP uX
u[
uY jo OjGP
u\
u_
OP uX
u[
uZ
uY
u\
u]
u^
u_
u_GT u^GT u]GT u\GT u[GT uZGT uYGT uX uXGT uYGT uZGT u[GT u\GT u]GT u^GT u_ OP ͷΠΣΨΒΣΕ ΗΣΒΞΖ ͷΠΣΨΒΣΕ͑ΗΣΒΞΖ ΅΄͡
jo
΅΄ͩ
΅΄ ͨ
͟͟͟
΅΄ͣ
ͳΒΔΜΨΒΣΕ ΗΣΒΞΖ ͳΒΔΜΨΒΣΕ͑ΗΣΒΞΖ ΅΄͢
jt
΅΄ ͡
jo
΅΄͢
΅΄ͣ
͟͟͟
΅΄ͨ
΅΄ͩ
jt
OP
Fig. 5. Broadcasting tree and scheduling timetable
In [2], the authors proposed a cooperative fault detection scheme to improve the accuracy and efficiency of detecting cluster head failures for cluster based UWSNs. This scheme runs concurrently with normal network operations by periodically performing a detection process at each cluster member node. For enhancing the detection accuracy, this scheme makes each cluster member node independently detect the fault status of its cluster head and applies the distributed agreement protocol to reach an agreement on the fault status of the cluster head among several cluster member nodes. Moreover, it uses a TDMA media access control protocol to reduce energy consumption. When cluster head failure occurs, the cluster member nodes cannot communicate with each other within 1-hop range (direct communication) in [16].
272
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
To solve this problem, the cooperative fault detection scheme constructs the broadcasting tree among cluster member nodes as shown Figures 5 (a) and (b). During the broadcasting tree construction phase, this scheme creates the shortest path tree to minimize the communication distance. The cluster head generates and assigns a scheduling timetable from the farthest member node of the root node to its closest one of the root node in Figure 5 (c). Because of the scheduling order, N8 whose depth is the largest in the broadcasting tree sends sensing data and the cluster head status information to the root node. After a forward frame, the root node (N1) gathers all cluster head fault status data and determines the state of the cluster head according to majority. During a backward frame that is in reverse order of a forward frame, the root node informs an agreement to all of child nodes. Therefore, the cooperative fault detection scheme can bound the detection latency to reach an agreement among cluster member nodes by two consecutive frames. The cooperative fault detection scheme ensures high accuracy because the entire member nodes participate in the decision making of cluster head failure. This scheme also reduces energy consumption by sending the cluster head status information over the data packet. However, there are some problems in the cooperative fault detection scheme. This scheme causes additional latency by not considering the acoustic signal time delay in TDMA scheduling. The scheduling timetable generated by the cluster head is broadcasted to member nodes every first time slot of frames (TS0 ). If the member nodes are moved by current, prepared scheduling timetable does not consider the mobility of member nodes and creates some errors. In this condition, the cluster head cannot properly receive data from member nodes. Therefore, we proposed a past distributed agreement protocol to reduce the latency of the agreement propagation phase and to support the mobility of underwater sensor nodes. 3.3 A Fast Agreement Protocol After the time synchronization process initiated by the cluster head is over, the member nodes send data to their cluster head by using TDMA. In Figure 5 (c), N8 is assigned the first time slot among member nodes and starts data transmission. The round delay defined to latency per every round caused by propagating the scheduling timetable occurs between the synchronization phase and the beginning of TDMA transmission, as is shown Figure 6. To reduce the complete time of transmission of all member nodes, we apply DUCS [3] estimating and compensating the propagation delay of each member nodes to the data collection step. N7 sends sensing data to its cluster head in advance to deliver its data as soon as the transmission of N8 is completed. As every round moves forward, the round delay (τr ) is accumulated during the communication latency between the cluster head (CH) and its member node (Nr ) assigned the first time slot of scheduling timetable. If τvk means the round delay between the cluster head andmember node v of kth round, n k then the total round delay of nth round is k=0 Ev∈Th (τv ). For example,
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
273
Fig. 6. Round delay of previous scheme
the propagation delay of N8 is τ8 , because N8 sends data after finishing the time synchronization process. In the case of N7, timing can be known in advance, which is estimated by the cluster head at the scheduling phase, and sends its data to the cluster head in advance. Timing advance of N7 including the transmission delay (τ8 ) and time slot (TS) of N8 are presented by τ8 + T S + δ − τ7 , when δ is the guard time. Though we can reduce the completion time of data transmission by adapting the prediction scheme of DUCS, the round delay problem was not mitigated by the previous scheme. Therefore we proposed a fast distributed agreement protocol to reduce the round delay by considering the distance from the cluster head to its member nodes. If there is a broadcasting tree (T) whose depth is h and nodes are m, Tj (j = 0, 1, ... , h) means the set of nodes whose depth is j, and T0 means a root node. We assume that the cluster head knows distance (dˆi ) and the propagation delay (ˆ τi ) of its member nodes (Ni , i = 1, 2, ..., m) based on the Time of Arrival. Each element of Ti is sorted by an increasing order as the propagation delay to its cluster head (ˆ τi ) and these sorted set Ti are assigned time slots by increasing order as its depth as is shown Figure 6. T2 that
274
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
comprise of N5, N6, N7 and N8 in Figure 5 (b) is sorted T2 such as N5, N6, N7 and N8 by increasing order as τˆi in Figure 7. T1 that is composed of N2, N3 and N4 is also sorted T1 such as N2, N4 and N3. Finally, T0 and T0 select N1 as their element and a root node. After reordering the broadcasting tree, the scheduling list defined as set S = [s1 , s2 , ..., sm ] is generated.
uX OX SG͚͢
uZ OZ SG͚ͤ
uY OY SG͚ͣ
u\ O\ SG͚ͦ
u]
u[ O[ SG͚ͥ
u^
u_
O] SG͚ͧ O^ SG͚ͨ O_ SG͚ͩ u\GT u^GT u]GT u_GT uYGT u[GT uZGT uX uXGT uYGT u[GT uZGT u\GT u^GT u]GT u_ Fig. 7. Modified scheduling policy
In order for node Si to deliver its data to its cluster head on time, it should start its transmission at T AVsi (Timing Advance Value) as follows. Our scheme recalculates T AVsi at the cluster head to consider the node mobility whenever a frame transmission is completed. Therefore, we defined T AVsi (0) as the node Si transmits its first sensing data to its cluster head and T AVsn (n) as its nth sensing data. Where i ≥ 2 and T Sj the allocated time slot of node j,
T AVsi (0) = τS1 + T AVsi (n) = τS1 +
Si−1
j=S1 (T Sj
Sm
j=S1 (T Sj
+ δ) − τSi + δ) +
Si−1
j=S1 (T Sj
+ δ) − τSi
These equations show that the proposed scheme eliminates unnecessary waiting time for completing transmission of other nodes by estimating propagation delay based on the distance to the cluster head. In addition, our scheme minimizes the round delay to τS1 = minv∈Th τˆv . After nth round is over, the
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
275
n total round delay is defined as k=0 minv∈Th τˆvk , and this total round delay of the proposed scheme is much lower than that of previous scheme.
Fig. 8. The round delay of our scheme
Figure 8 shows that the round delay of our scheme is reduced compared with that of the previous scheme in Figure 6. Because our scheme considers the distance to the cluster head during the root node selection step, the round delay is decreased from τ8 to τ5 . This scheme is also able to be bound by two frames to reach the agreement of cluster head failure among member nodes. In addition, our protocol relieves the communication interference among neighbor nodes during the agreement phase. Because this protocol assigned a time slot by increasing order of the distance to the cluster head, the collision between a parent node and child node in the broadcasting tree is avoided. For example, the transmission of N4 is disturbed by the transmissions of N7 and N8 as is shown in Figure 7 in previous scheme. The interference influence is proved via simulation in Section 4. 3.4 Enhanced Agreement Accuracy For enhancing the accuracy of agreement result among member nodes, our distributed agreement protocol employs weighting based on the attenuation of acoustic signal by the distance. This weight value is decreased by increasing the distance between a member node and its cluster head and multiplied by the cluster head failure status vector in order to reflect the decision of closer member nodes rather than one of farther member nodes to the agreement result.
276
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
The following equation means the attenuation of acoustic signal (A(d)) by the distance (d) and the communication frequency (f ) in the ocean [7] and Figure 8 shows a graph of this attenuation.
Fig. 9. The Attenuation of acoustic signal
Where d is the distance (m), f is the frequency (kHz) and α(f ) is the absorption coefficient (dB/km)
A(d) = dad , a = 10α(f )/10 2
2
f f −4 2 α(f ) = 0.11 1+f f + 0.003 2 + 44 4100+f 2 + 2.75 · 10
Figure 9 shows the attenuation of the acoustic signal as the distance and the communication frequency. In UWSNs, the available bandwidth (under 50 kHz) is severely limited due to the extreme characteristics of the underwater channel. As the distance increases, the attenuation also increases rapidly. Therefore, we apply the physical characteristics of underwater environments to gather the cluster head status information of each member node for
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
277
enhancing the accuracy of agreement results and the following equation is a revision function of member node’s weight. Wi =
√
n2
m
i=1
n√ 1 −τi n2 n1 −τi
(n1 , n2 : normalized factor)
Because a member node that is far from its cluster head has high delay and attenuation, the weight value of this node is decreased. If the closed member node makes a wrong decision, the entire agreement result is in turn incorrect. To solve this problem, we use normalized factors in the weight function. When n2 is equal to 1, member node delay influences the weight value linearly. As n2 increases, decisions of all member nodes are reflected in the agreement result at the same rate, that is, the weight value is meaningless.
4 Performance Evaluations We evaluated the performance of our fast distributed agreement protocol by simulation in terms of the agreement delay and the accuracy of agreement result. The proposed scheme is compared with the pure cooperative faultdetection scheme [2] and with the applied prediction scheme in DUCS [3]. We used a wireless sensor network simulator called GlomoSim [8], [22] based on the energy and propagation model of [9] in underwater environments. Table 1. Simulation Environments
Factors Target field size The number of cluster The number of member nodes Communication range Bandwidth The depth of sea Propagation speed Sensing interval Moving speed
Values 50km x 50km 3 10 ˜ 50 3 ˜ 5 km 50 ˜ 70 kHz 50 ˜ 100 m 1500 m/s 5 ˜ 10 minute 0 ˜ 5 m/s
Table 1 describes factors of simulation environment including target field size, the number of cluster, the number of nodes, communication range, communication bandwidth, the depth of sea, propagation speed, sensing interval and moving seed. The value of these factors are referenced by [19], [20] and [21]. Figure 10 and 11 show average round delay of each cluster and the delay of agreement phase of each scheme as the number of nodes increases. We derived these results from the mean of total delay after 100 rounds.
278
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon 10
CFD ECFD FDAP
The average of round delay (sec) T
9 8 7 6 5 4 3 2 1 0
Cluster 1
Cluster 2
Cluster 3
Fig. 10. Average round delay of each cluster
In Figure 11, CFD (Cooperative Fault Detection) is the delay of the pure cooperative fault-detection scheme, ECFD (Enhanced CFD) is CFD of adding the prediction scheme, and FDAP (Fast Distributed Agreement Protocol) is the proposed scheme. Our scheme reduced the delay by up to 43% more than CFD and 27% more than ECFD. As the number of member nodes was increased, the performance of proposed scheme became more efficient than the others. The difference between CFD and ECFD is caused by the propagation delay. When the scheduling timetable for TDMA is composed, CFD ignores the effect of propagation delay. Therefore, the time slot size of CFD is longer than that of ECFD. Our scheme (FDAP) is faster than ECFD because it minimizes the round ndelay and the k communication interference. The round delay of ECFD is k=0 Ev∈Th (τv ) and that of FDAP is nk=0 minv∈Th τˆvk , after n rounds. We found that our n scheme reduced the round delay by k=0 (Ev∈Th (τvk ) − minv∈Th τˆvk ). As the number of member nodes increases, the number of v also increases, which means that the nodes in the cluster are deployed densely. The distance between the cluster head and the root node of the broadcasting tree decreases; therefore, the round delay of our scheme decreases. For achieving accurate agreement determining cluster head failure is also an important issue, and thus we evaluated the accuracy of our scheme in terms of changing the packet loss rate. Figure 12 shows the probability of fault decision that includes false positives and false negatives. The false positives mean the cluster head is normal, but the agreement is the cluster head failure, while the false negatives mean the opposite. As the packet loss rate increases, the agreement accuracy decreases. However, our scheme reflected the decision
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
279
The delay of agreement (sec)
500 450
CFD
400
ECFD
350
FDAP
300 250 200 150 100 50 0 10
20
30
40
50
The number of member nodes
The probablity of fault decision
Fig. 11. Agreement phase delay
4EͲ09 CFD
3.5EͲ09
ECFD
3EͲ09
FDAP(n=10)
2.5EͲ09
FDAP(n=50)
2EͲ09 1.5EͲ09 1EͲ09 5EͲ10 0 0
0.1
0.2
0.3
The packet loss rate Fig. 12. The probability of fault decision
0.4
0.5
280
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
of each member node by weight (Wi ) based on the distance to its cluster head. Thorough the weight compensation, the accuracy of proposed scheme remains reasonable.
The delay of agreement (sec)
1000 900
CFD
800
ECFD
700
FDAP
600 500 400 300 200 100 0 10
20
30
40
50
The number of member nodes
Fig. 13. Agreement phase delay considering the node mobility
For inspecting the affect of sensor nodes mobility, we evaluated agreement phase delay and the probability of fault detection under same conditions of stationary nodes. Sensor nodes moves at 0 ˜ 5 m/s in random direction. Figure 13 shows the agreement phase delay of each scheme. The delay of agreement phase was increased dramatically as increasing the number of member nodes in all schemes because the number of retransmission was increased caused by the node mobility. The difference between CFD and FDAP was decreased comparing with the difference of them when sensor nodes are stationary. In Figure 14, the probability of fault detection of each scheme was higher than one of stationary case. The difference among each scheme was also reduced. As moving speed of sensor nodes increasing, the fault detection rate of ECFD and FDAP was higher than CFD because ECFD and FDAP use the prediction mechanism that member nodes send data packets to its cluster head in advance and this mechanism makes worse the performance. These evaluation results show that the performance of our scheme is better in the case of stationary nodes than one of mobile nodes.
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
281
The probablity of fault deciision
6E-09
CFD
5E-09
ECFD FDAP (n=10)
4E-09
FDAP (n=50) 3E-09 2E-09 1E-09 0 0
0.1
0.2
0.3
0.4
0.5
The packet loss rate Fig. 14. The probability of fault decision considering the node mobility
5 Conclusions Underwater wireless sensor networks have unique features that were not considered in terrestrial wireless sensor networks. The architecture of UWSNs is also different from one of WSNs. Clustering protocols were used for improving the energy efficiency and reliability for UWSNs. In clustering protocols, the mechanism to detect a cluster head failure is considered because the status of cluster headers are more important than normal nodes. In this paper, we proposed a tree-based agreement algorithm that considered the propagation delay of acoustic signal. The proposed scheme reduces the detection time of cluster head failure through time-slot scheduling considering the delay time of cluster head to member nodes. We also proposed a packet loss rate-reflected weight compensation function for achieving cluster head failure detection accuracy. Through the simulation results, we showed that the proposed detection scheme can better achieve high accuracy and speed than the previous agreement scheme. UWSNs have low or medium mobility due to water current and other environmental reasons. Therefore, we will develop a mobility-adaption cluster head failure detection scheme in our future work.
Acknowledgement The ICT (Institute of Computer Technology) at Seoul National University provides research facilities for this study.
282
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
References [1]
Akyildiz, I., Pompili D., Melodia T. : Underwater acoustic sensor networks: research challenges. Ad Hoc Networks 6, 257–279 (2005)
[2]
Wang, P., Zhen, J., Li, C. : Cooperative fault-detection scheme with high accuracy and bounded delay for underwater sensor networks. Wireless Communications and Mobile Computing.(2009)
[3]
Domingo, M. C. : A distributed energy-aware routing protocol for underwater wireless sensor networks. Wireless Personal Communications., 51, 1–21 (2009)
[4]
Cui, J., Kong, J., Gerla, M., Zhou, S. : Challenges: Building Scalable Mobile Underwater Wireless Sensor Networks for Aquatic Applications., IEEE Network, 12–18 (2006)
[5]
Jiang P. : A New Method for Node Fault Detection in Wireless Sensor Networks. Sensors., 1282–1294, (2009)
[6]
Younis, O., Fahmy, S., Santi, P. : An architecture for robust sensor network communications. International Journal of Distributed Sensor Networks., 305–327 (2005)
[7]
Berkhovskikh, L., Lysanov, Y. : Fundamentals of Ocean Acoustics. Springer. (1982)
[8]
Zeng, X., Bagrodia, R., Gerla, M. : GloMoSim: a Library for Parallel Simulation of Large-scale Wireless Networks., the 12th Workshop on Parallel and Distributed Simulations., 154–161 (1998)
[9]
Domingo, M. C., Prior, R. : Energy analysis of routing protocols for underwater wireless sensor networks. Computer Communications., 1227–1238 (2008)
[10]
Heidemann, J., Ye, W., Wills,J., Syed A., Li, Y. : Research Challenges and Applications for Underwater Sensor Networking. The IEEE Wireless Communications and Networking Conference., 228–235, (2006)
[11]
Cayirci, E., Tezcan, H., Dogan Y., Coskun, V. : Wireless sensor networks for underwater surveillance systems. Ad Hoc Networks., 4, 431–446 (2006)
[12]
Shin, D., Kim, D. : FRT: Fast and Reliable Transport Protocol for Underwater Wireless Sensor Networks. IEEE Asia-Pacific Services Computing Conference (IEEE APSCC)., 402–407, (2009)
[13]
Casari, P., Harris, A. F. : nergy-efficient Reliable Broadcast in Underwater Acoustic Networks, The ACM International Workshop on UnderWater Networks (WUWNet)., 49–56, (2007)
A Fast Agreement Protocol for Underwater Wireless Sensor Networks
283
[14]
Guo, Z., Wang, B., Cui, J. : Efficient Error Recovery Using Network Coding in Underwater Sensor Networks. Lecture Notes In Computer Science., 4479, 227–238 (2007)
[15]
Chen, J., Wu X., Chen, G. : REBAR: A Reliable and Energy Balanced Routing Algorithm for Uunder Water Sensor Networks. the 7th International Conference on Grid and Cooperative Computing., 349–355 (2008)
[16]
Wang, P., Zheng, J., Li, C. : Cooperative fault-detection mechanism with high accuracy and bounded delay for underwater sensor networks. WIRELESS COMMUNICATIONS AND MOBILE COMPUTING., 9, 143–153 (2009)
[17]
Zheng, J., Wang, P., Li, C., Mouftah, H. T. : An Efficient FaultPrevention Clustering Protocol for Robust Underwater Sensor Networks. IEEE International Conference on Communications., 3263–3268 (2008)
[18]
Sozer, E., Stojanovic, M., Proakis, J. : Underwater acoustic networks. IEEE Journal of Oceanic Engineering., 25, 72–83 (2000)
[19]
Che, X., Wells, I., Dickers, G., Gong, X, Rhodes, M. : A Static Multi-Hop Underwater Wireless Sensor Network Using RF Electromagnetic Communications, the 29th IEEE International Conference on Distributed Computing Systems Workshops., 460–463, (2009)
[20]
Yunus, F., Ariffin, S. H. S., Zahedi, Y. : A Survey of Existing Medium Access Control (MAC) for Underwater Wireless Sensor Network (UWSN), Fourth Asia International Conference on Mathematical/Analytical Modelling and Computer Simulation., 544–549 (2010)
[21]
Chen, Y., Juang, T., Lin, Y., Tsai, I. : A Low Propagation Delay Multi-Path Routing Protocol for Underwater Sensor Networks. Journal of Internet Technology., 11, 153–165 (2010)
[22]
Bajaj, L., Takai, M., Ahuja, R., Tang, K., Bagrodia, R., Tang, K. : GloMoSim: A Scalable Network Simulation Environment. UCLA Computer Science Department Technical Report 990027. (1999)
[23]
Akyildiz, I. F., Su, W., Sankarasubramaniam, Y., Cayirci, E. : Wireless sensor networks: a survey. Computer Networks., textbf38, 393–422 (2002)
[24]
Felemban, E., Lee, C., Ekici, E. : MMSPEED: Multipath Multi-SPEED Protocol for QoS Guarantee of Reliability and Timeliness in Wireless Sensor Networks. IEEE transactions on Mobile Computing., textbf5, 738–754 (2006)
[25]
Wan, C., Campbell, A. T., Krishnamurthy, L. : PSFQ: a reliable transport protocol for wireless sensor networks. the 1st ACM international workshop on Wireless sensor networks and applications., 1–11 (2002)
284
Hong Min, Sangil Eo, Joonhyouk Jang, Junyoung Heo and Gwangil Jeon
[26]
Krishnamachari, B., Iyengar, S. : Distributed Bayesian algorithms for fault-tolerant event region detection in wireless sensor networks. EEE transactions on Computers., textbf53, 241–250 (2004)
[27]
Gupta, G., Younis, M. : Fault-Tolerant Clustering of Wireless Sensor Networks. the IEEE Wireless Communication and Networks Conference., 1579–1584 (2003)
Autonomous traffic management for CDMA-based real-time services in in-building environments Woon-Young Yeo1 and Hyukjun Oh2 1
2
Department of Information and Communication Engineering, Sejong University, 98 Gunja-dong, Gwangjin-gu, Seoul, Korea (
[email protected]) Department of Electronics and Communications Engineering, Kwangwoon University, Wolgye-dong, Nowon-gu, Seoul, Korea (hj
[email protected])
Summary. The CDMA-based IS-856 standard provides high-speed wireless Internet connectivity to mobile subscribers and is well suited for the packet data applications. The IS-856 access point can be used as a small base station designed for in-building environments to improve the in-building signal coverage and quality. The standard has an autonomous traffic management algorithm for the reverse-link transmission. In order to support delay-sensitive real-time services, it is essential to guarantee the minimum data rate over the air interface. In this paper, it is pointed out that some data rates in IS-856 are not suitable for the real-time voice services and they need to be avoided during the traffic management. In the proposed schemes, the original traffic management is improved by suppressing the excessive fluctuations of traffic load and by restricting the operation range of data rates. The analysis results show that the proposed schemes can improve the reverse-link performance and effectively support real-time services at the same time.
Key words: high-speed wireless network, real-time communications, autonomous traffic management
1 Introduction The CDMA (code division multiple access) technology was designed to support wideband services at high data rates including voice and data services. The third generation partnership project 2 (3GPP2) proposed the TIA/EIA IS-856 standard as the high-speed Internet access based on the CDMA technology [GPP02]. The standard is considered as an evolution of cdma2000, and the International Telecommunication Union (ITU) approved the standard as a member of IMT-2000 family. IS-856 is suitable for packet data services which are characterized by asymmetric data rates.
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 15, © Springer Basel AG 2011
286
Woon-Young Yeo and Hyukjun Oh
The IS-856 access point can be used as a small-scale base station designed specifically for indoor coverage. In the wireless industry, such an access point is called a femto access point (FAP) [BBF09]. The FAP communicates with the access terminals over the standard-based radio interface using licensed spectrum and connects to the access network infrastructure over the fixed broadband connection. The FAP can improve the in-building signal coverage and quality, offload the macro base stations from indoor users, support trafficintensive services that require high data rate, and introduce new femto-specific applications and services. In this paper, the IS-856 technology is adopted in the in-building environment, where the isolated access point provides a wireless, high-speed Internet services to access terminals. The main objective of the IS-856 standard is to improve the forward link that is shared by multiple access terminals. The reverse link improvement has not been strongly required due to the asymmetric nature of data traffic. However, there can be a lot of data services that need high-speed transmission from access terminals (e.g., file upload, multi-media messaging and personal broadcasting). Thus, an efficient multiple access algorithm is also required for the reverse-link operation. The reverse-link interference should be kept within an acceptable level in the CDMA-based system. In order to control the interference with minimum signaling, the IS-856 standard adopted an autonomous traffic management model on the reverse link. The access terminals determine their data rates by using a binary command from the access point and the rate-transition probabilities. The capacity of the IS-856 reverse link has been discussed intensively in the literature [Est02], [HGB02]. [CPE01]. The reverse-link traffic management was modeled as a Markov process with a full-buffer analytical model in [YC05]. Most of the research works have concentrated on the performance evaluation of non-real time data services. In the IS-856 network, the real-time services including voice and video telephony need to be transported over the IP networks. In order to effectively support delay-sensitive real-time services over the IP network, it is essential to guarantee the minimum data rate over the air interface. In this paper, we first expand the analytical model in [YC05] to consider more generalized operations of the IS-856 traffic management. Next, this paper points out that some data rates in IS-856 are not suitable for the real-time services and they need to be avoided during the traffic management. An autonomous traffic management scheme is proposed to effectively support the real-time services and to improve the reverse-link throughput. The remainder of this paper is organized as follows. The reverse-link channel structure and the traffic management algorithm are explained in Section 2. The generalized traffic management model is introduced and analyzed in Section 3. The proposed autonomous traffic management is explained and analyzed in Section 4. The proposed schemes are compared with the conventional IS-856 traffic management in Section 5 through numerical analysis. Section 6 concludes this paper.
Autonomous traffic management
287
Reverse Traffic Channel
Pilot
MAC
Reverse Rate Indicator (RRI)
ACK
Data
Date Rate Control (DRC)
Fig. 1. IS-856 reverse traffic channel structure.
2 Physical channel and traffic management The IS-856 standard has a carrier bandwidth of 1.25 MHz and uses a directsequence spread waveform at a rate of 1.2288 Mcps. A time slot is 1.66... ms long (2048 chips) and a frame consisting of 16 slots (26.66... ms) is a basic transmission unit on the reverse link. In this section, the physical channel structure of IS-856 and the reverse-link traffic management is explained. 2.1 IS-856 physical channel structure The IS-856 forward link consists of a pilot channel, a medium access control (MAC) channel, a control channel and a traffic channel. All channels on the forward link are time-division multiplexed, and they are transmitted at a same power level. The pilot channel is used in system acquisition, tracking/demodulation, active set management and channel estimation at the access terminal. The MAC channel consists of a reverse activity (RA) channel and 59 reverse power control (RPC) channels. Each of these MAC channels carries 1-bit information and is modulated by a 64-ary orthogonal Walsh function. The RA channel carries a reverse activity bit, which is very important information for the reverse-link traffic management. The RPC channel carries a power control bit for a specific access terminal at a 600 Hz update rate. The control channel carries control messages broadcast to all access terminals, and the traffic channel carries user data packets. The forward traffic channel is shared by all access terminals in a coverage area and supports data rates from 38.4 kbps to 2.4 Mbps, depending on channel conditions. The reverse link consists of an access channel and a reverse traffic channel. The access channel is used to send signaling messages to the access network in an idle mode, and the reverse traffic channel is assigned to each access terminal in an active mode. The access channel is identified by a distinct channel-specific long code, whereas each reverse traffic channel is identified by a distinct user-specific long code. The reverse traffic channel is assigned to each access terminal, and is used by the access terminal to transmit userspecific traffic or signaling information to the access network. Fig. 1 shows the
288
Woon-Young Yeo and Hyukjun Oh
reverse traffic channel structure. The traffic channel consists of a pilot channel, a reverse rate indicator (RRI) channel, a data rate control (DRC) channel, an acknowledgement (ACK) channel and a data channel. Each channel in the reverse traffic channel is spread by an appropriate orthogonal Walsh function. The pilot channel is used for channel estimation and coherent detection at the access point, and it transmits unmodulated symbols with a binary value of ‘0’. The pilot channel is time-multiplexed with the RRI channel, and the two channels are transmitted with the same Walsh code. The power allocated to other channels is adjusted by a fixed gain relative to the pilot channel. The RRI channel is used to indicate the data rate of the associated data channel, and is time-multiplexed with the pilot channel. The data rate is represented by a three-bit RRI symbol. The RRI symbol is encoded into a 7bit codeword by a simplex encoder. Then, each codeword is repeated 37 times and the last 3 symbols are punctured. The RRI is time-division multiplexed into the first 256 chips of every slot. The DRC channel informs the access network of the best serving access point and the supportable data rate on the forward traffic channel. The requested forward data rate is mapped into a four-bit DRC symbol. An 8-ary Walsh function corresponding to the selected access point is used to spread the DRC transmission. Each DRC codeword is transmitted twice per slot, and the same value is transmitted over DRCLength slots. The DRC channel gain relative to the pilot channel, GDRC , is a function of DRCLength [HGB02]. The ACK channel informs the access network whether or not a data packet transmitted on the forward traffic channel has been successfully received. The access terminal transmits an ACK bit in response to the received forward traffic channel. A ‘0’ bit (ACK) is transmitted on the ACK channel if a forward physical layer packet has been successfully received. Otherwise, a ‘1’ bit (NAK) is transmitted. The data channel carries user data packets and five data rates are available on the data channel: Ri = 9.6 · 2i−1 kbps, i = 1, · · · , 5. The data channel uses a packet composed of 16 slots, and the packet is encoded using either rate 1/2 or rate 1/4 parallel turbo code. Table 1 shows modulation parameters of the data channel. The power allocated to the data channel is adjusted by a fixed gain relative to the pilot channel to guarantee the desired performance. The data channel gain relative to the pilot channel, Gdata (Ri ), has a value determined by the data rate Ri . The default data channel gain is shown in Table 1 with a corresponding data rate. 2.2 Autonomous traffic management The CDMA system is interference-limited, and the spectral efficiency of a CDMA network can be theoretically derived from the load equation [HT07]. The load equation is related with the interference at the access point and predicts the amount of the noise rise, which is defined as the ratio of the total
Autonomous traffic management p1 | RAB=0
R1
p2 | RAB=0
R2 q2 | RAB=1
9.6 kbps
R3
q3 | RAB=1
19.2 kbps
p3 | RAB=0
p4 | RAB=0
R4 q4 | RAB=1
38.4 kbps
289
R5 q5 | RAB=1
76.8 kbps
153.6 kbps
Fig. 2. Data rate transition diagram for reverse-link traffic management.
received power to the background noise power [GPP03]. The noise rise, η, is defined as PT (1) η PN where PT is the total received power at the access point and PN is the thermal noise power. The noise rise increases as the data rates of access terminals increase. The reason is that a higher data rate requires a higher transmission power to maintain the same signal quality. The IS-856 reverse link has an autonomous traffic management algorithm [GPP02]. An access point broadcasts a reverse activity bit (RAB) on the RA channel, indicating whether or not the reverse-link traffic load exceeds a certain threshold. The reverse-link traffic load is typically measured by the noise rise in Eq. (1). The main goal of the reverse-link traffic management is to maintain the reverse-link traffic load around a target threshold. If the noise rise η exceeds the threshold ηth , the RA channel transmits the RAB of 1; otherwise, it transmits the RAB of 0. The basic operation of the autonomous traffic management can be described by a diagram in Fig. 2 assuming full-buffer transmission. An access terminal has an initial data rate of R1 , and determines the data rate of the next frame according to the autonomous model. Each terminal utilizes the latest RAB value and rate-transition probabilities (pi and qi ) for the data rate decision. If an access terminal with a data rate of Ri receives an RAB of 0, it increases the data rate to the next higher rate with probability pi , Table 1. Parameters for the reverse-link data channel
symbol
data rate (kbps)
R0 R1 R2 R3 R4 R5
0 9.6 19.2 38.4 76.8 153.6
packet size (bits) 0 256 512 1,024 2,048 4,096
coding modulation rate 1/4 1/4 1/4 1/4 1/2
BPSK BPSK BPSK BPSK BPSK
channel gain (dB) −∞ 3.75 6.75 9.75 13.25 18.5
290
Woon-Young Yeo and Hyukjun Oh
and stays at the current rate with probability 1 − pi . If the access terminal receives an RAB of 1, it decreases the data rate to the next lower rate with probability qi , and stays at the current rate with probability 1 − qi . The data rate of the access terminal cannot exceed RateLimit, which is a system parameter. The access terminal may receive the RateLimit parameter from the access point. The value of RateLimit may be set to a value equal to or lower than R5 . More detailed and additional requirements regarding the traffic management can be found in [GPP02].
3 Generalized analysis model for traffic management In [YC05], the traffic management was modeled as a Markov process with a full-buffer analytical model, wherein all access terminals never take a zero data rate. In this section, the analysis model is expanded to consider the access terminals with no data packets. When an access terminal has no data to transmit, it does not use the reverse data channel and its data rate is denoted by R0 (= 0 kbps). Nevertheless, other reverse-link channels are still used to maintain the connection. In this generalized model, if an access terminal has data to transmit, it has an initial data rate of R1 , and determines the data rate of the next frame according to the autonomous management model. If the access terminal finishes the transmission, it releases the data channel and takes a data rate of R0 . 3.1 Noise rise calculation Before introducing a generalized analysis model, the mathematical expression of the noise rise is obtained by adopting the similar procedure in [YC05]. The mathematical expression is derived assuming an in-building environment with a single access point. The data rate of terminal j is denoted by rj and the corresponding data channel gain by Gdata (rj ), where rj ∈ {Ri , i = 0, · · · , 5}. In addition, the DRC channel gain relative to the pilot channel is denoted by GDRC . The recommended value of GDRC is a function of DRCLength [HGB02]. The effect of the ACK channel on the total received power is negligible because only one access terminal, at most, occupies the ACK channel at a time. Therefore, the received power of terminal j at the access point, Pj , is expressed as Pj = c(rj ) · P j ,
(2)
where c(rj ) 1 + 10Gdata (rj )/10 + 10GDRC /10 , and P j is the received pilot channel power of terminal j. Assuming perfect power control, the transmission power of an access terminal immediately converges to the optimal value after access terminals change their data rates. The reverse link power control of IS-856 is based on signal quality measurements at the access point, and maintains the signal quality
Autonomous traffic management p1|RAB=0
R1
p2|RAB=0
R2
R3
q2|RAB=1 q3|RAB=1
γ1
λ
p3|RAB=0
γ2
γ3
p4|RAB=0
R4
q4|RAB=1
γ4
291
R5
q5|RAB=1
γ5
R0 Fig. 3. Generalized traffic management model
of the pilot channel at a certain target level. The signal quality is usually measured by E c /N0 (ratio of pilot energy per chip to noise power spectral density), which is closely related to the packet error rate [Est02]. The E c /N0 of terminal j, (E c /N0 )j , is expressed as (E c /N0 )j =
Pj PT − Pj
(3)
using the orthogonal property of Walsh functions. Since the target value of (E c /N0 )j depends on the data rate of terminal j [Est02], we can denote the target value by τ (rj ). Then, after the transmission power of an access terminal converges to the optimal value, P j can be expressed as Pj =
PT . c(rj ) + 1/τ (rj )
(4)
Let Tbe the number of access terminals in a coverage area. From PN = PT − Tj=1 Pj , the noise rise, η, is given by ⎛ η = ⎝1 −
T j=1
⎞−1 c(rj ) ⎠ . c(rj ) + 1/τ (rj )
(5)
In (5), η can take a negative value depending on the data rate distribution of access terminals. This means that, even at the maximum power of an access terminal, it is difficult to satisfy the required E c /N0 . Therefore, if T j=1 c(rj )/(c(rj ) + 1/τ (rj )) > 1, the value of η is regarded as ∞. 3.2 Generalized model Fig. 3 shows the generalized management model for an access terminal. The data inter-arrival time in an access terminal is modeled as a geometric distribution with parameter λ. Thus, the idle period is 1/λ frames on average.
292
Woon-Young Yeo and Hyukjun Oh
When data packets are available, the access terminal begins to transmit the packet with a data rate of R1 . It may change the data rate between R1 and R5 based on the RAB value and rate-transition probabilities. The total size of an arriving data packet is modeled as a geometric distribution with an average size of A kbits. When the buffer is empty, the data rate returns to R0 . A return probability γi is defined as a probability that an access terminal with a data rate of Ri finishes the transmission and goes to a data rate of R0 . γi = Ri · TF rame /A,
i = 1, · · · , 5.
(6)
where TF rame is the frame length in seconds. In this generalized model, each access terminal can take one of six data rates and move to other data rates more freely. A system state is defined as S(k) = (S1 (k), S2 (k), S3 (k), S4 (k), S5 (k)).
(7)
where Si (k) is the number of access terminals having a data rate of Ri at the 5 k-th frame. S0 (k) can be deduced from S0 (k) = T − i=1 Si (k). Since there are six levels of data rates and each of T access 5 terminals can take one of them, the number of valid states that satisfy i=0 Si (k) = T is given by T +5 The number of states = . (8) T The noise rise calculated by (5) is related to the data rate distribution of access terminals. Therefore, the noise rise for a state x = (x1 , x2 , x3 , x4 , x5 ), η(x), can be expressed as η(x) =
1−
5 i=0
xi c(Ri ) c(Ri ) + 1/τ (Ri )
−1
(9)
5 where x0 = T − k=1 xk . Let ηth be the noise rise threshold of the traffic management. If η(x) ≥ ηth , the RAB is set to 1. Otherwise, it is set to 0. Since the traffic load is determined by (9), we can see that the resulting RAB depends on the current state, and not on previous states. Therefore, this system model can be considered as a first-order discrete Markov process. Let x = (x1 , x2 , x3 , x4 , x5 ) and y = (y1 , y2 , y3 , y4 , y5 ) be samples of S(k) and S(k + 1), respectively. Then, the valid range of y should satisfy the following inequalities: 0 ≤ yi ≤
i+1
xk , for i = 1, · · · , 5.
k=i−1
where x6 0 for compact expression. A state transition probability pxy is defined as
(10)
Autonomous traffic management
pxy Pr(S(k + 1) = y|S(k) = x).
293
(11)
If y is not in the valid range, pxy will be 0. The transition probability can be obtained by conditioning on some random variables. We assume that there are Gi terminals that finish the data transmission at a data rate of Ri during the k-th frame. Thus, the Gi terminals will have a data rate of R0 at the (k + 1)-th frame. In addition, Ui and Di terminals (out of the remaining xi − Gi terminals) increase and decrease their rates from a data rate of Ri , 5 5 respectively. If we define ei k=i (yk − xk ) and Bi k=i Gk , the pxy can be equivalently transformed to pxy = Pr(U − D − B = e|S(k) = x)
(12)
where U = (U0 , U1 , U2 , U3 , U4 ), D = (D1 , D2 , D3 , D4 , D5 ), B = (B1 , B2 , B3 , B4 , B5 ), and e = (e1 , e2 , e3 , e4 , e5 ). Let Ni be the number of terminals (out of the xi − Gi terminals) that decode the RAB as 0 at a data rate of Ri . By conditioning on Gi , Ni and Di , pxy in (12) is rewritten as pxy = Pr(D = u − b − e|u, n, g, x) g
n
u
×Pr(U = u|n, g, x) · Pr(N = n|g, x) · Pr(G = g|x)
(13)
where N = (N1 , N2 , N3 , N4 , N5 ) and G = (G1 , G2 , G3 , G4 , G5 ). Letting z be an RAB decoding error probability that the received RAB is decoded as the opposite value, each term in (13) is expressed as follows. Pr(G = g|x) =
5 xi gi
i=1
γi gi (1 − γi )xi −gi
⎧ 5 xi − gi ⎪ ⎪ n ⎪ (1 − z) i z xi −gi −ni , x ∈ {xu } ⎪ ⎨ ni Pr(N = n|g, x) = i=1 5 ⎪ xi − gi ⎪ x −g −n ⎪ z ni (1 − z) i i i , x ∈ {xo } ⎪ ⎩ ni
(14)
(15)
i=1
Pr(U = u|n, g, x) =
4 ni ui
i=1
×
pi ui (1 − pi )
x0 e1 + b1
Pr(D = u − b − e|u, n, x) =
ni −ui
λe1 +b1 (1 − λ)x0 −e1 −b1
(16)
5 xi − gi − ni qi ui−1 −bi −ei ui−1 − bi − ei
i=2
×(1 − qi )xi −gi −ni −ui−1 +bi +ei
(17)
294
Woon-Young Yeo and Hyukjun Oh
In (15), {xu } is a set of x that satisfies η(x) < ηth , and {xo } is a set of x that satisfies η(x) ≥ ηth . In (16) and (17), U0 = e1 +b1 and D1 = 0 because R1 is the lowest data rate for the access terminals having a non-empty buffer. In (13), the ranges of g, n and u are {g|0 ≤ gi ≤ xi , i = 1, · · · , 5, and y0 − x0 ≤ 5 i=1 gi ≤ y0 }, {n|0 ≤ ni ≤ xi −gi , i = 1, · · · , 5} and {u|max(0, bi+1 +ei+1 ) ≤ ui ≤ min(ni , xi+1 −gi+1 −ni+1 +bi+1 +ei+1 ), i = 1, · · · , 4}, respectively. Note that each state is accessible from all other states. Thus, the Markov model is irreducible, aperiodic and positive recurrent, and there will be a unique steadystate probability πx for a state x = (x1 , x 2 , x3 , x4 , x5 ). {π x } can be obtained by solving a set of linear equations πy = ∀x pxy πx and ∀x πx = 1.
4 Traffic management for real-time services Generally, the wireless services can be classified into four QoS classes: Conversational class, Streaming class, Interactive class and Background class [GPP07]. The main distinguishing factor between the four traffic classes is how delay sensitive the traffic is: the Conversational class is very delay sensitive, while the Background class is the most delay insensitive class. Conversational and Streaming classes are used to serve real-time traffic flows which are very sensitive to the delay. The typical Conversational services include voice, video telephony and video gaming, and Streaming services include multimedia, video on demand and webcast. Interactive class and Background classes are mainly meant for applications like WWW (world wide web), E-mail, FTP, news and Telnet services. These classes are less delay sensitive compared to the Conversational and Streaming classes, but they expect high throughput and low error rates. The scheduling algorithm gives more priority to the interactive class than the background class. In order to effectively support delay-sensitive real-time services, it is essential to guarantee the minimum data rate over the air interface. Thus, a particular parameter ‘guaranteed bit rate (GBR)’ has been introduced for the real-time services. The GBR defines the minimum bit rate that the access network must provide and it can be used in admission control and in resource allocations. The non-real time services do not require the GBR. Since the IS-856 utilizes an IP-based network to provide a high speed data transmission, all real-time services will be supported in the form of IP-based applications. The typical real-time services over IS-856 networks include the VoIP (voice over IP), video telephony and a lot of data streaming services. The VoIP and video telephony services generally require 12.2/16 kbps (AMRNB/AMR-WB) and 64–384 kbps (MPEG4 or H.264), respectively, in the application layer [HT07]. Considering the protocol headers in the IP network, the data rate in the physical layer is higher than that in the application layer, even though the header compression techniques are used. In the IS-856 network, the reverse traffic channel supports the data rate of 9.6–153.6 kbps. If the VoIP service is supported by the IS-856 air interface,
Autonomous traffic management
295
the minimum GBR should be at least 19.2 kbps (R2 ) on the reverse traffic channel. However, the 1xEV-DO traffic management heavily depends on the RAB from the access point, and the resulting data rate can take any state including 9.6 kbps (R1 ). Therefore, a data rate of R1 is not suitable for the real-time voice service. In this section, a new autonomous traffic management scheme is proposed to improve the reverse-link throughput and to effectively support the real-time services. In the proposed schemes, the original traffic management is improved by suppressing the excessive fluctuations of traffic load (load smoothing) and by restricting the operation range of data rates (data-rate restriction). 4.1 Traffic load smoothing The proposed algorithm can be applied to the general wireless services including real-time and non-real-time services, because it suppresses the excessive fluctuations of traffic load and stabilizes the reverse-link traffic load. Suppose that the noise rise is lower than ηth . Then, the IS-856 traffic management induces the terminals to increase their data rates and thus the noise rise increases to the value higher than ηth . For heavy traffic above ηth , the traffic management decreases the noise rise below ηth . Therefore, it is easily inferred that the traffic management causes the noise rise to fluctuate around ηth [Est00]. The fluctuation of the reverse traffic load may make the reverse-link unstable, but it is unavoidable in the IS-856 standard because the RAB contains a simple binary (up/down) command. In order to maintain the system stability, the traffic load must be prevented from fluctuating unnecessarily. In the proposed scheme, the access point broadcasts more precise information about the traffic load status, i.e. low, medium and high traffic loads. For low and high traffic loads, the access terminals change their data rates exactly the same as the conventional terminals do with the rate-transition probabilities {pi } and {qi }, respectively. For a medium load, the access terminals do not change their data rates, thus maintaining the current traffic load. This section first describes how to transmit the status information to the access terminals and then explains the load smoothing algorithm in more detail. The three-level status information about the reverse traffic load can be conveyed over the current RA channel by interpreting the received RAB differently in the access terminal. Note that at least 2 bits are required to indicate the three states and the RAB is broadcast to all access terminals with a period of RABLength, which can take 8, 16, 32, or 64 slots [GPP02]. In the proposed scheme, the RABLength slots are divided into two parts with a duration of RABLength/2 slots and each bit is transmitted alternately on the RA channel. For example, with a RABLength of 16 slots, the access point transmits the first bit during the first 8 slots and the second bit during the next 8 slots. The status information can be represented using arbitrary bit-patterns. In the proposed scheme, all bit-patterns of 00, 01, 10, and 11 are used to indicate the reverse traffic load; ‘00’ for low, ‘01’ for high, and ‘1–’ for medium traffic
296
Woon-Young Yeo and Hyukjun Oh Table 2. Noise rise and RAB
noise rise (η) status 0 ≤ η < ηth − Δη low medium ηth − Δη ≤ η < ηth ηth ≤ η < ηth + Δη medium ηth + Δη ≤ η < ∞ high
RAB 00 10 11 01
loads. The mapping relationship between the current noise rise η and the corresponding RAB is shown in Table 2, where Δη is a system parameter that determines the range of the medium traffic load. Because access terminals receive more precise information about the traffic load status, there can be a wide variety of management algorithms that utilize the status information for performance improvement. One candidate is to assign a different persistence probability for each status, so that the reverselink traffic can be controlled delicately. In the proposed scheme, if the noise rise is within the medium traffic load, the access terminals maintain the current data rates. This policy prevents the noise rise from unnecessarily fluctuating around the threshold. Therefore, if an access terminal receives an RAB of 10 or 11 (i.e. ηth − Δη ≤ η < ηth + Δη, medium traffic load), it does not change the data rate in the next frame. In addition, if an access terminal with a data rate of Ri receives an RAB of 00 (low traffic load), it increases the data rate to the next higher rate with probability pi and remains at the current rate with probability 1 − pi . For an RAB of 01 (high traffic load), it decreases the data rate to the next lower rate with probability qi and remains at the current rate with probability 1 − qi . 4.2 Data-rate restriction The autonomous traffic management makes the access terminal to take any data rate among the five data rates (R1 to R5 ). In order to effectively support the real-time services, it is required to maintain the minimum GBR as high as possible. In addition, since the high data rate causes the excessive interference at the access point, the access terminals should take the data rates as low as possible. Thus, this paper proposes to restrict the allowable data rates in the access terminals. The maximum data rate is already given by RateLimit, which is the highest data rate that the access terminals can take. Since the minimum data rate is not defined in the specification, we assume that the minimum data rate can be broadcast to the access terminals in this paper. From Eq. (9), we can obtain the maximum data rate with which the traffic management does not work at all, assuming that all access terminals have the maximum data rate. The maximum data rate is called the reference data rate, Rr , in this paper. Letting T be the number of access terminals in the coverage area, Rr is set to as follows:
Autonomous traffic management
Rr = max { Ri | 1 − i=1,··· ,5
T c(Ri ) c(Ri ) + 1/τ (Ri )
297
−1 < ηth }.
(18)
In this paper, the neighboring data rates centered on Rr are taken as the minimum and maximum data rates. The minimum data rate, Rmin , and the maximum data rate, Rmax , are given by Rmin = max(R1 , Rr−1 )
(19)
Rmax = min(R5 , Rr+1 ).
(20)
Note that the number of allowable data rates can be two or three, depending on Rr in Eq. (18). Due to the restricted data rates from Eq. (18)–(20), more stable traffic management can be expected and the proposed scheme has a guaranteed data rate Rmin that can be higher than R1 . 4.3 Combined traffic management The proposed schemes are expected to give a significant gain in system stability and data throughput. Even though each of them can be independently applied to the IS-856 traffic management, they can be combined to effectively support the real-time services and improve the data throughput. The combined method can be summarized as follows: Step 1: The access point calculates Rmin and Rmax from (19) and (20), respectively, when a new connection is accepted or one of connections is released. Step 2: An access terminal sets Rmin and Rmax according to broadcast messages or dedicated signaling messages from the access point. Step 3: The access terminal with Ri determines the data rate of the next frame, Rnew , based on the RAB and rate-transition probabilities: a) RAB=00: Rnew = min(Ri+1 , Rmax ) with probability pi . b) RAB=1–: Rnew = Ri with probability 1. c) RAB=01: Rnew = max(Ri−1 , Rmin ) with probability qi . Step 4: If the service is not terminated, go to step 3 in the next frame. 4.4 Performance analysis In this section, the combined traffic management is analyzed with a multidimensional discrete Markov process. Letting L be the value of RABLength, the access point transmits the first bit during the first RABLength/2 slots and the second bit during the next RABLength/2 slots. In each slot, the access terminal decodes the RAB value as the opposite value with probability zs . After an access terminal receives the RAB during the L/2 slots, it decides via a majority decision whether a binary 0 or 1 has been received. If the
298
Woon-Young Yeo and Hyukjun Oh
access point transmits a binary 0, each access terminal regards it as 1 with probability z01 , which is given by z01 =
L/2 L/2 i=0
i
(1 − zs )i · zsL/2−i .
(21)
Similarly, for a binary 1, each access terminal interprets it as 0 with probability z10 , which is given by L/2−1
z10 =
i=0
L/2 i
(1 − zs )i · zsL/2−i .
(22)
In (21) and (22), if the number of binary 0s is equal to that of binary 1s, the received RAB is interpreted as a binary 1. In this analysis, a full-buffer transmission is assumed, and the access terminal takes a data rate between Rmin and Rmax . A system state S(k) of the proposed scheme is defined as a vector S(k) = (Smin (k), · · · , Smax−1 (k)). max−1 Smax (k) is given by Smax (k) = T − i=min Si (k) and thus it is not required in the definition of S(k). The noise rise for a state x = (xmin , · · · , xmax−1 ), η(x), can be easily obtained by Eq. (9) with xi = 0, i ∈ / {min, · · · , max}. Since the RAB is decided by the current noise rise in the proposed scheme, the resulting RAB depends on the current state and not on the previous states. This system model can be considered as a 4-dimensional discrete Markov process. Let Ui and Di be the number of access terminals that increase and decrease the data rates, respectively, from the data rate of Ri at the beginning of the (k + 1)-th frame. Let x = (xmin , · · · , xmax−1 ) and y = (ymin , · · · , ymax−1 ) be the samples of S(k) and S(k +1), respectively. The state transition probability pxy Pr(S(k + 1) = y|S(k) = x) can be transformed to pxy = Pr(D − U = e|S(k) = x), where D = (Dmin+1 , · · · , Dmax ), U = (Umin , · · · , Umax−1 )), i e = (emin , · · · , emax−1 ), and ei k=min (yk − xk ). Let Mi be the number of access terminals that decode the first bit of RAB as 0 at the data rate of Ri , and Ni be the number of access terminals (out of the Mi terminals) that decode the second bit of RAB as 0. Then, by conditioning on Mi , Ni and Ui , pxy is expressed as Pr(D = u + e|u, n, m, x) pxy = m
n
u
×Pr(U = u|n, m, x)Pr(M = m, N = n|x)
(23)
where M = (Mmin , · · · , Mmax ) and N = (Nmin , · · · , Nmax ). Each probability in (23) can be described by the binomial distribution: Pr(D = u + e|u, m, n, x) =
max−1 i=min
mi+1 − ni+1 ui + ei
× qi+1 ui +ei (1 − qi+1 )mi+1 −ni+1 −ui −ei (24)
Autonomous traffic management
Pr(U = u|m, n, x) =
max−1 i=min
Pr(M = m, N = n|x) =
ni ui
pi ui (1 − pi )ni −ui
xi x −m w1 mi (1 − w1 ) i i mi i=min mi m −n × w2 ni (1 − w2 ) i i ni max
299
(25)
(26)
In (26), w1 (1 − z01 )(1 − i) + z10 · i and w2 (1 − z01 )(1 − j) + z10 · j for x ∈ {xij }, where {xij } is a set of x whose noise rise causes the access point to transmit an RAB of (i, j). In addition, the ranges of (m, n) and u are {(m, n) | 0 ≤ ni ≤ mi ≤ xi , i = min, · · · , max} and {u | max(0, −ei ) ≤ ui ≤ min(ni , mi+1 − ni+1 − ei ), i = min, · · · , max − 1}, respectively. This Markov model is finite, aperiodic, and irreducible. Therefore, a unique steady-state probability π x for a state x can be obtained by solving a set p π and of linear equations πy = ∀x xy x ∀x πx = 1. In the conventional scheme, since one RAB value is repeated over RABLength, ‘L/2’ should be replaced by ‘L’ in (21) and (22).
5 Analysis results The IS-856 reverse-link performance is highly dependent on the traffic load because the capacity of the CDMA system is interference limited. A high noise rise may cause a high packet error rate (PER) in most of the access terminals. In order to guarantee a reasonable operation, it is desirable to keep most of the noise rise below a certain maximum value ηmax . In [GPP03], the overload probability that the noise rise exceeds 7 dB is considered as a reference for the performance evaluation in a realistic situation. If the overload probability is less than 1%, most transmissions can be considered successful. Therefore, the maximum reverse-link throughput satisfying the overload probability of less than 1% is selected as a performance metric for comparison. In this analysis, the reverse-link throughput is given by 5 Throughput = xi Ri πx (27) ∀x∈{xu }
i=1
where {xu } is a set of x that satisfies η(x) < 7dB from (9). Note that the throughput formula does not include the system states having a noise rise higher than 7 dB because most of the transmissions are unsuccessful in the overloaded conditions. The rate-transition probabilities are set to (p1 , p2 , p3 , p4 ) = (0.2, 0.1, 0.05, 0.025) and (q2 , q3 , q4 , q5 ) = (0.1, 0.3, 0.6, 0.9) for all access terminals3 . The 3
Generally, p1 > p2 > p3 > p4 and q2 < q3 < q4 < q5 are selected for the stable traffic management.
300
Woon-Young Yeo and Hyukjun Oh
maximum throughput (kbps)
500
400
300 IS-856 traffic management Load smoothing (Δη = 0.5 dB) Load smoothing (Δη = 1.0 dB) Load smoothing (Δη = 1.5 dB) Data-rate restriction
200
100
0
0
2
4
6
8
10
12
14
number of access terminals (T) Fig. 4. Maximum throughput in load smoothing and data-rate restriction schemes.
RAB decoding error probability is calculated by (21) and (22) with zs = 10%, which is chosen to be relatively high to differentiate the RAB decoding error between the conventional and proposed schemes. GDRC is set to -1.5 dB assuming DRCLength of 2 slots [HGB02]. The value of τ (·) can be determined by a link level simulation that considers various wireless conditions [Est02]. A value of τ (·) between -25 and -22 dB achieves 1% PER in a single cell environment with Rayleigh fading channels. We set τ (·) to -22 dB for all data rates to guarantee a PER of less than 1% in a conservative manner. Fig. 4 shows the maximum throughput in the load smoothing and datarate restriction schemes. The combined traffic management is not yet shown in this figure. The maximum throughput of the load smoothing scheme is much higher than that of IS-856, regardless of the value of Δη. As the value of Δη increases, the maximum throughput decreases because the noise rise is spread over a wider range for a large value of Δη. In the load smoothing scheme, Δη = 0.5 dB shows the highest throughput gain in the figure. Up to 45% throughput improvement is observed with Δη = 0.5 dB. The data-rate restriction scheme has a higher maximum throughput than IS-856, but the throughput gain does not show any regular pattern as the number of access terminals increases. Up to 24% throughput improvement can be observed at T = 7 in the data-rate restriction scheme. Note that, in the figure, the traffic management does not work at T ≤ 2 because the resulting noise rise is always below ηth . The conventional IS856 scheme has a slightly higher maximum throughput than the proposed schemes for T = 1 and 2. This is caused by a smaller RAB decoding error of the conventional scheme from Eq. (21)–(22). In addition, some irregularity of
maximum throughput (kbps)
Autonomous traffic management 500
500
400
400
300
300
200 100 0
200
IS-856 traffic management Load smoothing (Δη = 0.5 dB) Data-rate restriction Combined management (Δη = 0.5 dB)
0
2
4
6
8
10
12
number of access terminals (T)
(a) Δη = 0.5 dB.
IS-856 traffic management Load smoothing (Δη = 1.0 dB) Data-rate restriction Combined management (Δη = 1.0 dB)
100
14
0
301
0
2
4
6
8
10
12
14
number of access terminals (T)
(b) Δη = 1.0 dB
Fig. 5. Maximum throughput of the combined scheme.
the maximum throughput comes from the quantized operation of the traffic management and the higher data channel gain at the higher data rate. Note that Gdata (Ri ) is not entirely proportional to the data rate in IS-856. In particular, doubling the data rate from R4 and R5 requires an additional gain of 3.5 dB and 5.25 dB, respectively, as shown in Table 1. Therefore, the proportion of R4 and R5 has an impact on the resulting noise rise and may cause irregular noise rise patterns. Fig. 5 shows the maximum throughput of the combined traffic management. The throughput gain of 50% can be observed at T = 8 with Δη = 0.5 dB, when compared to the conventional IS-856 scheme. At the same Δη, the combined scheme has a higher maximum throughput than the load smoothing and data-rate restriction schemes, but the throughput gain is not significant when compared to the load smoothing scheme. However, the most important aspect of the combined scheme is that the access terminals can take only a limited number of high data rates. The reason for the throughput improvement can be explained by the distribution of noise rise. Fig. 6 shows the complementary cumulative density function of noise rise for 10 access terminals. In all traffic management schemes, ηth is selected so that the resulting overload probability is approximately the target value of 1%. Δη is assumed to be 1.0 dB for the load smoothing and combined schemes. From the figure, we can see that the noise rise is concentrated around 7 dB in the proposed schemes, whereas the noise rise of IS-856 is distributed over the large area. In addition, it can be observed that the variance of proposed schemes is much lower than that of the conventional one. The variance of the noise rise is a measure of stability in the IS-856 standard, and lower variance of the noise rise allows the operation at higher noise rise [GPP03]. Thus, lower variance of the proposed schemes is the preferred characteristics of the IS-856 traffic management. In the figure, the combined
302
Woon-Young Yeo and Hyukjun Oh 0
10
-1
Pr (η > x)
10
-2
10
IS-856 management (ηth= 4.4dB) Data-rate restriction (ηth= 5.4dB)
-3
10
Load smoothing (ηth= 6.5dB) Combined management (η th= 6.7dB)
-4
10
0
2
4
6
8
10
x (dB) Fig. 6. Complementary cumulative density function of noise rise (T = 10)
scheme shows the lowest variance, the load smoothing scheme the second lowest variance, the data-rate restriction the third lowest variance and, finally, the IS-856 scheme shows the highest variance. Especially, most of the noise rise is highly concentrated around 7 dB in the combined traffic management. In order to effectively support delay-sensitive real-time services, it is essential to guarantee the GBR. In the real-time voice service, a data rate of 9.6 kbps is not enough for the voice transmission because the data rate cannot support the minimum size of voice packets. If the VoIP service is supported by the IS-856 air interface, the minimum GBR should be set to at least 19.2 kbps in the physical channel, considering the protocol overhead of IP-based applications. Therefore, the data rate of 9.6 kbps (R1 ) should be avoided as much as possible in the IS-856 system. Fig. 7 shows the probability of resource shortage when the real-time voice service is supported. The probability indicates the proportion of R1 over the entire data rates. For the IS-856 and load smoothing schemes, the resource shortage probability increases as the number of access terminals increases. However, the data-rate restriction and combined schemes show zero shortage probability for T ≤ 12. Even for T > 12, the shortage probability is less than other two schemes that allow all data rates. Fig. 8 illustrates the average number of access terminals for each data rate with T = 10, ηth = 6.0 dB and Δη = 1.0 dB. The data rates in the conventional and load smoothing schemes are distributed over all data rates. On the other hand, the proposed schemes with data-rate restriction are concentrated only on the three data rates. The data rate of R1 can be observed only in the conventional and load smoothing schemes. Therefore, we can see that the proposed schemes with data-rate restriction can effectively support the real-time voice services.
Autonomous traffic management
303
0
probability of resource shortage
10
IS-856 traffic management Load smoothing (Δη = 1.0 dB) Data-rate restriction Combined management (Δη = 1.0 dB)
-1
10
-2
10
-3
10
-4
10
-5
10
0
2
4
6
8
10
12
14
number of access terminals (T) Fig. 7. Resource shortage probability for real-time voice services (T = 10, ηth = 6.0 dB, Δη = 1.0 dB)
number of access terminals
6
IS-856 management Load smoothing Data-rate restriction Combined management
5 4 3 2 1 0 R1
R2
R3
R4
R5
data rate Fig. 8. Average number of access terminals for each data rate (T =10, ηth =5.0 dB)
6 Conclusions In this paper, autonomous traffic management algorithms were proposed to improve the reverse-link throughput and to effectively support the real-time services. It was pointed out that some data rates in IS-856 are not suitable for the real-time services and they need to be avoided during the operation of the traffic management. In the proposed schemes, the original traffic management is improved by suppressing the excessive fluctuations of traffic load and by
304
Woon-Young Yeo and Hyukjun Oh
restricting the operation range of data rates. A generalized operation of IS856 traffic management was modeled as a multi-dimensional Markov process, and the proposed schemes are compared with the conventional IS-856 scheme. The proposed schemes showed up to 50% throughput improvement over the conventional IS-856 scheme. Moreover, the proposed schemes with data-rate restriction were shown to have the preferred operation for real-time services. We can conclude that the proposed schemes can improve the reverse-link performance and effectively support real-time services at the same time.
Acknowledgement This research was supported by the MKE(The Ministry of Knowledge Economy), Korea, under the national HRD support program for convergence information technology supervised by the NIPA (National IT Industry Promotion Agency) (NIPA-2010-C6150-1001-0013).
References [GPP02] 3rd Generation Partnership Project 2: cdma2000 High Rate Packet Data Air Interface Specification. 3GPP2 C.S20024 v.4.0 (2002) [BBF09] Broadband Forum, TR-196 Femto Access Point Service Data Model. Broadband Forum Technical Report (2009) [Est02] Esteves, E.: On the reverse link capacity of cdma2000 High Rate Packet Data systems. IEEE International Conference on Communications (ICC 2002), 3, 1823–1828 (2002) [HGB02] Huang, C. Y., Bi, Q., Gandhi, A., Brown, R., Cui, D.: Forward and reverse link capacity for IS-856: Third generation wireless high-speed data systems. Proc. IEEE Globecom 2002, 871–875 (2002) [CPE01] Chakravarty, S., Pankaj, R., Esteves,E.: An algorithm for reverse traffic channel rate control for cdma2000 High Rate Packet Data systems. Proc. IEEE Globecom 2001, 3733–3737 (2001) [YC05] Yeo, W.Y., Cho, D.H.: An analytical model for reverse link rate control in cdma20000 IS-856 standards. IEEE Commun. Lett., 9, 270–272 (2005) [HT07] Holma, H., Toskala, A.: WCDMA for UMTS. John Wiley & Sons (2000) [GPP03] 3GPP2 TSG-C WG3 DO Ad Hoc Group: C30-DOAH-20030818-004: IS856 evaluation methodology. 3GPP2 TSG-C WG3 contribution (2003) [GPP07] 3rd Generation Partnership Project, Quality of Service (QoS) Concept and Architecture. 3GPP 23.107 v7.1.0 (2007) [Est00] Esteves, E.: The high data rate evolution of the cdma2000 cellular system. Proc. Multiaccess, Mobility and Teletraffic for Wireless Communications, 5, 61–72 (2000)
Protection against Buffer Overflow Attacks via Dynamic Binary Translation Chun-Chung Chen1 , Shih-Hao Hung2 , and Chen-Pang Lee3 1
2
3
Graduate Institute of Networking and Multimedia, National Taiwan University
[email protected] Department of Computer Science and Information Engineering, National Taiwan University
[email protected] Department of Computer Science and Information Engineering, National Taiwan University
[email protected]
Abstract. Buffer overflow attacks are serious security threats to modern computer systems. Prior works against buffer overflow attacks may require users to patch the source codes, rebuild programs, modify the operating system or the augments of hardware architecture, and thus often result in performance degradation or restricted applicability. This paper proposes to protect a system from buffer overflow attacks with a mechanism based on dynamic binary translation. Our mechanism is capable of recovering corrupted data structures on the stack at runtime by dynamically inserting codes to guard the return address and stack frame pointer, without modification of the source code. We have implemented two tools using dynamic binary translation tools, Pin and QEMU. Experimental results showed that both tools detected buffer overflow attacks in our benchmark programs accurately. With our QEMU-based tool, the performance degradation ranged from 11.2% to 41% for realistic applications, which was 11 times less than a compiler-based solution such as Read-Only RAR. The performance of our mechanism and its applicability on various platforms make it an effective and viable solution for end users.
1 Introduction Buffer overflow attacks are a serious type of threats to computer systems [25]. When a program gets input strings without cautious bound-checking, it can fall victim to buffer overflow attacks. When an attacker send a string which is longer than the fixed-sized buffer, the adjacent data can be corrupted by the overflowed data, and the program control flow can be redirected to a malicious code injected by the attacker. Programs with well bound-checking procedures could avoid buffer overflow attacks, however, programmers do not always use
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 16, © Springer Basel AG 2011
306
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
bound-checking in their programs. Figure 1 illustrates the scenario of buffer over flow attacks.
΄΅Ͳʹͼ ƐƚĂĐŬ ŐƌŽǁƚŚ
΄΅Ͳʹͼ ƐƚĂĐŬ ŐƌŽǁƚŚ
ƉƌĞǀŝŽƵƐƐĂĐŬĨƌĂŵĞƐ
ƉƌĞǀŝŽƵƐƐĂĐŬĨƌĂŵĞƐ
ĞŶǀŝƌŽŶŵĞŶƚǀĂƌŝĂďůĞƐ
ĞŶǀŝƌŽŶŵĞŶƚǀĂƌŝĂďůĞƐ
ΎΎĂƌŐǀ
ΎΎĂƌŐǀ
ĂƌŐĐ
ĂƌŐĐ ĐŽƌƌƵƉƚ ƌĞƚƵƌŶĂĚĚƌĞƐƐ ĐŽƌƌƵƉƚ ĐĂůůĞƌ͛ƐĨƌĂŵĞƉŽŝŶƚĞƌ ĐŽƌƌƵƉƚ ǀĂƌ
ƌĞƚƵƌŶ ĂĚĚƌĞƐƐ ƌĞƚƵƌŶĂĚĚƌĞƐƐ ĐĂůůĞƌ͛ƐĨƌĂŵĞƉŽŝŶƚĞƌ ǀĂƌ
ƵĨĨĞƌ ;ďƵĨϭϮϴͿ
;Ϳ
ƵĨĨĞƌ ƐƚƌŝŶŐ ŐƌŽǁƚŚ
;ďƵĨϭϮϴͿ ŵĂůŝĐŝŽƵƐĐŽĚĞ
ƐƚƌŝŶŐ ŐƌŽǁƚŚ
;Ϳ
Fig. 1. The procedure of buffer overflow attack
Many tools have been developed to support programmers in the defence against buffer overflow attacks. They can be categorized into two types: static and dynamic. A static mechanism detects the danger of buffer overflow at the compiler stage, but it is difficult for a static mechanism to discover all possible types of dangers accurately without any false alarm, and it requires the source code. A dynamic mechanism is capable of protecting the executable files in binary format by catching any abnormal behavior during the runtime. While dynamic mechanisms may be better in attack detection as they generate no false alarm, they could incur significant performance degradation, and hence it may require special support from the operating system or the hardware to reduce the overhead. In addition to performance degradation, existing dynamic mechanisms lack two features that users would have liked: the protection of the frame pointer and recovery from an attack. First, a corrupted frame pointer may also influence the control flow on certain platforms [11], so it also needs protection. Second, once a buffer overflow attack is detected, termination of the defected program results in loss of data. In this paper, we propose a new software approach to improve dynamic detection of buffer overflow attacks. We take advantage of dynamic binary translation, a technique which is widely used in
Protection against Buffer Overflow Attacks
307
virtual machine software today [1] [2] [10] [12] [17]. During the binary translation process, our mechanism inspects the correctness of the return address and the saved frame pointer in the stack frame by inserting additional detection codes into the function entry point and the function exit point. Thus, our mechanism is capable of detecting any change to the critical stack data (including the frame pointer) caused by an attack. In certain situations, when an attack is detected, our mechanism can recover the program flow by restoring the stack data to allow continuous program execution without disruption. The recovery capability can be very important for real world applications. Our proposed approach can be integrated into many dynamic binary translation tools in general. As a case study, we implemented the proposed protection mechanisms based on Pin [10] and QEMU [1] two popular open-source dynamic binary translation tools. Using a set benchmark programs, including ApacheBench, wget, and mplayer, we demonstrated the effectiveness of dynamic detection of buffer overflow attacks using our approach, evaluated the overhead of the proposed mechanisms, and compared the performance of our mechanisms to a compiler-based static solution, Read-Only RAR [3]. The rest of this paper is organized as follows: Section 2 discusses relative work. Section 3 describes the detection mechanism and the implementation issues. Section 4 summarizes the experimental results for security and performance evaluation. Section 5 concludes the paper and discusses potential future work.
2 Related Work There are static mechanisms which manipulate or inspect the codes to detect the potential weaknesses in the codes that could be exploited through buffer overflow attacks. Static mechanisms can be further classified into the following four types: •
•
•
Language-based mechanisms translate C/C++ programs into safer languages, such as Java or LISP, which perform additional out-of-bound checks at runtime [26]. However, the translated codes can be far less efficient than the original codes. Static code analysis mechanisms detect potential security risks in the source codes by matching code sections against a list of defected patterns. ITS4 [21], FlawFinder [23], and RATS [8] are such tools, but they tend to have high false alarm rates and their database has not been sufficient to discover all defects so far [24]. Compiler-based mechanisms insert codes into the programs to perform array bound checking or to protect the return address on the stack. StackGuard [4] and ProPolice [6] insert canary words adjacent to sensitive data and report a buffer overflow when the canary words are inconsistent with their initial values. StackShield [20] and Return Address Defender
308
•
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
(RAD) [3] modify function prologues and epilogues to save the return address as a function starts and checks if the return address has been changed before the function returns. However, there are already tricks available to bypass StackGuard by guessing the values of the canary words [16]. Static binary rewriting mechanisms [14] inject protection functions into an executable file and replace instructions of prologues and epilogues with JMP instructions to the protection functions. The binary rewriting mechanism does not depend on any source code, but it could disturb the memory map of the program and trigger virus warnings.
Static mechanisms require the source codes or need to rewrite the binaries, which are not always possible for end users Dynamic mechanisms solve these problems and do not generate any false alarms. Dynamic mechanism can be classified into the following three types: •
•
•
Operating system mechanisms such as Non-Executable Stack [5] disable the ability to execute codes on the stack segment, so malicious codes injected via buffer overflow get no chance to run. However, after disabling the execution ability of the stack segment, Linux signal handlers cannot work, and GCC cannot make function trampolines with nested functions in the stack segment either. Address Space Layout Randomization (ASLR) [9] is also a kernel patch which randomizes the layout of segments in the memory to make it more difficult for attackers to inject the malicious code successfully. Binary translation mechanisms such as LIFT [15] uses dynamic binary translation tool to tag any input data from unsafe channels. Any data received and derived from an unsafe channel such as network are tagged as unsafe, and risky usages of unsafe data, such as execution of tagged instructions, will be detected. However, binary translation incurs extra execution overhead and may degrade the program performance during the runtime. Hardware mechanisms have been proposed to detect buffer overflow attacks. Dynamic Flow Tracking [19] is similar to LIFT but stores the tags of unsafe data in processor registers and cache memory areas. PointGuard [18] encodes memory pointers by hardware. However, the cost associated with hardware mechanisms make them unpopular in practice.
3 Our Protection Mechanism Unlikely the previous schemes, our protection mechanism not only detects buffer overflow attacks during the runtime for end users, it is also capable of recovering corrupted data by restoring the return address and stack frame pointer. Section 3.1 presents our detection mechanism and discusses specific issues which need to be addressed in the design. Section 3.2 describes how
Protection against Buffer Overflow Attacks
309
to implement our protection mechanism in a practical system, with PIN and QEMU as two examples. 3.1 Detection of Buffer Overflow Attacks As buffer overflow attacks aim to corrupt control data in stack frames, the return address and frame pointers are often targeted by the attackers to alter the program flow [25]. A successful attack would inject a malicious code onto the stack and modify the return address so that the execution flow will be redirected to the malicious program. The frame pointer of caller could also be modified by an attacker, so that the contents of a stack frame can be redirected to point to the data of malicious program. Hence, our mechanism protects both the return address and the frame pointer. We utilize dynamic binary translation to implement our mechanism so that users may use our mechanism to protect any program which may be subjective to buffer overflow attacks. We believe this approach provides the most complete coverage for end users, but as mentioned in Section 2, the drawback of this approach is the performance degradation due to the binary translation process. We would like to address this drawback by having our mechanism implemented on an efficient binary translation scheme with the overhead in our detection mechanism minimized.
^ƚĂƌƚ
WƌŽŐƌĂŵ ĞdžĞĐƵƚŝŽŶ &ƵŶĐƚŝŽŶŶƚƌLJWŽŝŶƚ
&ƵŶĐƚŝŽŶdžŝƚWŽŝŶƚ
z^
ĂĐŬƵƉƚŚĞ ƌĞƚƵƌŶĂĚĚƌĞƐƐ
ZĞƚƵƌŶĂĚĚƌĞƐƐ ŝƐĐŽƌƌƵƉƚĞĚ͍ EK
&ƌĂŵĞƉŽŝŶƚĞƌ ŝƐĐŽƌƌƵƉƚĞĚ͍
ĂĐŬƵƉƚŚĞ ĨƌĂŵĞƉŽŝŶƚĞƌ
EK
z^
dĞƌŵŝŶĂƚĞ
ZĞĐŽǀĞƌƚŚĞ ĐŽƌƌƵƉƚƐƚĂƚĞ͍ EK
Fig. 2. The overview of the detection model
z^
310
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
We integrate our protection into a dynamic binary translation scheme. When a program starts running, the entry point and the exit point for the monitored functions are instrumented by our mechanism invoked during the dynamic binary translation process at runtime, as shown in Figure 1. Via the instrumentation, whenever a monitored function is called, our protection mechanism is invoked before and after the execution of the monitored function. Figure 2 and Figure 3 show typical function prologue and epilogue. The prologue saves the callers frame pointer by pushing it onto the stack before the function starts. Then the prologue replaces the frame pointer with the current frame pointer, so the frame pointer points to the beginning of the new stack frame. The sub instruction then adjusts the stack pointer to make memory space for the local variables declared by the callee. The epilogue does the above steps in a reverse order before returning the control to the caller.
Fig. 3. Typical function prologue on x86
Fig. 4. Typical function epilogue on x86
Before a prologue executes, our protection mechanism stores the frame pointer and the return address in the backup space, as shown in Figure 4. The backup space is a protected area which must be hidden from and/or guarded against attackers. One can choose to hide the backup space in the heap segment and guard it with canary words generated randomly during the runtime, so that even an attack guess the location of backup space correctly, it still cannot bypass the guard canaries. When a function is completed, its epilogue is executed before the function return. Our protection mechanism checks the guard canaries and compares the return address and the frame pointer between the stack and the backup. If any of the guard canaries is modified, the backup space is deemed unsafe and triggers an alarm. If either the return address or the frame pointer is
Protection against Buffer Overflow Attacks
311
Fig. 5. Copy control data to the backup space
inconsistent, it also triggers an alarm. When an alarm fires, our mechanism terminates the defected process, recovers the data on the stack, or executes a special program to handle the situation, depending on the emergency policy specified by the user or the system. There are situations where the user would like to recover from an attack or invokes a special handler to respond to the attack. For performance, our mechanism cannot afford to save the entire contents of the stack, which consumes too much time and resource. To recover from an attack, our mechanism additionally saves the function arguments in the prologue, so that the defected function can be restarted again from a clean state. Since the number of function arguments is usually small, the overhead added by the recovery mechanism would still be acceptable. However, since the attack may overwrite multiple stack frames, as shown in Figure 5, it is necessary for our protection to backtrace the prior stack frames to decide on the point of recovery. While the design of our mechanism seems straightforward, the mechanism needs to handle special cases created by the compiler and platform-specific code optimization. We have resolved the following issues for the protection mechanism to work on x86 platforms: 1. Omitted Frame Pointer by Compiler Options: When programs are compiled with the ”-fomit-frame-pointer” compiler option using the GCC compiler, the frame pointer (EBP) will be reserved as a general purpose register, so that prologues and epilogues do not allocate any stack frame with EBP but allocate the stack frame with ESP instead. Programmers may use this option to optimize their code occasionally. Our protection mechanism has to check if a binary was compiled with the option, in order to deter-
312
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
Fig. 6. Prior frames of callee overwritten by attacks
mine whether EBP should be inspected to detect buffer overflow attacks in the epilogues. Thus, our mechanism takes an extra effort to check if the epilogue matches any of the patterns shown in Figure 6, which lists the cases for binaries compiled normally. If the epilogue matches, then both the return address and the saved frame pointer are verified; otherwise, we assume that the function is compiled with the ”-fomit-frame-pointer” option and only the return address is verified. 2. setjmp() and longjmp(): The function longjmp() restores the environment saved by the last call of setjmp(). These two low-level functions are often used for handling exceptions in a program, but such usages break the regular function call/return routine so that our original protection mechanism could not find the entry and exit points for a function call implemented that way. As shown in Figure 7, when function D executes longjmp(), the control is transferred to function A which has saved the jump point with setjmp(). Furthermore, the longjmp() also destroys the stack frames of function B, C, and D. Thus, our protection mechanism would have to keep track of setjmp() and longjump() to avoid false alarms, which would cause extra complexity in our mechanism. Instead, we used a simple scheme to resolve this problem. When an alarm is triggered, we additionally check if any of the prior return addresses and frame pointers saved in the backup stack matches the ones on the current stack frame. The alarm is confirmed only when we cannot find any match.
3.2 Implementation of Protection Mechanisms Our proposed mechanism can be implemented on top of a binary instrumentation tool or virtual machine software that can be used to perform the binary.
Protection against Buffer Overflow Attacks
ĂĚĚ
ĞƐƉ͕ y
ͬͬĚĞĂůůŽĐĂƚĞ ĂyďLJƚĞƐƐƚĂĐŬƐƉĂĐĞ
ƉŽƉ
ĞďƉ
ͬͬƌĞƐƚŽƌĞƚŚĞĐĂůůĞƌ͛ƐĨƌĂŵĞƉŽŝŶƚĞƌ
ƌĞƚ
313
ͬͬƌĞƚƵƌŶƚŽ ƚŚĞĐĂůůĞƌ ;ͿdLJƉĞϭ
ŵŽǀ
ĞƐƉ͕ ĞďƉ
ͬͬĚĞĂůůŽĐĂƚĞ ƚŚĞƐƚĂĐŬƐƉĂĐĞ
ƉŽƉ
ĞďƉ
ͬͬƌĞƐƚŽƌĞƚŚĞĐĂůůĞƌ͛ƐĨƌĂŵĞƉŽŝŶƚĞƌ
ƌĞƚ
ͬͬƌĞƚƵƌŶƚŽƚŚĞĐĂůůĞƌ ;ͿdLJƉĞϮ
ůĞĂǀĞ
ͬͬĚĞĂůůŽĐĂƚĞƚŚĞ ƐƚĂĐŬĂŶĚƌĞƐƚŽƌĞƚŚĞ ĐĂůůĞƌ͛ƐĨƌĂŵĞƉŽŝŶƚĞƌ
ƌĞƚ
ͬͬƌĞƚƵƌŶƚŽƚŚĞ ĐĂůůĞƌ ;ͿdLJƉĞϯ
Fig. 7. Three typical epilogues using EBP
Fig. 8. Mismatch caused by a setjmp/longjmp instruction pair
Since performance is an important factor for a dynamic protection mechanism, we would like our mechanism to work seamlessly with binary translation. For case studies, we first ported our protection mechanism to the PIN Tool, an open-source binary instrumentation tool available from Intel [10]. Figure 9 illustrates Pins software architecture. It consists of a process virtual machine, a code cache, and a instrumentation API invoked by Pintools. The process virtual machine consists of a just-in-time (JIT) compiler, an emulator, and a dispatcher. Pin uses the JIT compiler to generate and optimize code for efficiency. The input to the JIT compiler is a binary of an application. Codes
314
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
generated from the JIT compiler are put in a code cache by the dispatcher. The code cache keeps the generated codes for spatial locality and eliminates reduplicate translations for improving the performance. Every time the JIT compiler fetches a block of instructions from an application, the Pintool has an opportunity to instrument the fetched instructions before the block is translated. The original codes are only used for reference, whereas the actually executed codes are those generated codes from the JIT compiler. The process virtual machine coordinates each component, and switch the control between the application and the internal of Pin. Besides, the emulator intercepts system calls and delivers them to the host operating system, because Pin does not handles the kernel-level codes. Pin is a portable tool because the its API is designed to be architecture-independent. Thus, the developed Pintool can be apply to different architectures natively. By far, Pin supports Linux and Windows executables for IA-32, INTEL 64, and IA-64 architectures.
Fig. 9. The software architecture of Pin
We used the PIN Tools API to instrument the prologue and the epilogue of a function, and implement our stack backup and checking functions. Figure 8 illustrates the code instrumentation process, where the Pin Tool indentifies a function call, inserts backup code before the prologue of the callee (B) begins, and inserts the checking codes before the callee returns. Unfortunately, the
Protection against Buffer Overflow Attacks
315
Pin Tool executes a program with significant performance degradation as it interprets each instruction as it executes. We also ported our mechanism to QEMU, a popular open-source virtual machine software [2]. By translating the target instruction, QEMU can emulate several processor architectures (x86, PowerPC, ARM, and Sparc) on several host architectures (x86,PowerPC, ARM and MIPS). In addition to emulating the processors, QEMU can also 40 emulate the peripherals of a computer system for a full system emulation. QEMU performs efficient emulation with a dynamic binary translation technique. In the compile time, QEMU predefines the emulated target instruction set as shown in Figure 10. Each target instruction is composed of several simple instructions called micro operations. And each micro operation is implemented by small pieces of C codes that are compiled into an object file.
Fig. 10. QEMU predefines the emulated target instructions
QEMU processes dynamic binary translation at the instruction level. As shown in Figure 11, when QEMU encounters a target instruction during the runtime, it looks up the predefined micro operations of this instruction. The dynamic code generator translates the encountered instructions into corresponding host instructions which perform similar functionalities. And the generated host instructions are stored at the code cache so that they can be reused for spatial locality.
316
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
Fig. 11. Dynamic binary translation procedure of QEMU
Since QEMU does not provide any API for instrumentation, we need to modify the internals of QEMU to implement our protection mechanism. Similarly, our mechanism can be ported to other virtual machine software or a hypervisor. In the core of QEMU, a dynamic code generator interprets or translates the instructions of a program into the native instructions to perform on a host system during the run time. QEMU is also known as an emulator, as it is capable of emulating a guest machine of different instruction set architecture from the host machine. For fast emulation, instead of interpretation, QEMU utilizes a dynamic binary translation scheme and a few tricks to accelerate the execution of a guest program. We also made sure that our modification did not interfere with the accelerated execution to avoid significant performance degradation. Thus, we only modified the instruction translation scheme that is related to functional calls. As shown in Figure 9, our detection code was inserted as QEMU interpreted/translated the x86 instructions CALL, RET, RETN, and RETF. The protection mechanism in the modified QEMU basically works as the following. For the CALL instruction, the original emulation pushes the EIP to the stack and then jump to the callee and our modification additionally copies the EIP and EBP to the backup stack. For the instruction RET, RETN, and RETF, the original emulation pops the EIP from the stack and then transfer program control to the caller. We added a piece of code to detect buffer overflow attacks by comparing the return address with the backup one before
Protection against Buffer Overflow Attacks
317
the emulation. If an attack is detected, the control is transferred to our handler in QEMU to take care of the aftermath.
« )XQFWLRQ$
FDOO
)XQFWLRQ%
3,1722/
«
)XQFWLRQ%
SXVK
HES
VDYH WKHFDOOHU¶VIUDPHSRLQWHU
PRY
HES
HVS
VHW WKHVWDFNSRLQWHUDVWKH FXUUHQWIUDPHSRLQWHU
VXE
HVS
[
DOORFDWH [E\WHVRQWKHVWDFN IRU ORFDOYDULDEOHV
PRY
HVS
HES
GHDOORFDWH D;E\WHVVWDFN VSDFH
SRS
HES
%DFNXSFRGH %DFNXS FRGH &RS\WKH(,3 DQGWKH(%3WR WKHEDFNXSVWDFN
««
UHW
UHVWRUHWKHFDOOHU¶VIUDPH SRLQWHU UHWXUQWRWKH)XQFWLRQ $
&KHFNLQJFRGH 9HULI\WKHUHWXUQ DGGUHVVDQGWKH IUDPHSRLQWHULQ WKHVWDFNIUDPH
Fig. 12. Code instrumentation in Pin
4 Security and Performance Evaluation In this section, we present the results from our security and performance evaluation with the two implementations mentioned in the previous section. The experimental setup of the software environment is described in Table 1 and the hardware configuration is described in Table 2. Table 1. Software configuration
Software
Version
QEMU emulator 0.12.1 Pin instrumentation tool 2.7 GCC compiler 4.0 Linux kernel 2.6.31
318
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee &$// «
)XQFWLRQ$
FDOO
&RS\WKH(,3 DQGWKH(%3WR WKHEDFNXSVWDFN
)XQFWLRQ%
«
)XQFWLRQ%
SXVK
HES
VDYH WKHFDOOHU¶VIUDPHSRLQWHU
PRY
HES HES
HVS
VHW WKHVWDFNSRLQWHUDVWKH VHW WKH VWDFN SRLQWHU DV WKH FXUUHQWIUDPHSRLQWHU
VXE
HVS
[
DOORFDWH [E\WHVRQWKHVWDFN IRU ORFDOYDULDEOHV
PRY
HVS
HES
GHDOORFDWH D;E\WHVVWDFN VSDFH
SRS
HES
««
UHVWRUHWKHFDOOHU¶VIUDPH SRLQWHU
UHW
UHWXUQWRWKH)XQFWLRQ $
3XVKWKH(,3
5(75(71 5(7) 9HULI\WKHUHWXUQ DGGUHVVDQGWKH IUDPHSRLQWHULQ WKHVWDFNIUDPH &KHFNLQJFRGH 3RSWKHUHWXUQ DGGUHVV
Fig. 13. Code modification in QEMU Table 2. Hardware configuration
Hardware
Description
Processor AMD Athlon64 3000+, 1.8GHz Main memory 2048MB RAM Hard disk A single 160GB 7200RPM SATA disk Network card PCI Fast Ethernet Adapter 100Mbps
4.1 Security Evaluation In order to demonstrate the detection tool works, we used several applications which are vulnerable to buffer overflow attacks to evaluate our protection mechanism. Table 2 lists these applications. In our experiments, we were able to launch buffer overflow attacks successfully against these applications when they are not protected by our tools. With our tools, we were able to detect the attacks and recovered from the attacks. No false alarms were reported during our experiments. 4.2 Performance Evaluation To evaluate the performance degradation, we used a set of macro-benchmarks programs, including ApacheBench, wget, and mplayer, as examples of practical network applications. In addition, we compared our tools with Read-Only
Protection against Buffer Overflow Attacks
319
Table 3. Benchmark applications
Application Name
Description
Sumus v0.2.2 A Spanish card game server Mplayer v1.0-rc2 A multimedia player Apache Tomcat Connector jk2-2.0.2 An media streaming server Micq v0.4.6 An instant message program
RAR [3], a compiler-based solution for protection against buffer overflow attacks. The results are discussed below: 1. First, we used ApacheBench to measure the performance of Apache HTTP Server. The performance was represented by the rate of HTTP requests (HTTP/sec) that the server was able to serve to the clients. The average service time for serving HTTP request is shown in Figure 10. When we ran the Apache HTTP server on our modified QEMU, the service time was increase by 41% due to the translation time and the code injected by our protection mechanism. The service time was increased by 312% with our Pin-based tool, which clearly revealed the speed disadvantage of the Pin Tool as we mentioned in Section 3.2. The benchmark program Wget retrieved contents from a web server. Again, we used our tools to protect the web server. Figure 11 illustrates how long was required to download a 11MB file. In this case, the performance degradation was only 12% for our QEMU-based tool. In contrast, our Pin-based tool increased the service time by 4.23x. 2. Mplayer is a media player which is capable of playing multiple media formats. Figure 12 shows the execution time needed by Mplayer to decode a 742KB file encoded in the WMA format. There was 29% performance degradation for our QEMU-based tool, and the slowdown of our Pin-based tool is 3.20x. 3. Finally, we used a microbenchmark as the worst case to measure the performance degradation of our tools. The micro-benchmark had been used as benchmark with Read-Only RAR in [3], so we could compare the performance degradation of Read-Only RAR with our tools. The microbenchmark was written in C where the function main() called the subroutine for 100,000,000 times. The subroutine did a minimal amount of work, i.e. increasing a global variable by one, whenever it was called. Table 3 shows the normalized execution time measured with the microbenchmark as an indication of the increase of execution in the worst case from each protection tool. The slowdown of Read-Only RAR was 150 times and which was overwhelmingly higher than the our tools, because Read-Only RAR performed not only the backup and verification procedures, but also executed a large amount of the mprotect() system call to protect the depository.
320
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
In contrast, our protection mechanism was far more efficient with the separate protected backup space incorporated in our design.
Fig. 14. Experimental results from wget
Table 4. The micro-benchmark result
Protection tool Execution time N/A QEMU Pin Read-Only RAR
1 10.96 13.51 150.65
5 Conclusion In this paper, we presented a dynamic protection mechanism against buffer overflow attacks based on the binary translation schemes that are widely available on modern virtual machine software. Our mechanism is capable of recovering corrupted data structures on the stack at runtime by dynamically
Protection against Buffer Overflow Attacks
Fig. 15. Experimental results from ApacheBench
Fig. 16. Performance results of Mplayer
321
322
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee
inserting codes to guard the return address and stack frame pointer, without any modification of the source code. As virtual machines have been popularly used today, it makes the deployment of our protection mechanism possible and even more convenient than the other protection schemes. We have implemented two tools using dynamic binary translation tools in our case studies. Some platform-specific implementation issues are addressed with the GCC compiler and specific x86 instructions. Experimental results showed that both tools detected buffer overflow attacks in our benchmark programs accurately. With our QEMU-based tool, the performance degradation ranged from 11.2% to 41% for realistic applications, which was acceptable performance-security tradeoff in our opinion. The performance of our mechanism and its applicability on various platforms should make it an effective and viable solution for end users. In the future, it is possible for our protection mechanism to be integrated with other protect mechanisms to defend against various types of security attacks based on dynamic binary translation techniques. We would like to extend this software approach to provide a more secure execution environment and enable the deployment of security tools.
Acknowledgement This work was supported in part by grantsfrom the National Science Council (98-2219-E-002-021) and (98-2220-E-002-020) and a grant from Ministry of Economic Affairs (98-EC-17-A-01-S1-034).
References [1]
[2]
[3]
[4]
[5]
F. Bellard. Qemu, a fast and portable dynamic translator. In ATEC 05: Proceedings of the annual conference on SENIX Annual Technical Conference, pages 41–41, Berkeley, CA, USA, 2005. USENIX Association. Bruening, D., Garnett, T., and Amarasinghe, S. 2003. An infrastructure for adaptive dynamic optimization. In Proceedings of the international Symposium on Code Generation and Optimization: Feedback-Directed and Runtime Optimization (San Francisco, California, March 23 - 26, 2003). ACM International Conference Proceeding Series, vol. 37. IEEE Computer Society, Washington, DC, 265-275. T. cker Chiueh and F.-H. Hsu. Rad: A compile-time solution to buffer overflow attacks. Distributed Computing Systems, International Conference on, 0:0409, 2001. C. Cowan, C. Pu, D. Maier, H. Hintony, J. Walpole, P. Bakke, S. Beattie, A. Grier, P. Wagle, and Q. Zhang. Stackguard: automatic adaptive detection and prevention of buffer-overflow attacks. In SSYM98: Proceedings of the 7th conference on USENIX Security Symposium, 1998, page 5, Berkeley, CA, USA, 1998. USENIX Association. S. Designer. Non-executable user stack. http://www.openwall.com/linux/.
Protection against Buffer Overflow Attacks [6] [7] [8] [9]
[10]
[11] [12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
323
H. Etoh. GCC extention for protecting applications from stack-smashing attacks. http://www.research.ibm.com/trl/projects/security/ssp/. T. F. S. Foundation. the GNU Compiler Collection. http://gcc.gnu.org. F. S. Inc. Rough Auditing Tool for Security (RATS). http://www.fortify. com/security-resources/rats.jsp. X. Jiang, H. J. Wang, D. Xu, and Y. min Wang. Randsys: Thwarting code injection attacks with system service interface randomization. Technical report, 2007. C. keung Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. Janapa, and R. K. Hazelwood. Pin: Building customized program analysis tools with dynamic instrumentation. In In Programming Language Design and Implementation, pages 190–200. ACM Press, 2005. Klog. The Frame Pointer Overwrite. http://doc.bughunter.net/bufferoverflow/frame-pointer.html. N. Nethercote and J. Seward. Valgrind: a framework for heavyweight dynamic binary instrumentation. In PLDI 07: Proceedings of the 2007 ACM SIGPLAN conference on Programming language design and implementation, pages 89–100. ACM, 2007. H. Ozdoganoglu, T. N. Vijaykumar, C. E. Brodley, B. A. Kuperman, and A. Jalote. Smashguard: A hardware solution to prevent security attacks on the function return address. IEEE Trans. Comput., 55(10):1271–1285, 2006. M. Prasad and T. cker Chiueh. A binary rewriting defense against stack based overflow attacks. In In Proceedings of the USENIX Annual Technical Conference, pages 211–224, 2003. F. Qin, C. Wang, Z. Li, H.-s. Kim, Y. Zhou, and Y. Wu. Lift: A lowoverhead practical information flow tracking system for detecting security attacks. In MICRO 39: Proceedings of the 39th Annual IEEE/ACM International Symposiumon Microarchitecture, pages 135–148, Washington, DC, USA, 2006. IEEE Computer Society. G. Richarte. Four Different Tricks to Bypass StackShield and StackGuard Protection. http://downloads.securityfocus.com/library/StackGuard.pdf, 2002. K. Scott, N. Kumar, S. Velusamy, B. Childers, J. W. Davidson, and M. L. Soffa. Retargetable and reconfigurable software dynamic translation. In In CGO ae03: Proceedings of the international symposium on Code generation and optimization, pages 36–47. IEEE Computer Society, 2003. Z. Shao, Q. Zhuge, Y. He, and E. H. M. Sha. Defending embedded systems against buffer overflow via hardware/software. In ACSAC 03: Proceedings of the 19th Annual Computer Security Applications Conference, page 352, Washington, DC, USA, 2003. IEEE Computer Society. Suh, G. E., Lee, J. W., Zhang, D., and Devadas, S. 2004. Secure program execution via dynamic information flow tracking. In Proceedings of the 11th international Conference on Architectural Support For Programming Languages and Operating Systems (Boston, MA, USA, October 07 - 13, 2004). ASPLOS-XI. ACM, New York, NY, 85-96. Vendicator. Stack Shield protection tool. http://www.angelfire.com/sk/stackshield/index.html.
324 [21]
[22]
[23] [24]
[25] [26]
Chun-Chung Chen, Shih-Hao Hung, and Chen-Pang Lee J. Viega, J. T. Bloch, Y. Kohno, and G. Mcgraw. ITS4: a static vulnerability scanner for C and C++ code. In Computer Security Applications, 2000. ACSAC00. 16th Annual Conference, pages 257–267, 2000. C. Wang, S. Hu, H.-S. Kim, S. R. Nair, M. B. Jr., Z. Ying, and Y. Wu. Stardbt: An efficient multi-platform dynamic binary translation system. In L. Choi, Y. Paek, and S. Cho, editors, Asia-Pacific Computer Systems Architecture Conference, volume 4697 of Lecture Notes in Computer Science, pages 4–15. Springer, 2007. D. Wheeler. FlawFinder Tool. http://www.dwheeler.com/flawfinder/. M. Zitser, R. Lippmann, and T. Leek. Testing static analysis tools using exploitable buffer overflows from open source code. SIGSOFT Softw. Eng. Notes, 29(6):97–106, 2004. National Vulnerability Database (NVD). http://nvd.nist.gov/ Li Gong, Gary Ellison, and Many Dageforge. Inside Java 2 Platform Security. 2nd ed. Boston, MA: Addison-Wesley, 2003.
Part III
Applications
XA2C Framework for XML Alteration/Adaptation Gilbert Tekli1 , Richard Chbeir2 , and Jacques Fayolle1 1
2
Telecom Saint Etienne, Jean Monnet University, Saint Etienne, France
[email protected],
[email protected] LE2I Laboratory (UMR-CNRS), Bourgogne University, Dijon, France
[email protected]
Summary. XML has crossed the borders of software engineering and has spread to other areas such as e-commerce, identification, information storage, instant messaging and others. It is used to communicate crucial data over these domains. Thus, allowing non-expert programmers to manipulate and control their XML data is essential. In the literature, this issue has been dealt with from 3 perspectives: (i) XML alteration/adaptation techniques requiring a certain level of expertise to be implemented and are not unified yet, (ii) mashups, which are not formally defined yet and are not specific to XML data, and (iii) XML-oriented visual languages based on structural transformations and data extraction mainly and not allowing XML textual data manipulations. In this paper, we discuss existing approaches and present our XA2C framework intended for both non-expert and expert programmers able to provide them with means to write/draw their XML data manipulation operations. The framework is designed in the combined spirits of both mashups and XMLoriented visual languages by defining a well-founded modular architecture similar to mashups and an XML-oriented visual functional composition language based on colored petri nets. The framework takes advantage of existing XML alteration/adaptation techniques by defining them as XML-oriented manipulation functions. A prototype called XA2C is developed and presented here with the set of tests conducted to validate our approach.
1 Introduction The widespread of XML today has invaded the world of computers and is present now in most of its fields (i.e., internet, networks, information systems, software and operating systems). Furthermore, XML has reached beyond the computer domain and is being used to communicate crucial data in different areas such as e-commerce, data communication, identification, information storage, instant messaging and others. Therefore, due to the extensive use of textual information transmitted in form of XML structured data, it is becoming essential to allow users, having different backgrounds, to manipulate
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 17, © Springer Basel AG 2011
328
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
corresponding XML data based on specific and user requirements. As an example, consider a journalist who works in a news company covering global events. The journalist wishes to acquire all information being transmitted by different media sources (television channels, radio channels, journals, etc.) in the form of RSS feeds, filter out their content based on the topic (s)he is interested in, and then compare the resulted feeds. Based on the comparison results, a report covering relevant facts of the event needs to be generated. In
Fig. 1. XML data manipulation scenario
this first simple scenario, as shown in Figure 1, several separate techniques are needed to generate the manipulation operation required by the user such as, XML filtering, string similarity comparison and automated XML generation. In a second scenario, consider a cardiologist who shares medical records of his patients with some of his colleagues and wishes to omit personal information concerning his patients (i.e., name, social security number, address, etc.). In this case, data omission is the manipulation required which can be done via data encryption, removal, substitution or others depending on the operations provided by the system and the requirements of the user (cardiologist in this case). The issues in both scenarios are mainly: 1. we need a framework for writing XML-oriented manipulation operations. it should contain all of the XML-oriented manipulation techniques. To the best of our knowledge, such a framework does not exist so far, 2. we need the framework to be used by both non-expert and expert programmers. In order to address these 2 issues, 3 main approaches have emerged in the literature:
XA2C Framework for XML Alteration/Adaptation
•
329
Alteration/Adaptation techniques: they aim at altering and manipulating the data, to adapt it to the requirements of a user (e.g. a news paper journalist receiving news feeds from several sources wants to filter out data in correspondence to journal topics and eliminate any redundancies). Various techniques have been employed such as XML filtering [15] [23] [2] [4] [14], adaptation [1] [19] and information extraction [5] [3] [22] and XML encryption and digital signatures [11]. However, these techniques share common functions but are defined each separately. As shown in Table 1, they attempted to address specific requirements with different objectives. Whereas XML filtering is applicable to all XML data types and aims at filtering the data without any alteration to the content, XML adaptation alters the data to adapt it to certain requirements but does not necessarily address all types of XML data [1]. XML Encryption is generic to any XML data type but does not allow granular textual obfuscations and as for information extraction, they are no applicable to XML files. So far and to the best of our knowledge, each of these techniques remains separate from the other and no unified frameworks have been reached.
Table 1. Scope and Data types of existing Alteration/Adaptation control techniques
•
Techniques Scope
XML data type
Obfuscation Document and element-wise obfuscation Filtering Granular selection of XML data Adaptation XML-based multimedia data modifications to render it conform to an alien system (e.g., PDAs). IE Data Extraction based on rules and storage in a DB, XML files or others
All XML data types All XML data types Mainly multimedia XML data Mainly Web Pages
Mashups: they represent a new application development approach providing non expert programmers with means to aggregate multiple services, each serving its own purpose, to create a service that serves a new purpose. Mashup tools are built on the idea of reusing and combining existing services based on visual elements. Several tools have emerged such as Damia [6], Yahoo Pipes [10], Popfly [20], Apatar [10] and MashMaker [17]. To the best of our knowledge: – Mashups have not yet been formally defined – No tool yet provides information regarding the analysis of the performances – All the tools are supposed to target non-expert users, but a programming knowledge is usually required depending on each tool
330
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
– Existing mashup tools are mainly designed to handle online Web data which can be a disadvantage since by doing this, user’s data, generally available on desktops cannot be accessed and used – They are not specifically designed for XML data manipulation and therefore do not provide XML specific operations for querying, updating and modifying all types of XML data – New emerging tools are going towards composition based on existing functions (e.g., Damia and Yahoo Pipes) which allows them to increase their expressiveness in comparison with the tools following the query by example technique. The latter have limited operations and are considered more complex for non programmers due to the fact that some knowledge is required in querying data. • XML-oriented visual languages: they are already formalized and mainly based on existing XML transformation (e.g., XSLT) as in VXT [9] or querying languages (e.g., XQuery) such as Xing [16], XML-GL [18], and XQBE [7] main objective is to allow non expert programmers to extract sensitive data from XML document and restructure the output document by the use of visual elements. Existing visual languages successfully bridge the gap between the complexities of XML data querying and non expert programmers but are limited only to data extraction, filtering and restructuring. Mainly they provide non expert programmers with the ability to create XML structural transformations along with data extraction and filtering but do not deal with the textual data manipulation issue. Table 2 summarizes the different criterions of the mashups and XML oriented visual languages. Table 2. Properties of mashups and XML oriented languages
Properties
Mashups
XML Visual languages
XML specific No Yes Manipulate online data Yes Yes Manipulate desktop data No Yes Expressiveness High Low Formalized No Yes Functional Composition Yes No Composition-based functions No No Extending functions Dependent on the tool Limited
Our research mainly aims at defining a framework allowing non-expert and expert programmers to write/draw and enforce XML alteration/adaptation operations based on functional composition. The functions can express but are not limited to alteration/adaptation techniques and are provided in forms of client libraries (e.g., DLL files) or online services (e.g., web-services). The
XA2C Framework for XML Alteration/Adaptation
331
framework is based on a visual functional composition language [8], the XCDL (XML-Oriented Composition Definition Language). The language is based on Colored Petri Nets (CP-Nets) [13] [21] which allow it to express complex compositions with true concurrency (serial and parallel executions). In this paper, we introduce our XML alteration/adaptation control framework. We briefly present our composition language used to generate functional compositions in terms of CP-Nets. Since the compositions can contain serial and concurrent mapped functions, we provide a new algorithm based on CP-Nets’ properties for discovering and generating processing sequences simultaneously for serial and concurrent compositions. To validate our approach, we develop a prototype for the XA2C Framework and use it to test our processing sequence generation algorithm with different scenarios. The rest of this paper is organized as follows. The first section presents the XA2C framework and the process sequence generator algorithm. Section 2 discusses the prototype and evaluates the algorithm. Finally, we conclude and state some future works.
2 Proposal As mentioned previously, the purpose of our research is to provide non-expert and expert programmers with means to compose XML oriented manipulation operations, thus altering and adapting XML based data to their needs. The approach needs to be both generic to all XML data (text-centric and datacentric) and needs to be well-founded, in order to allow it to be portable and reusable in different domains (i.e., mashups, XML adaptation/alteration platforms, XML transformation and extraction, textual data manipulations, etc.). As stated in the introduction, there has been no existing formal and generic approaches answering such matters, nonetheless, several approaches have emerged undertaking different aspects of our research such as: (i) mashups, which are neither formalized nor XML specific, are being oriented towards functional compositions and scope non expert programmers, (ii) XML visual languages, while they are formalized and XML specific, they provide only XML data extraction and structural transformations but no XML data manipulations, mainly text-centric based, and (iii) XML alteration/adaptation techniques which are dispersed from one another resolving each a different objective (e.g., filtering, data extraction, etc.) and require expertise in their appliances. As shown in Figure 2, our approach is based on a combined spirit of both mashups and XML visual languages. On one hand, it has a similar architecture to mashups that renders the framework flexible thanks to its modular aspect and is based on functional compositions which are considered simpler to use than query by example techniques. On the other hand, it defines formally a visual composition language and separates the inputs and outputs to source and destination structures, thus making the framework XML-oriented.
332
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
Fig. 2. The XA2C approach
Similar to XML-oriented visual languages, the approach targets both expert and non-expert programmers. The visual composition language defined in the XA2C can be adapted to any composition based mashup tool or visual functional composition tool. Nevertheless our language is XML-oriented and generic to all types of XML data (standardized, grammar based and user based). In addition, it is based on CP-Nets allowing us to provide information regarding performance analysis and error handling which is not the case in current mashups. To render our approach flexible, the XA2C framework is defined as a modular architecture as shown in Figure 3. Our framework is composed of 3 main modules: • The XCDL platform allows us to define the XCDL language providing non-expert and expert programmers with the means to define their manipulation operations. The language mainly allows users to define their functions from offline or online libraries and create manipulation operations by composing these functions using mapping operators. The XCDL is defined as a visual functional composition language based on the graphical representations and algebraic grammar of CP-nets. Thus, rendering the language extensible and generic (adaptable to different data types), and allowing the expression of true concurrency along with serial compositions. As a user defines a new function or modifies a composition (adding, removing, replacing functions), the syntax is transmitted to the data model module to be continuously validated. • The data model contains the internal data models of the XA2C which are based on the same grammar used to define the syntax of the XCDL language (naturally based on CP-Nets). We define 2 internal data models:
XA2C Framework for XML Alteration/Adaptation
333
Fig. 3. Architecture of the XA2C framework
(i) “SD-function (System-Defined function) data model” for validating the components of the language, in this case to validate the defined functions in our system, and (ii) “Composition Data Model” used to validate the compositions. The validation process is event-based, any modification to the language components or to a composition such as additions, removals or editions trigger the validation process. • The runtime environment defines the execution environment of the resulting compositions of the XCDL language. This module contains 3 main components: (i) the “Process Sequence Generator” used to validate the behavioral aspect of the composition (e.g. makes sure there are no open loops, no loose ends, etc.) and generates 2 processing sequences, a concurrent and a serial one to be transmitted respectively to the concurrent and serial processing components for execution. (ii) “Serial Processing” allowing a sequential execution of the “Serial Sequence” provided by the data model. It is more suitable for single processor equipped machines as it will not take advantage of a multi processing unit. (iii) “Concurrent Processing” allowing the execution in a concurrent manner of the “Concurrent Sequence” generated from the data model. It is imperative to note
334
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
that this type of processing is most suitable for machines well equipped for multi-processing tasks (e.g. dual processors machines). Due to the lack of space, serial and concurrent processing components are not detailed here. In the next section we briefly discuss each of the 3 modules. 2.1 XCDL platform The XCDL is a visual functional composition language based on SD-functions (System-Defined functions) and XML-oriented. The language is rendered generic, extensible and user friendly by respecting the following properties: simplicity, expressiveness, flexibility, scalability, and adaptability. These properties are satisfied by defining the language as a visual one and basing its syntax on a grammar defined in CP-Nets. We denote by SD-functions, functions which will be identified in the language environment. These SD-functions can be provided by offline libraries (e.g., DLL/JAR files) or online libraries (e.g., Web service). XCDL is divided into 2 main parts: • The Inputs/Outputs (I/O). • The SD-functions and the composition which constitute the XCDL Core. The I/O are defined as XML Content Description trees [12] (XCD-trees) which are ordered labeled trees summarizing the structure of XML documents or XML fragments, or representing a DTD or an XML schema, in forms of tree views as shown in Figure 4. SD-functions are defined each as a CP-Net with
Fig. 4. XML document to XCD-tree example
XA2C Framework for XML Alteration/Adaptation
335
the inputs and outputs defined as places and represented graphically as circles filled with a single color each defining their types (e.g., String, Integer, etc.). It is important to note that a function can have one or multiple inputs but only one output. The operation of the function itself is represented in a transition which transforms the inputs to the output. Graphically, it is represented as a rectangle with an image embedded inside it describing the operation. Input and output places are linked to the transition via arcs represented by direct lines. Several sample functions are shown in Figure 5. The composition
Fig. 5. Sample functions defined in XCDL
is also based on CP-Nets. It is defined by a sequential mapping between the output and an input of instances of SD-functions. The functions are dragged and dropped, and then linked together with a Sequence Operator ‘→” which is represented by a dashed line between the output of a function and an input of another, having the same color as shown in Figure 6. As a result, a
Fig. 6. Serial and concurrent compositions
composition might be a serial one meaning that all the functions are linked sequentially and to each function one and only one function can be mapped as illustrated in Figure 6.a. In this case, the sequential operator is enough. Also, the composition might contain concurrency, as in, several functions can be mapped to a single one as depicted in Figure 6.b. In this case, we introduce an abstract operator, the Concurrency Operator “//”, in order to indicate the concurrent functions. As shown in Figure 6, we define 2 main types of
336
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
compositions, a Serial Composition SC and a Concurrent Composition CC. The syntax of the SD-functions, Sequence Operator, Concurrency operator, Serial Composition and Concurrent Composition are all based on the grammar defined by CP-Nets’ algebra (and therefore retain their properties such as Petri Net firing rule and Incidence matrix). Definition 1-XCGN (standing for XML oriented Composition Grammar Net) represents the grammar of the XCDL which is compliant to CP-Nets. It is defined as: XCGN = ( Σ, P, T, A, C, G, E, I) where: • Σ is a set of data types available in the XCDL. The XCDL defines 6 main data types, Σ = {Char, String, Integer, Double, Boolean, XCD-Node } where Char, String, Integer, Double and Boolean designate the standard types of the same name. XCD-Node defines a super-type designating an XML component • P is a finite set of places defining the input and output states of the functions used in the XCDL • T is a finite set of transitions representing the behavior of the XCDL functions and operators • A ⊂ (P x T) ∪ (T x P) is a set of directed arcs associating input places to transitions and vice versa. ∀ a ∈ A: a.p and a.t denote the place and transition linked by a • C:P → Σ is the function associating a color to each place • G:T → S is the function associating an SD function to a transition (S is the set of SD-functions, which are operations performed by functions identified in the development platform’s libraries (e.g., concat(string,string))) • E:A → Expr is the function associating an expression expr ∈ Expr to an arc such that ∀ a ∈ A: Type(E(a))=C(a.p) • I:P → Value is the function associating initial values to the I/O places such that ∀ p ∈ P, ∀ v ∈ Value : [Type(I(p))=C(p) ∧ Type(v) ∈ Σ] Definition 2-XCD Node is a super type designating an XML Component. It has 3 main sub-types as defined in the XCD-tree: XCD-Node = {XCD-Node:Element, XCD-Node:Attribute and XCD-Node:Text} where: • XCD-Node:Element defines the type XML Element • XCD-Node:Attribute defines the type XML Attribute • XCD-Node:Text defines the type XML Element/Attribute Value Figure 7 shows an illustration of a combination of a serial and concurrent composition. In this example, we can see that SDF1 is concurrently mapped
XA2C Framework for XML Alteration/Adaptation
337
to SDF2 with a serial composition of SDF3 and SDF4. In this case, the composition is expressed as follows: “C = (SDF1 // (SDF3 → SDF4)) → SDF2” and the resulting composition is a CP-Nets compliant to the XCGN and transmitted to the Data Model for validation.
Fig. 7. Composition example in XCDL
2.2 Data model As stated earlier, this module is used to validate the syntax and behavior of the composition expressed in the XCDL platform. The main purpose is to ensure that the composition is compliant to our grammar. In Figure 3, we can see that this module contains 2 main components: (i) SD-function Model and (ii) Composition Model. (i) and (ii) define the internal data model of the XA2C. The SD-function Model shown in Figure 8.a is defined as a relational schema representing SD-functions as CP-nets. This schema is used to validate SD-functions before they are stored in the system. As an example, consider the SD-function “Concat” shown in Figure 5. This function is defined as follows: Concat = (Σ, P, T, A, C, G, E, I) where: • • • • • •
Σ = {String} P = PIn ∪ POut = {In Str 1, In Str 2} ∪ {Out Str} T = {Concat} A ⊆ (PIn x {t}) ∪ ({t} x POut) C:P → Σ where C(In Str 1)= C(In Str 2)= C(Out Str)=String G:t → S where G(Concat)= String functions.Concat and Type(G(Concat)) = C(Out Str) = String where String functions is the DLL containing String manipulation functions. • E:A → Expr is the function associating an expression expr ∈ Expr to a ∈ A: – Expr={M(In Str 1), M(In Str 2), G(Concat)} is a set of expressions where: ∀ expr ∈ Expr: expr = (M(a.p) if a.p = pout) (G(a.t) otherwise) • I:P → Value where I(In str 1) = I(In str 2) = “”
338
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
Fig. 8. Relational schemas compliant with XCGN
The “Concat” a SD-function is validated through the SD-function model which will allow it then to be stored as a CP-Net in a XML based file. The Composition Model shown in Figure 8.b is also defined as a relational schema which is used to validate the syntax of the composition before storing it as a CP-Net in a XML based file and transmitting it to the Processing Sequence Generator in the Runtime Environment module for execution sequence discovery and generation. 2.3 Runtime environment As stated in the previous section, the XCDL is based on the XCGN, a grammar based on CP-Nets, and the resulting composition is a CP-Net. The Process Sequence Generator is used to generate 2 execution sequences, serial and concurrent sequences which specify the order in which the composed functions can be executed. The Concurrent Sequence specifies different concurrency levels (CL) which must be executed in an orderly manner from CL0 to CLn where n is the last CL. Each CL contains one or several functions which can be executed in a concurrent manner (parallel or serial). The Serial Sequence defines the execution of the functions in a serial manner where each of the functions in the composition will have a unique order in which it can be executed ranging from 0 to m-1, m is the number of functions used in the composition.
XA2C Framework for XML Alteration/Adaptation
339
In order to generate both sequences, we provide an algorithm based on the Incidence Matrix [13] of CP-Nets. Definition 3-Incidence matrix is defined for a CP-Nets N with m transitions and n places as, A= [aij ] , an n×m matrix of integers where: − • aij =a+ ij - aij where + – aij = w(i,j) is the weight of the arc from transition i to its output place j – a− ij = w(i,j) is the weight of the arc to transition i from its input place j − • a+ ij , aij and aij represent the number of tokens removed, added, and changed in place j when transition i fires once.
Before we give the algorithm, we present the hypothesis defining the background on which the algorithm is based upon. Hypothesis Based on the XCDL syntax, defined in the XA2C platform, the resulting composition is defined as a CP-Net based on the XGCN and respects the following main properties: Each place can contain one and only one token: • • • •
A token can be added either through an initial marking provided by the user or an XCD-tree node or through a fired transition All arcs are weighted with the value 1 A transition is enabled once each of its input places contains at least one token A fired transition clears its input places of all tokens and generates one and only one token in each of its output places
Based on these properties, we define our algorithm for simultaneously discovering and generating a serial and concurrent function processing sequence. The processing sequence is stored in a 2 dimensional matrix (called PP for Parallel Processing) where each line represents the concurrent level of execution and each column represents a transition (a SD-function). Consider the composition CPN1 in Figure 9, Table 3 represents its PP matrix. The PP matrix shows that we have 3 CLs which must be executed sequentially and orderly from CL0 to CL2 (e.g., T1 and T4 are enabled once T0, T3 and T6 have fired). All transitions in a CL can be executed simultaneously in parallel. As shown in Table 3, each transition corresponding to a CL is assigned a number. This number represents the sequence order in which a transition should fire in Serial Processing mode (e.g., in Table 3, T0, T3, T6, T1, T4, T2 and T5 will be executed sequentially in Serial Processing mode). Algorithm skeleton The algorithm contains 2 loop steps:
340
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
Fig. 9. CPN1, an Example of a CP-Net resulting from the XCDL Table 3. PP matrix of the CP-Net in Figure 9
CL/T T0 T1 T2 T3 T4 T5 T6 CL0 CL1 CL2
0
1 3
2 4
5
6
• Step 1 (line 1-20): For each place in A, check if the initial value is of type ‘XCD node” or ‘user” (in other terms, checks in the place is a source place), if so, then for each transition in A check if the corresponding place is an input to the transition. If the place is found to be an input then clear its value from A and check if the transition is enabled. If it is enabled and PP does not contain a value in the corresponding transition column then add the value of m in PP(j,n) where j is the index of the enabled transition and increment m by 1. If the transition is enabled and PP already contains a value in the corresponding transition column, then report an error in the composition and exit the algorithm. • Step2 (line 21-46): While PP ≤ T.num-1, for each transition in PP on CLn-1, clear all its output places and if these places are inputs to other transitions, clear them as well from A, then check if their corresponding transitions are enabled, if so then check that they were not already added to PP and add them in the corresponding transition line on the CLn, otherwise report an error in the composition and exit the algorithm. Due to the lack of space, the proofs were removed from this paper.
3 Prototype and experiments In order to validate our framework and test the algorithm, we implement a prototype called XA2C. It is based on the XCDL core grammar allowing us to compose/draw XML oriented manipulation operations based on functions existing in the system libraries (DLLs, JARs, or Web Services). The prototype, illustrated in Figure 10, was developed in Visual Basic Dot Net (VB.Net). The architecture of the prototype is shown in Figure 3. The primary tests we
XA2C Framework for XML Alteration/Adaptation Algorithm 1: Discovering and generating serial and concurrent function processing sequence () Input: A(,) // the Incidence matrix, T() // the Transitions matrix, P() // the Places matrix Output: PP(,) // the Parallel Processing matrix Variables: m = 0 // the sequence number of the next transition n = 0 // the current level number of the parallel processing 1 // step 1 2 for i = 0 to (P.num - 1) do 3 if (P type(i) = ”in xcd”) or (P type(i) = ”user”) then 4 for j = 0 to (T.num - 1) do 5 if A(i,j) = -1 then 6 A(i,j) = 0 7 if T enabled(i,j) then 8 if ¬ (PP.contains(get t(out p))) then 9 PP(j,n) = m 10 m++ 11 end 12 else 13 Error(”Composition Error”) 14 Exit 15 end 16 end 17 end 18 end 19 end 20 end 21 // step 2 22 while m ≤ T.num do 23 for i = 0 to (T.num - 1) do 24 if PP(i,n) = NULL then 25 t=T(i) 26 for each out p ∈ A.outputs(t)() do 27 out p = 0 28 for each in p ∈ A.inputs(get t(out p))() do 29 if in p = out p then 30 in p = 0 31 end 32 end 33 if get t(out p).enabled then 34 if ¬ (PP.contains(get t(out p))) then 35 PP(get t(out p),n) = m 36 end 37 else 38 Error(”Composition Error”) 39 Exit 40 end 41 end 42 end 43 end 44 end 45 n++ 46 end
341
342
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
Fig. 10. XCDL Platform
run on the prototype were divided into 3 categories: (i) performance, (ii) user satisfaction, and (i) relevance. In this section, and due to the lack of space, we show the evaluation of the performance and in particular, the process sequence generator algorithm which was implemented in the third module, in the Process Sequence Generator component. We tested our algorithm for several compositions on an Intel Xeon 2.66GHz with 1 GB of Ram memory. We discuss here 4 different cases: serial (cf. Figure 11.a), concurrent (cf. Figure 11.b) and 2 cases of combined and independent compositions: serial and concurrent (cf. Figure 11.c and 11.d). The combined cases can contain several serial composition with concurrent compositions such as, in case a and b, but the combinations are independent and do not share any data, in other words they have no mappings between each other. In all 4 cases the functions were dragged and dropped arbitrarily. The runtime execution monitored by the tests regarding cases a, b, c and d are shown respectively in the graphs a, b, c and d in Figure 12. Table 4. Runtime Equations of cases a, b, c and d
Cases
Runtime Growth Equation
Case Case Case Case
t t t t
a: b: c: d:
= = = =
200n 7*(200) 50n (200) 320n (200) 300n 6*(200)
XA2C Framework for XML Alteration/Adaptation
343
Fig. 11. Different composition scenarios
Based on all 4 equations we elaborated that the algorithm has a constant execution period, in the case of the Xeon processor it was 200ms. The execution runtime of concurrent cases is half the execution runtime of serial cases. In combined and independent compositions, we notice that the execution runtime of the algorithm is dependent of the runtime of the maximum independent concurrent composition which sets the minimum runtime of the overall execution.
4 Conclusion and future works In this paper, we discussed the issues regarding XML oriented visual languages which scope non expert programmers along with XML manipulation techniques. We introduced here the XA2C framework XML oriented visual manipulation based on functional compositions where the adaptation/alteration techniques are used as existing functions which can be initiated either from offline libraries (DLL or JAR Files) or online libraries (Web Services). This paper gave a brief introduction to the XCDL language which was defined based on CP-Nets and intended to be used for visual functional compositions. The paper also presented the algorithm we developed in order to discover and generate serial and concurrent processing sequences resulting from the compositions created by the XCDL language. The algorithm was implemented and tested in a prototype developed in VB.Net which allows users to create composed operations for XML textual values mainly. The main track, in future works, relies on optimizing the algorithm to deal with independent
344
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle
As we can see in all 4 graphs, the runtime execution growth remains constant to a certain point then starts growing in almost a linear form. Therefore, we elaborate the following 4 equations shown in Table 4.
Fig. 12. Runtime execution of the algorithm
compositions in more efficient manner in terms of timing and error handling. In addition, we are willing to extending the XCDL language to grow beyond functional compositions by adding conditional and loop operators along with user composed functions which can be reused in different compositions.
References [1]
[2]
B. Pellan and C. Concolato, Adaptation of Scalable Multimedia Documents, In: Proceeding of the eighth ACM symposium on Document engineering, pp. 32–41, 2008 B. Luo, D. Lee, W.-C. Lee and P. Liu, QFilter: Fine-Grained Run Time XML Access Control via NFA-based Query Rewriting, In: Conference on Information and Knowledge Management, Proceedings of the thirteenth
XA2C Framework for XML Alteration/Adaptation
[3]
[4]
[5]
[6]
[7]
[8] [9]
[10] [11]
[12]
[13] [14]
[15]
[16] [17] [18]
[19]
345
ACM international conference on Information and knowledge management, pp. 543–552, 2004 B. Adelberg, NoDoSE-a tool for semi-automatically extracting structured and semistructured data from text documents, In: Proceedings of the 1998 ACM SIGMOD international conference on Management of data, pp.283– 294, 1998 C. Byun, K. Lee and S. Park, A keyword based filtering technique of document centric XML using NFA representation, In: Int. J. Appl. Math. Comput. Sci. 4 (3) (2007), pp. 136–143, 2007 C.-H. Chang and S.-C. Lui, IEPAD: Information Extraction Based on Pattern Discovery, In: Proceedings of the 10th international conference on World Wide Web, pp.681–688, 2001 D. E. Simmen, M. Altinel, V. Markl, S. Padmanabhan, A. Singh, Damia: data mashups for intranet applications, In: International Conference on Management of Data, pp. 1171-1182, 2008 D. Braga , A. Campi , S. Ceri, XQBE (XQuery By Example): A visual interface to the standard XML query language, In: ACM Transactions on Database Systems (TODS), vol.30, pp. 398-443, 2005 E.J. Golin, S.P. Reiss, the specification of visual language syntax, In: IEEE Workshop on Visual Languages, pp. 105–110, 1989 E. Pietriga , J. Vion-Dury , V. Quint, VXT: a visual approach to XML transformations, In: Proceedings of the 2001 ACM Symposium on Document engineering, pp. 1-10, 2001 G. Di Lorenzo, H. Hacid, H. Paik, B. Benatallah, Data integration in mashups, In: ACM SIGMOD Record, V.38, pp. 59-66, 2009 G.-H. Hwang and T.-K. Chang, An operational model and language support for securing XML documents, In: Computers and Security,pp.505– 525, 2004 G.Tekli, J. Fayolle, R. Chbeir, Towards an XML Adaptation/Alteration Control Framework, In International Conference on Internet and Web Applications and Services, pp. 248-255, 2010 K. Jensen, An Introduction to the Theoretical Aspects of Coloured Petri Nets, In: Lecture Notes In Computer Science, Vol.803, pp. 230-272, 1993 K.S. Candan, W.-P. Hsiung, S. Chen, J. Tatemura and D. Agrawal, AFilter: adaptable XML filtering with prefix-caching suffix-clustering, In: Proceedings of the 32nd VLDB Conference, pp. 559–570, 2006 M. Altinel and M.J. Franklin, Efficient filtering of XML documents for selective dissemination of information, In: Proceedings of the 26th VLDB Conference, pp. 53–64, 2000 M. Erwig, A Visual Language for XML, In: Proceedings of the 2000 IEEE International Symposium on Visual Languages (VL’00), pp. 47, 2000 R. J. Ennals, M. N. Garofalakis, MashMaker: mashups for the masses, In: International Conference on Management of Data, pp. 1116-1118, 2007 S. Ceri , S. Comai , E. Damiani , P. Fraternali , S. Paraboschi , L. Tanca, XML-GL: a graphical language for querying and restructuring XML documents, In: Computer Networks: The International Journal of Computer and Telecommunications Networking, vol.31, pp. 1171-1187, 1999 T. Lemlouma and N. Layada, SMIL Content Adaptation for Embedded Devices, In: SMILEurope 2002 Conference pp.1–11, 2002
346 [20] [21] [22]
[23]
Gilbert Tekli, Richard Chbeir, and Jacques Fayolle T. Loton, Introduction to Microsoft Popfly, No Programming Required, 2008 T. Murata, Petri Nets: Properties, Analysis and Applications, In: Proceedings of the IEEE, Vol. 77, No. 4, pp. 541-580, 1989 V. Crescenzi, G. Mecca and P. Merialdo, Automatic Web Information Extraction in the ROADRUNNER System, In: Revised Papers from the HUMACS, DASWIS, ECOMO, and DAMA on ER 2001 Workshops, pp. 264–277, 2001 Y. Diao, M. Altinel, M.J. Franklin, H. Zhang and P. Fischer, Path sharing and predicate evaluation for high performance XML filtering, In: ACM Trans. Database Syst. 28 (4) (2003), pp. 467–516 (2003)
An Automatic Method for WordNet Concept Enrichment using Wikipedia Titles Myunggwon Hwang1 , Dongjin Choi2 , Byeongkyu Ko3 , Junho Choi4 , and Pankoo Kim5 1
2
3
4
5
Dept. of Computer Engineering 814 IT Building, Chosun Korea +82-62-230-7799
[email protected] Dept. of Computer Engineering 814 IT Building, Chosun Korean +82-62-230-7799
[email protected] Dept. of Computer Engineering 814 IT Building, Chosun Korea +82-62-230-7799
[email protected] Dept. of Computer Engineering 814 IT Building, Chosun Korean +82-62-230-7799
[email protected] Dept. of Computer Engineering 815 IT Building, Chosun Korea +82-62-230-7636
[email protected]
Univ. Gwangju, South Univ. Gwangju, South Univ. Gwangju, South Univ. Gwangju, South Univ. Gwangju, South
Summary. Knowledge bases such as WordNet are positively utilized for semantic information processing. However, much research indicates that the existing knowledge bases cannot cover all of concepts used in talking and writing in real world. To solve this limitation, this research suggests a method which enriches WordNet concepts through analyzing Wikipedia document set. Wikipedia currently contains documents more than 3.2 million and it describes tangible and intangible objects in detail. Moreover, it is continuously grown with new subjects and contents by domain-specific specialists. Therefore, the Wikipedia contents can be usefully used for knowledge base enrichment. This paper describes semantic method which conceptualizes titles of Wikipedia documents and which gives a connection between the title concepts and WordNet concepts. Through the experimental result, we could get better precision than that of existing similar method.
1 Introduction Publishing innumerable information into Web, retrieval methods become much more important. Moreover, development of Semantic Web techniques makes retrieval result semantically near to human’s demand and provides diverse additional assistant such as query expansion [LLY04], related retrieval [HVV06],[HCC10] and so on. Much of the research depends on ontology structured KB (knowledge base) and the representative KB is WordNet which was developed by Princeton University [Fel98]. The WordNet1 is concept network
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 18, © Springer Basel AG 2011
348
Myunggwon Hwang et al.
which has been constructed similarly to knowledge system of human however a few research papers indicate that the WordNet cannot cover all of concepts used in real world [HK09], [VCP07]. To overcome this limitation, many researchers have suggested methods; Velardi suggested a method which extracts domain terminologies from domain document set and connects the terminologies to WordNet concepts [VCP07]; Hwang proposed the other method which extracts proper nouns through analyzing enormous documents and grasps semantically related concepts to the proper nouns [HK09]. However, since the document sets used for these methods were kinds of general web documents or research papers, it resulted in not good performance for WordNet connection. In this paper, we propose new method for WordNet concept enrichment using Wikipedia document set. The Wikipedia2 contains more than 3.2 millions documents and each document has one title (subject) and describes title-centered contents in detail. Moreover, the Wikipedia is getting grown with new titles and contents according to world flows such as new trends, technologies, products, people, and so on. Since those facts mean that the Wikipedia contains more exact contents than that of other web documents and covers unrestricted domain knowledge, the Wikipedia is enough to be used as a KB. This research considers the document titles in Wikipedia as the concepts which are possible to be added to WordNet. The conceptualization of the titles can become useful resource for semantic processing because the title expresses one of tangible or intangible objects such as computer viruses (ex. Agena, Ah, Alabama, Ghostball, etc), algorithms (ex. Genetic algorithm, Gang scheduling, Round-robin scheduling, etc), buildings (ex. 63 Building, Embassy of the United States in Ottawa, Tokyo Midtown, etc), companies (ex. IBM, Microsoft, Merck & Co., Dell, etc), products (ex. BMW Z3, iPhone, Motorola 68030, etc), songs (Right Round, Let It Be, Enter Sandman, etc), and so on. This paper proposes a semantic method which adds the titles to WordNet hierarchy and the contents are followings. Section 2 explains related works simply and section 3 contains enriched WordNet and Wikipedia context information which are used for this research. In section 4, the core contents of this paper, the conceptualization process will be presented. Section 5 demonstrates the experimental result and comparison and finally section 6 summarizes this paper with conclusion.
2 Related Works Many researchers gave great efforts to establish well defined KB. Montoyo in [MPR01] proposed an automatic method to semantically enrich WordNet with categories or classes by using the WSD Specification Marks Method which assigns a category of classification system to a WordNet synset (synonym set). However, this method is still affected by dictionaries, POS tagger, and cooccurred words and has weakness to disambiguate common senses and words in unknown domain. [CV07] suggested a method for semi-automatic KB en-
An Automatic Method for WordNet Concept Enrichment
349
richment with instances extracted from unstructured Web documents. This method is based on NLP (natural language processing) component called Marmot, a dictionary induction tool named Crystal, and IE (information extraction) component called Badger. Also [SPP09] processed the semi-structured document to measure the syntactic similarity between the ontology and the table contents of Web. Since documents have hundreds of way to express a meaning, it is not easy to extract the syntactic or semantic patterns from documents. Due to the number of noises in documents, extracting information from the Web and enriching KB are not easy. Especially, in case of human name, it has high complexity. Therefore, it might give misunderstanding to machine in enriching KB. To overcome this problem, [BSW07] proposed a method to enrich existing ontologies by using generic domain independent technique which extracts new concept candidates from the Web. Also, they exploited the overlapped information on the Web based on co-occurrence with a seed set. The query answering method could also help to overcome the limitations of KB enrichment [AFE08]. They proposed an inductive method to improve the instance retrieval and enriched the KB by using an applied algorithm based on the k-NN (k-Nearest Neighbor). As described above, almost all of works used Web documents as a source, cooccurred words as a clue to define new concept, and probabilistic method to measure related degree. The importance of KB enrichment is getting increased however there is no appropriate method which gives a connection between a concept defined in WordNet and new concept extracted from unstructured raw documents. Though [HYK09] tried to make the connections by using semantic method, the performance was not satisfied. Therefore, we propose new automatic method to enrich WordNet concepts in this paper.
350
Myunggwon Hwang et al.
3 Background Works This research for WordNet concept enrichment using Wikipedia is based on two important factors; one is an enriched WordNet; the other is context information of Wikipedia. This section describes those factors simply. 3.1 Enriched WordNet WordNet has been developed according to knowledge system of human and it contains more than 81,000 concepts and more than 200,000 relations between concepts (in case of WordNet 2.1). The WordNet is fundamental KB for semantic document processing but it does not contain all of relations [HK09], [HK09], [HCK10], [VCP07]. To make WordNet near to real world knowledge, a few works have proposed methods to enrich semantic relation network [HCK10], [VCP07]. [HCK10] has enriched WordNet (e-WordNet) and divided it into a light and a heavy versions according to its enriched degrees. The light has added 114,400 concept pairs which were extracted through analyzing glossaries of concepts. As a result, the light contains 318,160 concept pairs (concept pairs defined in WordNet 2.1 and additionally enriched concept pairs) and showed the best performance in Senseval-3 WSD (Word Sense Disambiguation) tasks. For the detail information about the enrichment, please refer to [HCK10]. Furthermore, additional research has pointed out that the light included unimportant concept pairs in a small part and filtered the concept pairs. Through the filtering, the light version has constituted 306,022 concept pairs and showed little bit higher precision rate in Senseval-3 WSD tasks. Therefore, in this research for WordNet concept enrichment, the light version of the e-WordNet is involved for grasping semantic relations (measuring relationship) between concepts. Fig. 1 depicts the gap between WordNet 2.1 of Princeton University and the light e-WordNet. 3.2 Context Information of Wikipedia This research for the WordNet concept enrichment utilizes context information of Wikipedia. A characteristic of the Wikipedia is to describe contents with deep regard to its title (subject) in detail. The contents is opened to all of subject domains such as historic events, natural events, natural objects, places, buildings, artificial objects, people, and so on and got continuously expanded with new contents by domain specific specialist. Therefore, the Wikipedia can be usefully utilized as another KB which is different to the existing KBs containing just concepts and semantic relation network between the concepts. The Wikipedia describes the content in many types such as title, abstract (short and extended), figure, category, infobox, and so on. For the usability of the Wikipedia, DBpedia3 provides the contents separately with URI [BLK09]. Especially, since the abstract information contains the core content of the document, the content is very near to the title semantically. Based on this
An Automatic Method for WordNet Concept Enrichment
351
QRGTCVKPIATQQO
QRGTCVKQP KRVSLWDOBURRP FQEVQT
JQURKVCN (a) Semantic relations based on WordNet
QRGTCVKPIATQQO JQURKVCN
QRGTCVKQP S KRVSLWDO URRP DUWKURVFRS\
PDWHUQLW\ KRVSLWDO
RSHUDWLQJ VXUJHRQ DERUWLRQLVW
JHVWDWLRQ
FQEVQT (b) Semantic relations based on the light version of the e-WordNet Fig. 1. Semantic relations among operating room#1, hospital#1, operation#5, doctor#1, (#p: part of, @: hypernym, : hyponym, ;gr: glossary relation). In real world, they think of that they must have implicit networks between those of concepts while the WordNet 2.1 does not contain the relation network. However, the light version of e-WordNet enriched by [6] and filtered by [5] contains the relations. It means that the e-WordNet contains semantic relation networks nearer to the real world.
352
Myunggwon Hwang et al.
fact, [CHK10] has suggested a method which extracts context information, concept pairs having semantic relationship between the title and its related concept extracted from the extended abstract. Table 1 shows a part of the context information extracted by [CHK10]. Table 1. Examples of context information (a pair of title and its related concept)
Title of Wiki Document
Ariolasoft4
Amshuverma5
Context-Info #WN Sense game#2 company#1 developer#1 computer#1 ... dynasty#1 emperor#1 kingdom#3 territory#1 battle#1 ...
Context Weight 0.232 0.134 0.089 0.072 ... 0.487 0.435 0.412 0.294 0.190 ...
An Automatic Method for WordNet Concept Enrichment
353
4 WordNet Concept Enrichment This research considers a document title of the Wikipedia as a concept and tries to give a connection between a title concept and WordNet concept. Fig. 2 shows the system architecture. The system architecture is consisted of five components. The first is Wikipedia
9KMKRGFKC&QEWOGPV5GV
([WHQGHG $EVWUDFW
G9QTF0GV
6\QWDFWLF3DWWHUQ$QDO\]HU ([WUDFWHG:RUGV
:RUG 0DWFKLQJ
+HDG([WUDFWRU +HDGZRUGV
3UHSDULQJK\SHU ZRUG /QFWNG2TGRCTCVKQPQH *[RGT9QTF
([WUDFWLQJ&RQFHSW/LVW %QPVGZV+PHQ
&RQFHSW/LVW
0HDVXULQJ5HODWLRQVKLSDQG 'HWHUPLQLQJ+\SHUFRQFHSW
#ECFGOKEALQWTPCN
+\SHU FRQFHSW
&RQQHFWLQJ+\SHU FRQFHSW WR'RFXPHQWĜV7LWOH
&RQWH[W ,QIR
/QFWNG-PQYNGFIG$CUG 'PTKEJOGPV
Fig. 2. System Architecture
-RXUQDO 3XEOLFDWLRQ 5HVHDUFK $UWLFOH 'LVFLSOLQH +XPDQLW\ %RRN 6RFLDOBVFLHQFH đ
354
Myunggwon Hwang et al.
document set. As mentioned previously, we use the extended abstract of Wikipedia document. The second and the third are e-WordNet and context information respectively described in previous section. This section explains the fourth (Module1: Preparation of hyper-word for concept candidates) and the fifth (Module2: Knowledge base enrichment) components in detail. 4.1 Module 1:Preparation of Hyper-Word To enrich WordNet by using the title concept as a subordinate concept or an instance, hyper-word should be prepared. It is the first sentence of the extended abstract of Wikipedia that simply and explicitly expresses hyperword of the title. To extract the appropriate word, we defined be-verb patterns and implemented syntactic sentence pattern analyzer. The pattern is following and table 2 shows the types of first sentences and its frequency which are matched with the pattern. In table 2, the groups of sentences are divided into 1,000 and 5,000 and it means total counts of analyzed sentences. =⇒ Pattern: (a) title + (b)is (was, were, are) + (c)(a, an, the) + (d)noun phrase. Table 2. The types of first sentences and its frequency
1000
is was are were Total
Total count of matched sentences 684 114 13 3 814
5000
is was are were Total
3576 641 55 16 4288
Total count of Patterns sentences
Percentage 68.4 11.4 1.3 0.3 81.4 71.52 12.82 1.1 0.32 85.76
Table 2 shows that most of first sentences follow the patterns. For better understanding, we explain the method with examples. Ex. 1)(a)AMSD Ariadna6 (b)is (c)the (d)first Russian web browser ... Ex. 2) (a)AMSDOS7 (b)is (c)a (d)disk operating system ...
An Automatic Method for WordNet Concept Enrichment
355
Ex. 3) (a)Amshuverma (b)was (c)the (d)Licchavi king of Nepal ... In the examples, the noun phrase which can be a hyper-word8 candidate is (d) part. From the examples, ’first Russian web browser,’ ’disk operating system,’ and ’Licchavi king of Nepal’ are extracted as the candidates. To prepare the appropriate hyper-word defined in WordNet, we follow next steps. (a) Remove general words from the extract noun phrase →one of, member of, kind of, extension of, type of, name of, series of, model of, (b) Make a set of possible head words from the extracted noun phrase →{first Russian web browser, Russian web browser, web browser, browser} from ’first Russian web browser →{disk operating system, operating system, system} from ’disk operating system →{Licchavi king of Nepal, Licchavi king, king} from ’Licchavi king of Nepal’ (c) Remove an element(s) which is not defined in WordNet →{web browser, broswer} →{disk operating system, operating system, system} →{king} (d) Remove an element(s) which is a part of another element in the same set →’web browser’ ⊃ ’browser’ {web browser} →’disk operating system’ ⊃ ’operating system’ ⊃ ’system’ {disk oper ating system} →{king} We could extract a hyper-word of a title of Wikipedia document and the word is delivered to Module2 (knowledge base enrichment) for choosing correct hyper-concept and connecting the title to WordNet. 4.2 Module 2:Knowledge Base Enrichment A word contains one meaning or more. For example, a word ’paper’ expresses seven meanings such as a material, a scholarly article, etc. It is the same case for hyper-word delivered from previous step. In case of ’king’, it has ten WordNet senses (meanings). Therefore, we should determine one sense as a hyper-concept which is a WordNet concept to be connected to the title concept. This module determines appropriate concept (WordNet sense) according to following steps and the module uses the context information of Wikipedia
356
Myunggwon Hwang et al.
for grasping relationship of each hyper-concept candidate. (a) Make a WordNet sense list (SL=si , lin, s is a element of SL, n is a size of SL) which are expressed by the hyper-word → SLweb browser = {web browser#1} → SLdisk operating system = {disk operating system#1} → SLking = {king#1, king#2, . . . , king#10} (b) If the size of SL is 1, the element is determined as a hyper-concept (HC). Otherwise, this step is skipped. → |SLweb browser | = 1, HC(AM SD Ariadna) = web browser#1 (a program used to view HT M Ldocuments) → |SLdist operating system | = 1, HC(AM SDOS) = disk operating system#1 (an operating system that is on a disk) → |SLking | = 10 processed on next step (c) A degree (hyper-concept weight) of relationship of each element (sense) included in SL is measured. In measuring the degree, the context information (CI = {ck , 1 k m}, c is an element of CI and m is a size of CI) of the document is used for constructing semantic network with each hyper-concept candidate. A concept which has the maximum value is determined as a hyperconcept. SLking = {king#1, king#2, . . . , king#10} (c-1) Grasps semantic relation network between each element in SL and the information of CI through matching e-WordNet. Fig.3 shows the networks centered in a ’king#1’ and a ’king#2.’ (the other concepts do not make a relation networks.) (c-2) Measures hyper-concept weight (whc) by using (1) and (2). Relatedness values between ’king#1’ and the context are followings. relatedness(king#1, emperor#1) = 1/3 relatedness(king#1, dynasty#1) = 1/3 relatedness(king#1,kingdom#3) = 1/2 relatedness(king#1, territory#1) = 1/5 And, the value for ’king#2’ is following. relatedness(king#1, battle#1) = 1/5 According to (2), each hyper-concept weight is measured. Whc (king#1) = 1/3 + 1/3 + 1/2 + 1/5 1.36 Whc (king#2) = 1/5 = 0.2
An Automatic Method for WordNet Concept Enrichment
357
F[PCUV[
GORGTQT
FURZQHGBKHDG
MKPI
SHSLQ
GHPHVQH UHJLRQ
# MKPIFQO
VGTTKVQT[ (a) Semantic relations of ’king#1’
MKPI
VS\
DCVVNG F
FKDOOHQJHU
DUPHGBIRUFHV
(b) Semantic relations of ’king#2’ Fig. 3. Semantic relation network between each concept of a word ’king’ and the context information of its document.
relatedness(si , ck ) =
arg si ∈SL ,ck ∈CI
1 min (dist (si , ck ))
n
whc (si ) = ∑ arg (relatedness(si , ck )) k =1 ck ∈CI
358
Myunggwon Hwang et al.
(c-3) Determines a hyper-concept which has the maximum hyper-concept weight. HC(Amshuverma) = king#1(amalesovereign; rulerof akingdom) Through steps above, we can give a connection between a title of Wikipedia document and a concept of WordNet.
An Automatic Method for WordNet Concept Enrichment
359
5 Experimental Result To evaluate this method which enriches WordNet concepts through conceptualizing the titles of Wikipedia documents, we selected 1000 extended abstracts which contain a word ’computer.’ And we implemented a system which carries out the steps described in section 4. The system extracted first sentence from the abstracts and chose a hyper-concept of the title. And the result was compared to a method proposed in [HYK09] which is similar to this work in point of knowledge based semantic method. The pairs of hyper-concepts and new concepts (document titles) are evaluated by specialists of computer domain. Table 3 shows the precision rate of each method. Table 3. Examples of context information (a pair of title and its related concept)
This method Precision (%)
79.1
Method of [HYK09] 64.0 (The best case)
The method proposed in this paper shows 15% higher than that of [HYK09]. In [HYK09], it considers remarkable noun phrases and proper nouns as new concepts and uses the head of the noun phrase as a hyper-word candidate. However, it could not define abbreviate expressions such as ’ABC,’ ’CEO,’ ’HTML,’ etc. and names for tangible or intangible object such as a kind of song ’Adventures in Radioland,’ a kind of computer program ’180SearchAssistant,’ a field of computer science ’Natural Language Processing,’ etc. On the other hand, since it made a constitution of hyper-words extracted from first sentences which are trustworthy and calculated relationship between hyperconcept candidates and the context information, the method described in this paper could surpass the method of [HYK09]. Fig. 4 shows a concept hierarchy enriched by this research. Each leaf node means the title concept of Wikipedia document and it could be newly added under an appropriate WordNet concept. As shown in Fig. 4, this method could give connections between the title concepts and WordNet concepts however a step choosing hyper-concept candidates met a few limitations. The limitations are generally divided into three kinds like specified expression (a hyper-concept is too small to cover all of features of the title), generalized expression (a hyper-concept can cover the features of the title however the concept is too general), and a case of a hyper-concept which is not defined in WordNet while the concept is used by people (for example, ’assistant’ is defined only meaning of human in WordNet however it is used as a kind of machine or program in real world). This research still has a limitation to be solved while it attained excellent precision rate 15% higher than the existing work. We believe that it can be helpful to
360
Myunggwon Hwang et al. HQWLW\ đ FRPSXWHUFRGH DOEXP
LQVWLWXWLRQ
#DW &KU Ĕ PF9KPF #FCOCPF'XG #FXGPVWTGUKP4CFKQNCPF FRPSDQ\
VRIWZDUH
VJG/CZ 5VWFKQU
Ĕ VJ.GXGN #EVKX/GFKC 4QDQVKEU #ESWKEQT 6GEJPQNQI[
PDOHYROHQWSURJUDP
SURJUDP
YLUXV &%CNE &(CZ
#&8+5'
5GCTEJ#UUKUVCPV #+
Ĕ
M NQ #+&5 #
%$Ĕ #+
Fig. 4. Enriched WordNet with Wikipedia titles (3D-Calc99 , 3D Fax10 , 180SearchAssistant11 , ADVISE12 , AIDA3213 , 126014 , 5lo15 , ABC16 , AIDS17 , 2the Max18 , 321 Studios19 , ActivMedia Robotics20 , 7th Level21 , Acquicor Technology22 , Abu-Dis23 , 2nd Wind24 , Adam and Eve25 , Adventures in Radioland26 , etc).
reduce time, labor, conflict, and cost to build knowledge base even though the method has a limitation.
An Automatic Method for WordNet Concept Enrichment
361
Table 4. Limitations in choosing hyper-concept candidates
cases
Subjects (Titles) 8.3 filename27
Specified expression
989 Studios28
A/UX29 Generalized expression Abstract structure30 ACD Canvas31
Not defined in WordNet
Noun Phrases
Hyper- concept by system
filename convention#2 convention Division of Sony Comdivision#2 puter Entertainment Apple Computer’s implementation implementa- #2 tion formal object#1 object ...publishing product#1 product
Proper hyperconcept file system#1
company#1
operating system#1 structure#2 software#1
Agda32
proof assistant
assistant#1
assistant as a machine or program
ANSYS33
...simulation software provider#1 provider
provider as a company#2
362
Myunggwon Hwang et al.
6 Conclusion This paper contained a method enriching WordNet concepts through analyzing Wikipedia documents. The WordNet is utilized in diverse works for semantic information processing. However the WordNet does not define all of concepts used in real world. To overcome the limitation, we proposed a method which considers the title of Wikipedia document as a concept, extracts hyper-word candidate from first sentence of the extended abstract of Wikipedia, and determines a hyper-concept which has the maximum weight of relationship. As a result, this research has attained about 79(%). Moreover the research has strength because it uses Wikipedia documents. Wikipedia contains documents more than 3.2 million while WordNet 2.1 has about 81,000 noun words and the Wikipedia is getting grown continuously with new concepts including trends, technologies, products, people, and so on. Therefore, the conceptualization of Wikipedia documents’ titles proposed in this paper can be very useful resource for semantic information processing.
Acknowledgement This research was co-supported by the MKE(The Ministry of Knowledge Economy), Korea, under the ITRC(Information Technology Research Center) support program supervised by the NIPA(National IT Industry Promotion Agency) (NIPA-2010-(C1090-1011-0009)) and by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MEST) (No. 2009-0064749).
An Automatic Method for WordNet Concept Enrichment
363
7 End Notes 1. WordNet (A lexical database for English): http://wordnet.princeton.edu/ 2. Wikipedia (The Free Encyclopedia): http://en.wikipedia.org/wiki/Main Page 3. DBpedia: http://dbpedia.org/About 4. ’Ariolasoft’ From Wikipedia: http://en.wikipedia.org/wiki/Ariolasoft 5. ’Amshuverma’ from Wikipedia: http://en.wikipedia.org/wiki/Amshuverma 6. ’AMSD Ariadna’ From Wikipedia: http://en.wikipedia.org/wiki/AMSD Ariadna 7. ’AMSDOS’ From Wikipedia: http://en.wikipedia.org/wiki/AMSDOS 8. A hyper-word and a hyper-concept are different. In general, a word contains one concept or more. Therefore, for the first step, we prepare a hyper-word and determine a hyper-concept among concepts expressed by the word. 9. ’3D-Calc’ from Wikipedia: http://en.wikipedia.org/wiki/3D-Calc 10. ’3D Fax’ from Wikipedia: http://en.wikipedia.org/wiki/3D Fax 11. ’180SearchAssistant’ from Wikipedia: http://en.wikipedia.org/wiki/ 180SearchAssistant 12. ’ADVISE’ from Wikipedia : http://en.wikipedia.org/wiki/ADVISE 13. ’AIDA32’ from Wikipedia : http://en.wikipedia.org/wiki/AIDA32 14. ’1260’ from Wikipedia : http://en.wikipedia.org/wiki/1260 15. ’5lo’ from Wikipedia : http://en.wikipedia.org/wiki/5lo 16. ’ABC’ from Wikipedia : http://en.wikipedia.org/wiki/ABC (computer virus) 17. ’AIDS’ from Wikipedia : http://en.wikipedia.org/wiki/AIDS (computer virus) 18. ’2the Max’ from Wikipedia : http://en.wikipedia.org/wiki/2the Max 19. ’321 Studios’ from Wikipedia : http://en.wikipedia.org/wiki/321 Studios 20. ’ActivMedia Robotics’ from Wikipedia : http://en.wikipedia.org/wiki/ ActivMedia Robotics
364
Myunggwon Hwang et al.
21. ’7th Level’ from Wikipedia : http://en.wikipedia.org/wiki/7th Level 22. ’Acquicor Technology’ from Wikipedia : http://en.wikipedia.org/wiki/ Acquicor Technology 23. ’Abu-Dis’ from Wikipedia : http://en.wikipedia.org/wiki/Abu-Dis 24. ’2nd Wind’ from Wikipedia : http://en.wikipedia.org/wiki/2nd Wind 25. ’Adam and Eve’ from Wikipedia : http://en.wikipedia.org/wiki/Adam and Eve (album) 26. ’Adventures in Radioland’ from Wikipedia : http://en.wikipedia.org/wiki/ Adventures in Radioland 27. ’8.3 filename’ from Wikipedia : http://en.wikipedia.org/wiki/8.3 filename 28. ’989 Studios’ from Wikipedia : http://en.wikipedia.org/wiki/989 Studios 29. ’A/UX’ from Wikipedia : http://en.wikipedia.org/wiki/A/UX 30. ’Abstract structure’ from Wikipedia : http://en.wikipedia.org/wiki/ Abstract structure 31. ’ACD Canvas’ from Wikipedia : http://en.wikipedia.org/wiki/ACD Canvas 32. ’Agda’ from Wikipedia : http://en.wikipedia.org/wiki/Agda (theorem prover) 33. ’ANSYS’ from Wikipedia : http://en.wikipedia.org/wiki/ANSYS
References [LLY04] Liu, S., Liu, F., Yu, C., and Meng, W.: An effective approach to document retrieval via utilizing WordNet and recognizing phrases. In Proceeding of SIGIR 2004, 266–272 (2004) [HVV06] Hliaoutakis, A., Varelas, G., Voutsakis, E., Petrakis, E., and Milios, E., ”Information Retrieval by Semantic Similarity,” International Journal on Semantic Web and Information Systems, 2(3), 55–73 (2006) [HK09]
Hwang, M.G. and Kim, P.K.: A New Similarity Measure for Automatic Construction of the Unknown Word Lexical Dictionary. International Journal on Semantic Web & Information Systems. 5(1), 48-64, JanuaryMarch, 2009.
[HK09]
Hwang, M.G. and Kim, P.K.: An Enrichment Method on Semantic Relation Network of WordNet. The Journal of Korean Institute of Information Technology, 7(1), 209–215 (2009).
An Automatic Method for WordNet Concept Enrichment
365
[HCK10] Hwang, M.G., Choi, C., and Kim, P.K.: Automatic Enrichment of Semantic Relation Network and its Application to Word Sense Disambiguation. IEEE Transaction on Knowledge and Data Engineering (will be published) [VCP07] Velardi, P., Cucchiarelli, A., and Petit, M.: A Taxonomy Learning Method and Its Application to Characterize a Scientific Web Community. IEEE Transactions on Knowledge and Data Engineering, 19(2), 180–191 (2007) [CHK10] Choi, D.G., Hwang, M.G., and Kim, P.K.: Semantic Context Extraction from Wikipedia Document. In Proceedings of The 2010 International Conference on Semantic Web and Web Services, 38–41 (2010) [HYK09] Hwang, M.G., Youn, B.S., & Kim, P.K.: A Taxonomy Enrichment Method using Remarkable Noun Phrase. In Proceedings of International Conference on Convergence Technology and Information Convergence (CTIC 2009), 50–56 (2009) [MPR01] Montoyo, A., Palomar, M., and Rigau, G.: Method for WordNet Enrichment using WSD. In Proceedings of the 4th Internatiional Conference on Text, Speech and Dialogue, Vol. 2166, 180–186 (2001) [CV07]
Celjuska, D. and Vargas-Vera, M.: A Semi-Automatic System for Ontology Population from Text. Knowledge Media Institute, Vol. 14, 373–402 (2007)
[SPP09] Song, H.J., Park, S.B., and Park, S.Y.: An Automatic Ontology Population with a Machine Learning Technique from Semi-Structured Documents. 2009 IEEE International Conference on Information and Automation, 534–539 (2009) [BSW07] Boer, V.D., Someren, M.V., and Wielinga, B.J.: Relation Instantiation for Ontology Population using the Web. Lecture Note in Computer Science, Vol.4314, 202–213 (2007) [AFE08] d’Amato, C., Fanizzi, N. and Esposito, F.: Query Answering and Ontology Population. 5th European Semantic Web Conference, Vol. 5021, 288–302 (2008) [BLK09] Bizer, C., Lehmann, J., Kobilarov, G., Auer, S., Becker, C., Cyganiak, R., and Hellmann, S.: DBpedia - A Crystallization Point for the Web of Data. Web Semantics: Science, Services and Agents on the World Wide Web, 7(3), 154–165 (2009) [HCC10] Hwang, M.G., Choi, D.G., Choi, J.H., Kim, H.I., and Kim, P.K.: Similarity Measure for Semantic Document Interconnections. Information-An International Interdisciplinary Journal, 13(2), 253–267 (2010) [Fel98] Fellbaum, C.L.: WordNet: An Electronic Lexical Database. MIT Press. (1998)
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks Using Successive Tuning Method Keon-Jun Park1 , Sung-Kwun Oh2∗ , and Yong-Kab Kim3 1
2
3
Dept. of Electrical Engineering, University of Suwon, San 2-2 Wau-ri, Bong-dam-eup, Hwaseong-si, Gyeonggi-do, 445-743, South Korea
[email protected] Dept. of Electrical Engineering, University of Suwon, San 2-2 Wau-ri, Bong-dam-eup, Hwaseong-si, Gyeonggi-do, 445-743, South Korea
[email protected] Dept, of Electric and Electronic Engineering, Wonkwang University, 344-2 Shinyong-dong, Iksan-si, Chonbuk, 570-749, South Korea
[email protected]
Summary. In this paper, we introduce the design methodology of interval type-2 fuzzy set-based fuzzy neural networks (IT2FSFNN). IT2FSFNN is the network of combination between the fuzzy neural network (FNN) and interval type-2 fuzzy set with uncertainty. The premise part of the network is composed of the fuzzy division of respective input space and the consequence part of the network is represented by polynomial functions with interval set. To determine the structure and estimate the values of the parameters of IT2FSFNN we consider the successive tuning method with generation-based evolution by means of genetic algorithms. The proposed network is evaluated with the use of numerical experimentation.
1 Introduction Fuzzy neural networks (FNNs) [1,2] have emerged as one of the active areas of research in fuzzy inference systems and neural networks. These networks are predominantly concerned with the integration of these two fields. There have been many approaches to synthesize FNNs. Typically, FNNs are represented by fuzzy if-then rules while the back propagation (BP) is used to optimize the parameters of the networks. Zadeh [3] introduced the concept of a type-2 fuzzy set as an extension of fuzzy sets of type-1. Mizumoto and Tanaka [4] studied the set theoretic operations of type-2 fuzzy sets and discussed properties of membership grades of such sets. In contrast to type-1 fuzzy sets, in type-2 fuzzy sets the membership grades are not numeric values but fuzzy sets defined in the unit interval. ∗
Corresponding author
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 19, © Springer Basel AG 2011
368
Keon-Jun Park, Sung-Kwun Oh, and Yong-Kab Kim
Mendel and Karnik [5,6,7] studied the theory of type-2 fuzzy logic systems. These are also described in the form of fuzzy if-then rules, but their premises and/or consequents are type-2 fuzzy sets. An interval type-2 fuzzy neural network (IT2FNN) comes as a result of symbiotic interaction of interval type-2 fuzzy set and neural networks where this interaction is aimed at dealing with noisy environment. In this paper, we present the structure of IT2FSFNN that consists of interval type-2 fuzzy set forming the premise part of the rules and neural networks viewed as the consequence part. We use interval-valued triangular membership functions while the coefficients of the polynomial functions with interval set located in the consequents of the rules are learned by BP algorithm. We also optimize the structure such as the number of input variables, input variables to be selected, the number of the membership functions and the order of polynomial and the parameters of the networks such as the apexes of membership functions, uncertainty coefficient, the learning rate, and the momentum coefficient using real-coded genetic algorithms [8]. In genetic algorithms we consider successive the successive tuning method with generation-based evolution. The proposed network is evaluated through the numeric experimentation. The paper is organized as follows. Section 2 is concerned with the design of IT2FSFNN. Section 3 deals with the optimization of IT2FSFNN. Section 4 presents results of numeric experimentation. Finally Section 5 concludes the paper.
2 Design of IT2FSFNN The structure of IT2FSFNN emerges at the junction of interval type-2 fuzzy sets and neural network. In this section, the form of fuzzy if-then rules along with their development mechanism is discussed. More specifically, we elaborate on the three types of fuzzy inference and present the learning algorithm used to optimize the parameters of the consequent parts of the rules. 2.1 Interval Type-2 Fuzzy Set ˜ is characterized by a type-2 membership A type-2 fuzzy set, denoted here by A, function μA˜ (x) of the form A˜ = {(x), μA˜ (x) | ∀x ∈ X} in which 0 ≤ μA˜ (x) ≤ 1. A˜ can be expressed as ! A˜ = μA˜ (x)/x x∈X # " " = x∈X u∈Jx fx (u)/u x, Jx ⊆ [0, 1]
(1)
(2)
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks
369
The domain of a secondary membership function is called the primary membership of x. In (2), Jx is the primary membership of x, where Jx ⊆ [0, 1] for x ∈ X. The amplitude of a secondary membership function is called a secondary grade. In (2), fx (u) stands for a secondary grade. When fx (u) = 1, ∀u ∈ Jx ⊆ [0, 1] , then the secondary membership functions are intervals and μA˜ (x) is referred to as an interval type-2 membership function. Therefore the type-2 fuzzy set A˜ can be re-expressed as ! ! # ! ˜ μA˜ (x)/x = 1/u x, Jx ⊆ [0, 1] (3) A= x∈X
x∈X
u∈Jx
Uncertainty present in the primary membership values of the type-2 fuzzy set, consist of a bounded region - footprint of uncertainty (FOU). It is treated as the union of all primary membership grades, ˜ = F OU (A) Jx (4) x∈X
An example of a FOU is shown in the form of the shaded regions in Figure 1. The FOU is shaded uniformly to underline the interval nature of this type-2 fuzzy set. Here uncertainty resides with the apexes of the linear segments of the membership functions whose values could vary within a certain range and its spreads are adjusted by (1 + ρ)σ using the uncertainty parameter ρ.
u P A~ ( xc) P A~ ( x c)
Va
a
x' b
c
Vc
x
Fig. 1. Interval type-2 fuzzy set. a, b, c are membership parameters and σa and σc are uncertainties of a, c, respectively.
An upper membership function and a lower membership function are two type-1 membership functions that form the bounds for the FOU of type-2 fuzzy set. The upper membership function is associated with the upper bound ˜ and is denoted here by μ ˜ (x). The lower membership function of F OU (A), A ˜ and is described by μ (x). is associated with the lower bound of F OU (A), ˜ A Hence (3) can be rewritten in the following form ! ! # A˜ = 1/u x. (5) x∈X
u∈[μ ˜ (x),μA˜ (x)] A
370
Keon-Jun Park, Sung-Kwun Oh, and Yong-Kab Kim
2.2 The Structure of the IT2FSFNN As mentioned earlier, the structure of the IT2FNN involves interval type-2 fuzzy sets in the premise part and neural networks present in the consequence part of the rules. The overall topology of the network is illustrated in Figure 2.
[ P A~kc , P A~ ] [ fˆ kc , fˆ ] kc kc u
x1
yl
u
yˆ
u
x2
yr
u Wkc0
[Cykcl , Cy kcr ]
1 Case 1
Wkc1
Wkc2 Case 2
Wkc3 Case 3
Fig. 2. IT2FSFNN structure.
The notation used in this figure requires some clarification. The circles denote nodes of the IT2FSFNN while the node ’N’ pertains to a normalization procedure applied to the membership grades of the input variable xk . The output yˆ of the ’Σ’ is governed by some nonlinear function. Rkc : If xk is μA˜ (x) T hen ykc = f (x1 , · · · , xd )
(6)
As far as inference schemes are concerned, we distinguish between two cases Case 1 (Simplified Inference): 0 f = Wkc (7) Case 2 (Linear Inference): 0 f = Wkc +
d
i Wkc xi
(8)
i=1
Case 3 (Modified Quadratic Inference): 0 f = Wkc +
d i=1
i Wkc xi +
d d i=1 j=i+1
z Wkc xi xj
(9)
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks
371
here, z= d + 1, · · · , d(d + 1)/2. To be more specific, Rkc is the k, c-th fuzzy rule, while A˜kc denotes k, c-th i i i interval type-2 fuzzy set. Wkc = [wkc −sikc , wkc +sikc ], i = 0, · · · , d(d+1)/2 are i i consequent parameters of the rule. wkc and skc are the center and the spread i , respectively. of Wkc The functionality of each layer is described as follows. [Layer 1] The nodes in this layer transfer the inputs to the respective inputs. [Layer 2] The nodes here are used to calculate the membership degrees for given membership functions. Each primary membership function present in the premise part of fuzzy rule is assigned to be complementary with neighboring one using Min-Max and C-Means clustering [9], as shown in Figure 3 and Figure 4, respectively. The parameters σa and σc of each membership function appertain to the standard deviation of data included in each fuzzy subspace.
P kc
Ak1
Ak 2
Ak 3
min
max
k
Fig. 3. Definition of membership functions using Min-Max method. xmin and xmax are a minimum and a maximum values encountered in data.
P kc
Ak1
Ak 2
Ak 3
k
Fig. 4. Definition of membership functions obtained with the use of C-Means clustering. The apexes of the membership functions are the centers of the clustering.
372
Keon-Jun Park, Sung-Kwun Oh, and Yong-Kab Kim
When interval type-2 fuzzy sets are used, the firing set fkc of the rule Rkc becomes an interval coming in the following form. fkc = [μkc , μkc ]
(10)
[Layer 3] The nodes in this layer normalize the membership degrees for each input. (11) fˆkc = [fˆkc , fˆkc ] f fˆkc = g kc c=1
f kc
f , fˆkc = g kc
c=1
f kc
(12)
[Layer 4] The nodes in this layer are used to conduct type reduction. Note that left-most point yl and right-most point yr depend upon the values of fˆkc . Hence, yl and yr using Karnik-Mendel (KM) algorithm can be expressed as the follows d yl =
g ˆl l k=1 c=1 fkc ykc d g ˆl , yr k=1 c=1 fkc
d =
g ˆr r k=1 c=1 fkc ykc d g ˆr . k=1 c=1 fkc
(13)
l r Here, fˆkc and fˆkc are upper and lower firing sets which have an effect on yl and yr , respectively. [Layer 5] The nodes in this layer compute the overall outputs. In the IT2FSFNN, the output yˆ is an interval set, so we require to defuzzify (decode) it by taking the average of yl and yr . Commonly, the defuzzified output of IT2FSFNN is computed as
yˆ =
yl + yr 2
(14)
2.3 The Structure of the IT2FSFNN The parametric learning of the IT2FNN is realized by adjusting connections of the neurons and as such it could be realized by running a standard BackPropagation (BP) algorithm. The performance index Ep is based on the Euclidean distance, 2 1 Ep = (15) yp − yˆp 2 where, Ep is an error reported for the p-th data, yp is the p-th target output data and yˆp stands for the p-th actual output of the model. As far as learning is concerned, the connections are changed (adjusted) in a standard fashion, i i i (p + 1) = wkc (p) + Δwkc wkc
where this update formula follows the gradient descent method, namely
(16)
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks
373
∂Ep i Δwkc =η − i ∂wkc
(17)
with η being a positive learning rate. From the chain rules we have the following expression. 1 ∂Ep ∂ yˆp ∂yl ∂ yˆp ∂yr ∂Ep =− + − i i i 2 ∂ yˆp ∂yl wkc ∂yr wkc ∂wkc
(18)
Quite commonly to accelerate convergence, a momentum coefficient α is being i . added to the learning expression. And sikc is obtained in the same way as wkc Then the complete update formula reads as follows 0 l r = 0.25η yp − yˆp fˆkc + fˆkc Δwkc 0 0 +α wkc (p) − wkc (p − 1) (19) Δs0kc = 0.25η
i Δwkc = 0.25η
Δsikc = 0.25η
(20)
l r xi yp − yˆp fˆkc + fˆkc i i +α wkc (p) − wkc (p − 1)
(21)
l r |xi | yp − yˆp − fˆkc + fˆkc +α sikc (p) − sikc (p − 1)
(22)
l r xi xj yp − yˆp fˆkc + fˆkc z z +α wkc (p) − wkc (p − 1)
(23)
z Δwkc = 0.25η
Δszkc = 0.25η
l r yp − yˆp − fˆkc + fˆkc +α s0kc (p) − s0kc (p − 1)
yp − yˆp
l r + fˆkc − fˆkc
|xi xj | +α szkc (p) − szkc (p − 1)
(24)
3 OPTIMIZATION of IT2FSFNN It has been demonstrated that genetic algorithms (GAs) [8] are useful global population-based optimizers. GAs are shown to support robust search in
374
Keon-Jun Park, Sung-Kwun Oh, and Yong-Kab Kim
complex search spaces. Given their stochastic character, such methods are less likely to get trapped in local minima (which becomes quite a common problem in case of gradient-descent techniques). The search in the solution space is completed with the aid of several genetic operators with reproduction, crossover, and mutation being the standard ones. Let us briefly recall the essence of these operators. Reproduction is a process in which the mating pool for the next generation is chosen. Individual strings are copied into the mating pool according to the values of their fitness functions. Crossover usually proceeds in two steps. First, members from the mating pool are mated at random. Secondly, each pair of strings undergoes crossover as follows; a position l along the string is selected uniformly at random from the interval [1, l -1], where l is the length of the string. Swapping all characters between the positions k and l creates two new strings. Mutation is a random alteration of the value of a string position. In real coding, mutation is defined as an alternation at a random value in special boundary. Usually mutation occurs with a small probability. Those operators, combined with the proper definition of the fitness function, constitute the main body of the genetic optimization In this study, when using genetic algorithms we have to determine structural components such as the number of input variables, input variables being selected and the number of the membership functions to be used in the premise part and the order of polynomial (Type of the polynomial) occurring in the conclusion part. The parameters of the membership function and uncertainty parameter of the premise and the learning rate and the momentum coefficient occurring in the conclusion part are also optimized in a successive manner. In the identification of the network we exploit a method of successive tuning. This tuning method involves a simultaneous identification of the structure and parameters of the network. Figure 5 visualizes an arrangement of the content of the chromosome to be used in genetic optimization.
Chromosomes for structure identification
no. of inputs (1)
no. of input variables to be selected (d)
no. of MFs (1)
Type of polynomial (1)
Chromosomes for parameters identification
MF apexes (2*d)
uncertainty factors (d)
MF apexes (5*d)
uncertainty learning momentum factors rate coefficient (4*d) (1) (1)
Fig. 5. Data structure of chromosomes used by the genetic algorithm in the successive optimization process.
A search-space of the structure and the parameters in successive tuning method tends to focus on a search-space of the parameters due to differences in the length of chromosomes. To effectively identify the network, we also consider the generation-based evolution, which is an evolutionary method that adjusts an assigned rate (the number of assigned generations) of structural optimization (s.o) for structure-side chromosomes and parametric optimization (p.o) for parameter-side chromosomes according to the increase of number
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks
375
of generations by conducting separative operations (i.e. crossover and mutation operation) for structure and parameter chromosomes. In successive tuning method, we use a fixed generation-based evolution. This evolution is a method that carries out both structural and parametric optimization with the same assigned rate as shown Figure 6. : structure operation (s. o)
length of arrow : no. of generation
: parameter operation (p. o)
Fixed generationbased evolution generation
Fig. 6. Fixed generation (Fixed topology/parameter alternation)-based evolution.
4 EXPERIMENTAL STUDIES This time series data (296 input-output pairs) coming from the gas furnace process has been intensively studied in the previous literature [10]. The delayed terms of methane gas flow rate u(t) and carbon dioxide density y(t) are used as six input variables organized in a vector format as [u(t−3), u(t−2), u(t−1), y(t−3), y(t−2), y(t−1)]. y(t) is the output variable. The first part of the data set (consisting of 148 pairs) was used for training purposes. The remaining part of the series serves as a testing data set. And also, the testing data set were corrupted by white Gaussian noise with noise level 0dB for noise environment. This noise corrupt data repeats 5 times. We consider the MSE as a performance index. 2 1 yi − yˆi PI = m i=1 m
Table 1. Initial parameters for GAs
parameter generation crossover rate mutation rate successive tuning : Case I s.o.: successive tuning : Case II s.o.:
value 200 0.65 0.1 10, p.o.: 10 20, p.o.: 20
(25)
376
Keon-Jun Park, Sung-Kwun Oh, and Yong-Kab Kim Table 2. Initial parameters for FSFNN and IT2FSFNN
parameter value input variables to be selected 1 ≤ k ≤ 2 No. of MFs 2≤M ≤5 polynomial Type 1≤T ≤3 Apexes of MFs MinMax/HCM learning rate 0.0 ≤ η ≤ 1.0 moment coefficient 0.0 ≤ α ≤ 0.1 IT2FSFNN input variables to be selected 1 ≤ k ≤ 2 No. of MFs 2≤M ≤5 polynomial Type 1≤T ≤3 Apexes of MFs MinMax/HCM uncertainty coefficient −1.0 ≤ ρ ≤ 1.0 learning rate 0.0 ≤ η ≤ 1.0 moment coefficient 0.0 ≤ α ≤ 0.1 FSFNN
The experiments were carried out using the environment with parameters specified in Table 1 and Table 2. Table 3 and Table 4 summarize the performance index of FSFNN and IT2FSFNN, respectively. MPI is the objective function with weighting factor θ = 0.5, PI is for training data set, E PI is for testing data set, and E Pin is the value of average and standard deviation for noise corrupt data. From the table IT2FSFNN is better than FSFNN. The best performance is MPI = 0.141, PI = 0.026 and E PI = 0.257, and E PIn = 6.979±0.667 obtained by means of the fixed generation-based evolution (s.o.:10, p.o.:10), along with HCM clustering algorithm. Figure 7 shows the initial and optimized parameters of the membership functions for the best network. The membership functions of the light gray color and the dark gray color are the initial and the tuned membership functions, respectively. Fig. 8 shows the optimization process for the performance index obtained in successive generations of the genetic optimization. Table 3. Performance Index of FSFNN
Method Inputs M T MPI PI MM: Case I 1 6 5 2 0.146 0.027 HCM:Case II 1 6 4 3 0.144 0.028 MM: Case I 1 6 5 3 0.144 0.040 HCM:Case II 1 6 4 3 0.144 0.026
E PI E PIn 0.265 7.014±0.604 0.260 8.179±1.166 0.248 7.257±0.681 0.262 7.271±0.669
Design of Interval Type-2 Fuzzy Set-based Fuzzy Neural Networks
377
Table 4. Performance Index of IT2FSFNN
Method Inputs M T MPI PI MM: Case I 1 6 3 3 0.145 0.025 HCM:Case II 1 6 3 3 0.144 0.028 MM: Case I 1 6 2 2 0.141 0.026 HCM:Case II 1 6 2 3 0.150 0.029
small
big
small
1
1
0.8
0.8
0.6
0.6
0.4
0.4
0.2
0.2
0
0.0
0.2
E PI E PIn 0.264 6.698±0.582 0.259 7.274±0.691 0.257 6.979±0.667 0.271 6.913±0.686
0.4
0.6
0.8
0
1.0
0.0
0.2
0.4
ut
big
0.6
0.8
1.0
yt
Fig. 7. Initial and tuned membership functions. 0.35
8 MPI PI E_PI
0.25 0.2 0.15 0.1
7 E_PIn1 E_PIn2 E_PIn3 E_PIn4 E_PIn5 Average
6.5 6
0.05 0 0
7.5 Performace Index
Performace Index
0.3
50
100 generation
150
200
5.5 0
50
100 generation
150
200
Fig. 8. Optimization process.
5 CONCLUSIONS In this paper, we have introduced the design of IT2FSFNN and discussed successive tuning method using genetic algorithm for hybrid optimization of structure and parameters identification. From the result in the previous section, we were able to design a good network. The IT2FSFNN showed that the performance of the network is better than that of FSFNN approximation ability and general capability as well as noise robust under the noise-corrupted environment. The design of the network may encounter difficulties in case of highly dimensional data and these dimensionality issues need to be tackled (e.g., through exploiting various partition strategies).
378
Keon-Jun Park, Sung-Kwun Oh, and Yong-Kab Kim
6 ACKNOWLEDGMENTS This work was supported by the GRRC program of Gyeonggi province [GRRC SUWON2010-B2, Center for U-city Security & Surveillance Technology] and also was supported by National Research Foundation of Korea Grant funded by the Korean Government (NRF-2009-0074928)
References [1]
[2] [3] [4] [5] [6] [7] [8] [9]
[10]
Yamakawa, T.: A Neo Fuzzy Neuron and Its Application to System Identification and Prediction of the System Behavior. Proceeding of the 2nd International Conference on Fuzzy logic & Neural Networks, 447–483 (1992) Buckley, J. J., Hayashi, Y.: Fuzzy neural networks: A survey. Fuzzy Sets Syst., 66, 1–13 (1994) Zadeh, L. A.: The concept of a linguistic variable and its application to approximate reasoning-I. Information Science., 8, 199–249 (1975) Mizumoto, M., Tanaka, K.: Some Properties of Fuzzy Sets of Type-2. Information and Control, 31, 312–340 (1976) Karnik, N., Mendel, J. M. , Liang. Q.: Type-2 Fuzzy Logic Systems. IEEE Trans. On Fuzzy Systems, 7, 643–658 (1999) Liang. Q., Mendel, J. M.: Interval Type-2 Fuzzy Logic Systems: Theory and Design. IEEE Trans. On Fuzzy Systems, 8, 535–550 (2000) Mendel, J. M.: Uncertain Rule-Based Fuzzy Logic Systems: Introduction and New Directions. Prentice-Hall, NJ (2001) Golderg, D. E.: Genetic Algorithm in search, Optimization & Machine Learning. Addison wesley, (1989) Krishnaiah, P. R., Kanal, L. N.: Classification, pattern recognition, and reduction of dimensionality. (ed) volume 2 of Handbook of Statistics, NorthHolland, Amsterdam (1982) Box, G. E. P., Jenkins, G. M.: Time Series Analysis: Forecasting and Control. Holden-Day, San Francisco, CA (1976)
Part IV
Multimedia
Improving Image Segmentation Algorithms with Differential Evolution Chih-Cheng Hung1 , Ziwei Ren2 , Wenfan Li3 , and Qing Yang4 1
2
3
4
Southern Polytechnic State University, Marietta, GA 30060-2896 USA
[email protected] Southern Polytechnic State University, Marietta, GA 30060-2896 USA
[email protected] Southern Polytechnic State University, Marietta, GA 30060-2896 USA
[email protected] Auburn University Auburn, AL 36849 USA
[email protected]
Summary. This paper proposes three algorithms based on the K-means, the simple competitive learning (SCL) algorithm, and the fuzzy c-means algorithm with differential evolution algorithm for image classification. Due to the local optimal performance of these three algorithms, the differential evolution (DE) is integrated with the K-means algorithm, the SCL algorithm and the fuzzy c-means algorithm to avoid the local optimal solution and improve the performance of three algorithms. One is called the DE-K-means algorithm which is a combination of DE and K-means; one is called the DE-SCL algorithm which is a combination of DE and SCL; and the other DE-FCM algorithm which is a combination of DE and FCM. The preliminary experimental results show that these proposed algorithms are more promising on image segmentation.
1 Introduction The K-means algorithm, the simple competitive learning (SCL) neural network, and the Fuzzy C-means (FCM) clustering algorithm are widely used clustering techniques in image segmentation systems. In these techniques, the clustering results are frequently dependent on the initial cluster centers. Therefore, searching for good initial parameters is challenging because these algorithms require numerous experiments to determine the input parameters for the optimal clustering results. Differential Evolution (DE), proposed by Storn and Price [8-9], is a simple and powerful algorithm for optimization. Recently, the DE algorithm has become quite popular in computational intelligence and cybernetics communities. It has been successfully applied to diverse domains of science and engineering, machine intelligence, and pattern recognition. It has been shown to perform better than the Genetic Algorithm (GA) [3] and the Particle Swarm Optimization (PSO) [4, 7] in several S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 20, © Springer Basel AG 2011
382
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
numerical benchmarks [5]. Similar to other evolutionary algorithms, two fundamental processes drive the evolution of the DE population: the variation process, which enables exploring different regions of the search space and the selection process, which ensures the exploitation of previous knowledge about the fitness landscape. Some empirical study, however, shows that DE may occasionally stop proceeding toward the global optimum even though the population has not converged to a local optimum or any other point [6]. Intermittently, even new chromosomes are added to the population; the algorithm does not progress by finding any better solutions. This situation is usually referred to as stagnation. DE also suffers from the problem of premature convergence, where the algorithm converges to some local optima of a multimodal objective function, losing its diversity. The probability of stagnation depends on how many different potential trial solutions are available and also on their capability entering into the population of the subsequent generations [11]. Like other evolutionary algorithms, the performance of DE deteriorates with the growth of the dimensionality of the search space as well. Many researchers have proposed algorithms to improve the convergence speed and robustness (ability to produce similar results over repeated runs) of DE by tuning the parameters like population size (NP), the scale factor (F), and the crossover rate (Cr). In order to improve the performance of image segmentation algorithms, DE is proposed for optimization in the K-means, the FCM, and the SCL. The performance of the proposed algorithm will be compared with other similar methods through experimental results. The remainder of this paper is organized as follows. In section 2, first the differential evolution is briefly described. Then, the K-means algorithm, the simple competitive learning neural network, and the Fuzzy C-means algorithm are sketched. The proposed algorithms are described in section 3. Section 4 presents our preliminary experimental results. The conclusion and future work then follows.
2 Related Work 2.1 Differential Evolution Differential evolution (DE) is a population-based search strategy similar to standard evolutionary algorithms. The main difference is in the reproduction step where offspring is created from three parents using an arithmetic crossover operator. Although differential evolution does not make use of a specific mutation operator that depends on some probability distribution function, it introduces a new arithmetic operator which depends on the differences between randomly selected pairs of chromosomes. A chromosome is a solution which represented by a vector of real numbers. The DE algorithm in pseudocode listed below is given in [6]:
Improving Image Segmentation Algorithms with Differential Evolution
383
Begin Generate randomly an initial population of solutions. Calculate the fitness of the initial population. Repeat For each parent, select three solutions at random Create one offspring using the DE operators If the offspring is better than its parent the child will take its parents place Until a stop condition is satisfied. End
2.2 The K-means Clustering Algorithm The K-means algorithm was first introduced by McQueen for data classification and analysis. It is one of the simplest unsupervised learning algorithms, which is based on the minimization of a performance index. The algorithm first chooses K random cluster centers, and then assigns each sample to a cluster based on the minimum distance to the cluster centers. Then, it updates the cluster centers with the new average of the values in each cluster. In image segmentation, the data set would be a set of pixel vectors. Hence, each pixel of the image will be classified into a cluster. Steps in the K-means algorithm are listed below: Step 1: Initialize K cluster centers either randomly or taking from samples. Step 2: Calculate the distance for each pixel to each of the cluster centers and assign the pixel to the cluster which has the minimum distance to its center. Step 3: Update the new cluster center with the average of pixel values in each cluster. Step 4: Repeat steps 2 and 3 until the clustering converges. The K-means algorithm tends to find the local optimal rather than the global optimal solutions. When the initial cluster centers are chosen relatively far apart, the result becomes more acceptable. If the main clusters are close in the feature space, the K-means algorithm fails to recognize them with the unsupervised mode. To improve the performance of the K-means algorithm, optimization techniques are usually employed. 2.3 Simple Competitive Learning Neural Network Unsupervised training plays an important role in an image segmentation system. Many clustering techniques such as competitive learning neural network
384
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
and the K-means algorithm have been employed for unsupervised training [2, 10]. The following algorithm outlines the operation of the simple competitive learning network (shown in Figure 1) as applied to unsupervised training [2]; let L denote the dimension of the input vectors, which for us is the number of spectral bands. We assume that an output layer with n nodes is defined for the algorithm, where n is chosen so that the expected number of the classes is less than or equal to n. (i.e., in the 3-band case, L is 3). Each network node in the output layer corresponds to one output. Each output defines a spectral class where its center values are stored in the connections (weights) between the inputs and the output nodes.
Fig. 1. The x1 , x2 , ..., xL , are inputs, one for each component of the dada vector
Step 1: Initialize weights wij (t)(i = 1, ..., L and j = 1, ..., n) to small random values. Steps 2 - 5 are repeated for each pixel in the training data set for each iteration. Step 2: Present an input pixel X(t) = (x1 , x2 , ..., xL ) at time t. Step 3: Compare the distance dj between the X(t) and each output node using dj = i=1,L (xi − wij (t))2 where i, j, L, wij and xi are similarly defined as in steps 1 and 2. Step 4: Select an output node j ∗ which has minimum distance (i.e., the winning node). Step 5: Update weights of the winning node j ∗ using wij (t + 1) = wij ∗ (t) + η(t)(xi − wij ∗ (t)) i = 1, 2, ..., L and i ≤ j ∗ ≤ n, where η(t) is a monotonically slowly decreasing function of tand its value is between 0 and 1. We will call the algorithm used in the operation of the SCL neural network as the SCL algorithm. The following discussions are still based on the simple architecture sketched in Figure 1.
Improving Image Segmentation Algorithms with Differential Evolution
385
2.4 The Fuzzy C-Means Clustering Algorithm The Fuzzy C-Means algorithm (FCM) was proposed to separate data clusters with fuzzy means and fuzzy boundaries. Fuzzy C-Means (FCM) is a method which was developed by Dunn in 1973 and improved by Bezdek in 1981 is frequently used in pattern recognition and image segmentation. The FCM algorithm is based on minimization within group sum of squared error objective function: Jm(u,v) =
K N
(uij )m xi − vj 2
(1)
i=1 j=1
where m is the fuzzy index greater than 1, uij is the degree of membership of xi in the jth cluster, xi is the ith of d-dimensional data vector, vj is the prototype of the center of the cluster j, and ∗ is a distance measure between the object xk and the cluster center vj . Fuzzy partitioning can be obtained via an iterative optimization of the objective function Jm(u,v) , with the update of membership uij and the cluster centers vj by: 1 uij = 2 K xi −vj m−1
(2)
xi −vk
j=1
N vj = i=1 N
(uij )m xi
i=1 (uij )
m
(3)
This algorithm will converge when the coefficients change between two iterations is less than ε, where is a termination criterion given between 0 and 1. The fuzzy c-means algorithm is very similar to the k-means algorithm and is composed of the following steps: Step 1: Initialize the cluster centers, the number of cluster centers k, and the fuzzy index m. Steps 2 – 3 are repeated for each iteration. Step 2: Calculate the centers vj using equation (3). Step 3: Update the partition matrix uij using equation (2). Step 4: Repeat until the algorithm has converged then output results.
386
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
2.5 Clustering Validity Index Davies-Bouldin index [1] is a metric measure which has been used in many clustering algorithms. The DB index is proposed for use as the fitness function in the proposed algorithm. The DB is defined as: DB =
n 1 ρi + ρj ) max( n d(ci + cj )
(4)
i=1,i=j
where n is the number of clusters, ρi is the average distance of all patterns in cluster i to their cluster center ci , ρj is the average distance of all patterns in cluster j to their cluster center cj , and d(ci + cj ) is the distance of cluster centers ci and cj . Small values of DB index correspond to clusters that are compact, and centers are separable from each other. In this paper we use DB index as the fitness function to evaluate the fitness of each chromosome.
3 The Proposed Algorithms 3.1 DE-Based K-means (DE-K-means) Clustering Algorithm To improve the performance of the K-means algorithm for image segmentation, the DE-K-means clustering algorithms are proposed. The DE-K-means algorithm is an integration of the K-means algorithm and DE optimization technique. For each parent Uij (g), of generation g, the ith chromosome, the jth dimension, an offspring, Xnext,i,j (g) is created as in the following mutation and crossover operations: Randomly select three chromosomes from the current population, namely,Ui1 j (g), Ui2 j (g) and Ui3 j (g), with i1 = i2 = i3 and i1 , i2 , i3 ∈ U (1, ..., N P ), where N P is the population size. Select a random number jrand ∈ U (i, ..., Di), where Di (Dimension) is the number of genes (parameters) of a single chromosome. Then, for all parameters j = 1, ..., Di,
Ui3 j (g) + F (Ui1 j (g) − Ui2 j (g)) if rand(0, 1) < Cr or if j=jrand Uij (g) otherwise (5) where rand(0, 1) represents a random number between 0 and 1, F is a positive scaling factor with F ∈ (0, ∞) for scaling the difference vectors, and Xnext,i,j (g + 1) and Uij (g) indicate respectively the jth parameter of the offspring and the parent. ‘Cr’ is called crossover rate with Cr ∈ [0, 1] and acts as a control parameter of DE just like F. Thus, each offspring consists of a linear combination of three randomly chosen chromosomes. After completion of the mutation process, the next step Xnext,i,j (g) =
Improving Image Segmentation Algorithms with Differential Evolution
387
is to select the new generation. For each parent of the current population, the parent is replaced by its offspring if the fitness of the offspring is better; otherwise the parent survives to the next generation. Each chromosome has its own scaling factor. The modified scaling factor F is replaced by a function of the scaling factors of randomly selected chromosomes. It is replaced by a function Fi (g) listed below. ⎧ ⎨ Ui3 j + Fi (g)(Ui1 j (g) − Ui2 j (g)) if rand(0, 1) < N (0.5, 0.15) or j = r Xnext,i,j (g) = ⎩ Uij (g) otherwise (6) Where (7) Fi (g) = Fi4 (g) + rand(0, 1)(Fi5 (g) − Fi6 (g)) with i4 = i5 = i6 = i and i4 , i5 , i6 ∈ U (1, ..., N P ). Notations are similarly defined as in the DE-SCL algorithm. The notation rand(0, 1) in equations (6) and (7) represents a random number generator which will generate a value between 0 and 1. Thus each chromosome i has its own scaling factor Fi (g) which is a function of the scaling factor of randomly selected chromosomes. The parameter Fi (g) is first initialized for each chromosomes in the population from a normal distribution denoted by N (0.5, 0.15), generating values which fit well within the range(0, 1]. The DE-K-means algorithm is formulated as follows: Step 1: Initialize the number of cluster K, scaling factor F, crossover factor Cr, population size P, and the number of generation. Run the K-means algorithm P (population) times. The K-means algorithm will generate K centers for each population. This will initialize each chromosome of these P populations with these cluster centers. Each chromosome contains K centers. Step 2: Repeat the following steps for each generation until the last generation. (a) Calculate fitness value for each chromosome. Store these values for the selection. (b) Apply the mutation and crossover steps to process each chromosome as stated in equation (5). (c) For each chromosome, calculate its new fitness value for the selection. (d) Run the selection step of DE to select offspring according to the smaller fitness values from (a) and (c). Step 3: Select the best chromosome of the last generation as the new centers for the solution.
388
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
3.2 DE-Based SCL (DE-SCL) Clustering Algorithm The DE-SCL algorithm is similar to DE-K-means algorithm and it is formulated as follows: Step 1: Initialize the number of cluster K, scaling factor F, crossover factor Cr, population size P, and the number of generation. Run the SCL algorithm P (population) times. The SCL algorithm will generate K centers for each population. This will initialize each chromosome of these P populations with these cluster centers. Each chromosome contains K centers. Step 2: Repeat the following steps for each generation until the last generation. (a) Calculate fitness value for each chromosome. Store these values for the selection. (b) Apply the mutation and crossover steps to process each chromosome as stated in equation (5). (c) For each chromosome, calculate its new fitness value for the selection. (d) Run the selection step of DE to select offspring according to the smaller fitness values from (a) and (c). Step 3: Select the best chromosome of the last generation as the new centers for the solution.
3.3 DE-Based Fuzzy C-means (DE-FCM) Clustering Algorithm The fuzzy c-means algorithm is sensitive to the initial condition; the final clustering result is affected by initial cluster centers easily. If initial cluster centers are bad, the search result easily falls into a local optimum. And if the number of dimensions of the data set is increased, the probability of falling into local optimums increases. Step 1: Initialize the number of cluster K, the fuzzy index m, scaling factor F, crossover factor Cr, population size P, and the number of generation. Run the Fuzzy C-means algorithm P (population) times for each vector. The Fuzzy C-means algorithm will generate K centers for each population. This will initialize each chromosome of these P populations with these cluster centers. Each chromosome contains K centers. Step 2: Repeat the following steps for each generation until the last generation. (a) Calculate fitness value for each chromosome. Store these values for the selection. (b) Apply the mutation and crossover steps to process each chromosome as stated in equation (5). (c) For each chromosome, calculate its new fitness value for the selection.
Improving Image Segmentation Algorithms with Differential Evolution
389
(d) Run the selection step of DE to select offspring according to the smaller fitness values from (a) and (c). Step 3: Select the best chromosome of the last generation as the new centers for the solution.
4 Experimental Results In this section we compare the effectiveness of DE-K-means, DE-SCL, and DE-FCM algorithms with other well-known algorithms for image segmentation. The proposed algorithms and other algorithms were tested on a set of images. Some of them are shown in Figures 2, 3, 4, and 5. We have chosen a combination of simple, median and complex images in terms of image texture complexity for testing. The simple Window image is used to verify whether the proposed algorithms can generate correct segmentation results. The complexity of an Island image is between the window image and the satellite images. The first satellite image is one of the sophisticated landscape images. It is used to test performance of proposed algorithms on complicated images. The ground truth image is the real field survey of the first satellite image. It is a classified satellite image data by people. The second satellite image is another sophisticated landscape image to test the performance of proposed algorithms. We calculate the Error Matrix and KHAT result to evaluate the correct rate of the proposed algorithms. We also evaluate each of algorithms with the Iris data set which is well-known clustering problem. In our experiments, different values for DE parameters F, Cr, dimension, population size, generation were tested. The effective value of F in DE is valued by equation (6). The effective Cr typically lies in [0.5, 1.0]. We carried out experiments with different parameter settings of the clustering algorithms. We observed that the algorithm converges within an acceptable computational time. The parameters of DE-K-means in the experiments are set as follows: population = 40, Generation=20. One set of parameters used in DE-SCL are listed: population = 30; generation = 20; times = 300; t1 = 0.001, t2 = 0.002/times. The parameters of DE-FCM in the experiments are set as follows: m=2, population = 40, temp = 0.001, Generation=30. Their results are shown from Figure 2 to Figure 5. Dimension is the same as the number of cluster centers. Within an acceptable time, we set the number of generation to 20. Because when the generation is increased, the fitness value and the result of the classified image do not change too much. Figure 2 shows the results of the algorithms tested. It shows that all algorithms generate correct results. Figure 3 shows the results of Island image. Figure 4 shows the performance of the algorithms on a complex satellite image. The ground truth image is also added to do comparison. In Figure 4, another complex satellite image is used to test the performance of proposed algorithms. From Table 1 to Table 6 we report the results of comparison among the Error Matrix and KHAT results of DE-K-means, DE-SCL, DE-FCM, K-
390
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
means, SCL, and FCM. In Table 7, some KHAT results are listed to show the performance of each of algorithms in further experiment. In Table 8, the Iris data is tested to evaluate the performance of these algorithms on real data. From the correct rates, we know that the DE can optimize the Kmeans, SCL, and FCM algorithms. It also can make these three algorithms more stable. The performance of the SCL and FCM show more stable than K-means algorithm. To the SCL and FCM, FCM is more stable. However, Kmeans can occasionally produce the best result among the algorithms tested. For DE-K-means, DE-SCL and DE-FCM, all of them are quite stable in their performance. The optimization effect of DE on the K-means algorithm is more than on the SCL or the FCM algorithm. The optimization effect of DE on the FCM is better than the SCL algorithm. Both population-based search approaches reduce the effect of the initial conditions, compared to K-means or SCL, especially for relatively large population size. The K-means algorithm, the SCL algorithm and the FCM are sensitive dependent on the initial conditions to achieve their performance. However, the FCM algorithm is less dependent on the initial conditions than the K-means and the SCL algorithm.
(a) Original
(d) FCM
(b) K-means
(e) DE-K-means
(c) SCL
(f) DE-SCL
(g) DE-FCM Fig. 2. (a) An original image, (b), (c), (d), (e), (f), (g) classified results using the K-means algorithm, SCL, FCM, DE-K-means, DE-SCL and DE-FCM, respectively. The number of clusters was set to 3.
5 Conclusion This paper proposed integrated clustering algorithms for image segmentation. The K-means algorithm, simple competitive clustering (SCL) algorithm, and
Improving Image Segmentation Algorithms with Differential Evolution
(a) Original
(d) FCM
(b) K-means
391
(c) SCL
(e) DE-K-means
(f) DE-SCL
(g) DE-FCM Fig. 3. (a) An original image, (b), (c), (d), (e), (f), (g) classified results using the K-means algorithm, SCL, FCM, DE-K-means, DE-SCL and DE-FCM, respectively. The number of clusters was set to 4. Table 1. Error Matrix and KHAT resulting from Classifying Satellite Image Data by K-means algorithm.(Error Matrix Accuracy: M = 56.387%, R = 98.661%, V = 2.9568%, Overall = 67.090%. KHAT Accuracy = 66.981%.)
Classified Data Satellite Image classified by K-means
River Village Mountain Column Total
River
Village
69698 35 911 70644
2334 100 948 3382
Mountain Row Total 4844 76876 77199 77334 106075 107934 188118 262144
Table 2. Error Matrix and KHAT resulting from Classifying Satellite Image Data by SCL algorithm.(Error Matrix Accuracy: M = 58.475%, R = 98.606%, V = 2.6611%, Overall = 68.569%. KHAT Accuracy = 67.715%.)
Classified Data
Satellite Image classified by SCL
River Village Mountain Column Total
River
Village
69659 31 954 70644
2298 90 994 3382
Mountain Row Total 2263 74220 75852 75973 110003 111951 188118 262144
392
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
(
(
(a) Original
b) Ground Truth
c) K-means
(d) SCL
(e) FCM
(f) DE-K-means
(g) DE-SCL
(h) DE-FCM
Fig. 4. (a) An original satellite image, (b)a ground truth image, (c), (d), (e) and (f) (g) (h) classified results using the K-means algorithm, SCL, FCM, DE-K-means, DE-SCL, and DE-FCM, respectively. The number of clusters was set to 3. Table 3. Error Matrix and KHAT Resulting from Classifying Satellite Image Data by FCM Algorithm.(Error Matrix Accuracy: M = 59.337%, R = 98.773%, V = 2.7794%, Overall = 69.235%. KHAT Accuracy = 68.642%.)
Classified Data
Satellite Image classified by FCM
River Village Mountain Column Total
River
Village
69777 29 838 70644
2430 94 858 3382
Mountain Row Total 5831 78038 70663 70786 111624 113320 188118 262144
Improving Image Segmentation Algorithms with Differential Evolution
(a) Original
(d) FCM
(b) K-means
393
(c) SCL
(e) DE-K-means
(f) DE-SCL
(g) DE-FCM Fig. 5. (a) An original image, (b), (c), (d), (e), (f), (g) classified results using the K-means algorithm, SCL, FCM, DE-K-means, DE-SCL and DE-FCM, respectively. The number of clusters was set to 5. Table 4. Error Matrix and KHAT resulting from Classifying Satellite Image Data by DE-K-means algorithm.(Error Matrix Accuracy: M = 98.111%, R = 98.165%, V = 6.5346%, Overall = 96.943%. KHAT Accuracy = 96.861%.)
Classified Data Satellite Image classified by DE-K-means
River Village Mountain Column Total
River
Village
69348 37 1259 70644
1880 221 1281 3382
Mountain Row Total 3536 74764 20 278 184562 187102 188118 262144
394
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang
Table 5. Error Matrix and KHAT resulting from Classifying Satellite Image Data by DE-SCL algorithm.(Error Matrix Accuracy: M = 84.511%, R = 97.972%, V = 5.5884%, Overall = 87.120%. KHAT Accuracy = 86.289%.)
Classified Data Satellite Image classified by DE-SCL
River Village Mountain Column Total
River
Village
69211 41 1392 70644
2180 189 1013 3382
Mountain Row Total 3391 74782 25746 25976 158981 161386 188118 262144
Table 6. Error Matrix and KHAT resulting from Classifying Satellite Image Data by DE-FCM algorithm.(Error Matrix Accuracy: M = 98.051%, R = 94.048%, V = 5.8545%, Overall = 95.782%. KHAT Accuracy = 95.411%.)
Classified Data Satellite Image classified by DE-FCM
River Village Mountain Column Total
River
Village
66439 2946 1259 70644
1891 198 1293 3382
Mountain Row Total 3647 71977 21 3165 184450 187002 188118 262144
Table 7. KHAT resulting from Classifying Satellite Image Data by K-means, SCL, FCM, DE-K-means, DE-SCL and DE-FCM algorithm. One hundred independent runs were performed for each of algorithms.
Image
Algorithm
Maximum Minimum Average
Satellite
K-means FCM SCL DE-K-means DE-SCL DE-FCM
69.915% 67.415% 64.351% 97.248% 91.337% 97.114%
59.061% 66.441% 61.239% 61.785% 65.014% 61.339%
65.146% 67.162% 62.717% 79.268% 68.827% 77.221%
Result Times 0 0 0 15 3 12
≥
90%
fuzzy c means (FCM) algorithm were combined with the differential evolution (DE). The DE algorithm can enhance the performance of the K-means, the SCL algorithm, and the FCM algorithm. This optimization technique along with the K-means, the SCL, and the FCM algorithm makes image segmentation tasks more stable. The performance of combination of DE with the K-means algorithm and the combination of DE with the FCM are better than the performance of the combination of DE with the SCL algorithm based on the results of image segmentation. By comparing the performance of classical DE and modified DE, the modified DE is better than the classical DE in min-
Improving Image Segmentation Algorithms with Differential Evolution
395
Table 8. A Comparison of 1000 Experiments for the Iris Data.(In each experiment, each data set is divided into two parts: 50% as training sets and 50% as test sets. The number of clusters was set to 3.)
Clustering Algorithm K-means DE-K-means SCL DE-SCL FCM DE-FCM
Overall Accuracy (%) test Highest Average Variance[0.8, 1] [0.6,0.8] 96.000 62.325 17.929 141 244 97.333 74.812 7.564 189 673 84.000 65.734 10.613 103 758 86.667 70.921 7.476 138 656 89.333 89.265 1.538 997 3 92.000 89.835 0.479 999 1
[0.0,0.6] 575 138 139 106 0 0
imizing the intra-distance of the clusters and maximizing the inter-distance of the clusters. As many versions of DE have been proposed, we will continue to test on some of them for the image segmentation. It is necessary to conduct a systematic experiments and analysis to discover some clues about the parameters setting in different applications. Time complexity will be analyzed.
References [1] [2] [3] [4] [5]
[6] [7]
[8]
[9] [10]
Davies, D. L. and D.W. Bouldin, A Cluster Separation Measure, IEEE Trans. Pattern Anal. Machine Intell., 1(4), 224-227, 2000. Hung, C. C, Competitive Learning Networks for Unsupervised Training, Int. J. Remote Sensing, Vol. 14, No. 12, 2411-2415, 1993. Holland, J. H., Adaptation in Natural and Artificial Systems, University of Michigan Press, Ann Harbor, 1975. Kennedy, J. and R. Eberhart, Particle swarm optimization, Proc. IEEE Int. conf. Neural Networks, pp.1942-1948, 1995. Lampinen, J. and I. Zelinka, On stagnation of the differential evolution algorithm, in: Pavel Omera, (ed.) Proc. of MENDEL 2000, 6th International Mendel Conference on Soft Computing, pp. 76-83, June 7-9. 2000, Brno, Czech Republic. Mezura-Montes, E., Nature-Inspired Algorithms, A tutorial in MICAI 2008. Omran M. , A. Engelbrecht and A. Salman, Differential evoution methods for unsupervised image classification, In Proceedings of the IEEE congress on Evolutionary Computation (CEC2005) 2, 966-973, September (2005). Storn, R. and K. V. Price, Differential evolution A simple and efficient adaptive scheme for global optimization over continuous spaces, Technical Report TR-95-012, ICSI,1995. Storn, R., K. V. Price, and J. Lampinen, Differential Evolution A Practical Approach to Global Optimization, Springer, Berlin, 2005. Tou, J. and R. Gonzalez, Pattern Recognition Principles, Addison-Wesley, 1974.
396 [11]
Chih-Cheng Hung, Ziwei Ren, Wenfan Li, and Qing Yang Vesterstrm, J. and R. Thomson, A comparative study of differential evolution, particle swarm optimization, and evolutionary algorithms on numerical benchmark problems, in Proc. Sixth Congress on Evolutionary Computation (CEC-2004), IEEE Press, 2004.
TOF Camera based 3D Fingertip Location Estimation Yangkeun Ahn1 , Minwook Kim2 , Kwangmo Jung3 , Taehyoung Kim4 , Jaehoon Ahn5 , and Sukil Hong6 1 2 3 4 5 6
Korea Electronics Technology Institute, South Korea
[email protected] Korea Electronics Technology Institute, South Korea
[email protected] Korea Electronics Technology Institute, South Korea
[email protected] Soongsil University, South Korea
[email protected] Soongsil University, South Korea
[email protected] Soongsil University, South Korea
[email protected]
1 Introduction Human computer interaction (HCI) plays a important role in many applications today. It exists the desire to realize more natural forms of interaction between humans and machines. One of these forms is the interaction via gestures, e.g. by recognizing natural hand- or full-body movements. Many researchers have focused on measuring the articulation of the whole body neglecting the hand posture since full-body posture is in itself already a complex task, even when problems due to clothing, self-occlusion and non-rigid tissue can be avoided. On the other hand, the human hand has more that 24 degreesof-freedom in finger/ thumb articulation and forms a very difficult problem on its own. Solutions to both problems have been developed but they violate an important aspect in HCI, which is called ”come as you are”. This paradigm is one of the most influential goals in HCI but also the most difficult one to achieve: The intentions of the human user must be recognized effortlessly and non-invasive, e.g. without attaching any special hardware to the human body. Data gloves, suits, inertial tracking devices and optical markers attached to the hand, face or body of the human user must be avoided. In recent years, TOF technology, a 3D camera technology that is included in Project Natal, a Microsoft Corporation game project using gestures, has been used in many areas. However, although the TOF camera can detect in its camera images the distance between itself and a large object with relatively good accuracy, it yields numerous errors in detecting the distance between itself and a small object.
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0 21, © Springer Basel AG 2011
398
Yangkeun Ahn et al.
Because it is thus difficult to detect small objects using depth information, which is an output of the TOF camera, the present study proposes a method whereby the hand, which is a large object, is detected in fingertip detection. A hand model based on this detection is generated and matched, and fingertips are then estimated. The structure of the present study is as follows. Section 2 presents the depth sensing 3D camera. Section 3 describes touch hand modeling, which uses both depth information and silhouette information. Section 4 explains the results of touch hand modeling. Section 5 presents the conclusion and a direction for future research.
2 Depth-sensing cameras We refer to camera systems which recover depth information throughout the captured scene (i.e., depth per pixel) as depth-sensing. While we acknowledge the utility of other camera-based means of 3D capture for interactive surfaces, such as recognizing an object from two views, a fully detailed range image permits a great deal of flexibility. Laser scanners have been used in robotics and other fields to calculate accurate depth images. Despite being available for many years, such technology is still expensive, and often is barely fast enough for interactive applications (Illuminating Clay reports 3Hz scan rate) [12]. The CCD camera in mono or stereo format dominated until recently being perceived as the vision sensor technology of choice. Stereo CCD cameras had a technological advantage edge over depth sensors and have been used as the preferred vision sensor. A well known problem with CCD stereo vision is the high sensitivity of the depth data to errors in locating corresponding features in each image. Small errors in the contrast areas limit in the two image results in significant depth measurement error. Correlation-based stereo is another old approach which suffers from a number of difficulties. For example, stereo matching typically fails on regions of the scene with little or no texture. Secondly, even today stereo matching requires a great deal of computational power to obtain interactive rates at reasonable resolution. Finally, stereo camera setups typically require fine calibration. The newly developed CMOS 3D sensors provide depth data in addition to reflected light intensity. They have become an important contender as the most frequently used sensor type.
TOF Camera based 3D Fingertip Location Estimation
399
Recent advances in CMOS Time of Flight (TOF ) 3D infrared sensor increased interest in their use in real time visual perception applications. Fabricated using the standard CMOS process integrated circuits 3D sensors are now available commercially at a very low cost. The 3D TOF sensors have numerous advantages over other depth sensors. Triangulation-based methods such as stereo cameras require intensive post processing to construct depth images. This is not necessary in the case of the TOF sensor, and the post processing usually involves a simple table lookup to map the individual pixel sensor reading to real range data. The operation of the sensor is based on an amplitude-modulated infrared light source and an array of CMOS transistors that determine the field depth from the back scattered light. The ambient light is not affecting the sensor operation since it is not modulated. Several other methods are used to eliminate the effect of ambient noise. The camera module contains a light source constructed from a bank of infrared LEDs at 870nm wavelengths, a lens system for the detector chip incorporating 320 240 phase-sensitive pixels. The whole chip is fabricated on standard CMOS process and the chip also includes an embedded processing unit for pixel depth value calculation. The time-of-flight (TOF) sensor measures distances by determining the time delay between emission and detection of light pulses. The pulses are emitted by the light source switched on and off with a 50 percent duty cycle at a frequency on the order of 50 MHz. A simple calculus shows that the distance travelled by light in an impulse period is about 3 meters. At a digital signal resolution of 8 bits the depth resolution is on the order of one centimeter. The frequency of the light source defines the maximal depth of the field of view. There are methods using multiple beams of different frequencies to extend the sensor range up to 100 m. The light beam bounces off surfaces in the scene and returns to the 3D sensor. The phase of the reflected beam and geometrical position of light source to each pixel are used to determine the depth information in the 3D scene viewed. The core of the sensor design is a pixel matrix consisting of special CMOS transistors with two gates. The differential structure accumulates photon generated charges in the two collecting gates. The gate modulation signals are synchronized in quadrature with the light source, and hence depending on the phase of incoming reflected light, one node collects more charges than the other. An integration in time over many cycles is performed to increase sensitivity. At the end of the integration cycle the voltage difference between the two nodes is read out as a measure of the phase of the reflected
400
Yangkeun Ahn et al.
light. New camera technologies under development observe depth information in a more direct fashion, and so address many of the drawbacks of previous approaches [11][13]. In the present work we use the Zcam camera by 3DV Systems, Ltd [2]. The Zcam times the return of pulsed infrared light: reflected light from nearer objects will arrive sooner. A Gallium-Arsenide (GaAs) solid-state shutter makes this possible (see Figure 1). The result is an 8 bit depth image, over a variable dynamic range (70cm to 3m). Figure 1d illustrates an example Zcam depth image. The Zcam camera also includes a separate color camera. The output of the color camera is registered with the depth image to obtain a complete ”RGBZ” image at 30Hz.
(a)
(b)
(c)
(d)
Fig. 1. 3DV Zcam uses pulsed infrared light (a) and solid state shutter to compute depth image. Reflected light from closer surfaces arrives sooner (b). Example real view (c) and depth image (d).
TOF Camera based 3D Fingertip Location Estimation
401
Fig. 2. how a TOF camera works.
2.1 The time-of-flight principle A time of flight (TOF) camera calculates the distance from an object by sending out laser or infrared LED and determining-with its built-in sensor-the time spent for laser/infrared LED particles to hit the object and come back [6]. If the laser or infrared LED that the camera emits forms a sine curve, the equation of the sine curve, s(t), can be written as Equation (1) when modulated frequency is fm .
s(t) = sin(2πfm t)
(1)
Then, r(t), which represents the light reflected by the camera and the object and transmitted into the built-in sensor, can be expressed as Equation (2).
r(t) = R sin(2πfm t − φ) = R sin(2πfm (t −
2d )) c
(2)
Here R is the magnitude of the reflected light and is the value of the light phase-changed from the object; c is the speed of light, that is, ; and d is the distance between the object and the camera, which can be obtained from the phase-changed value, and this can be written as Equation (3).
d=
cφ 4πfm
(3)
402
Yangkeun Ahn et al.
Using the value of distance obtained above, the TOF camera determines the disparity value (i.e. distance). Figure 3 illustrates a disparity map generated after identifying the distance.
2.2 TOF camera Time-of-flight principle 3D cameras are becoming more and more available and their acquisition costs are continually decreasing. The experiments described herein were conducted using a depth-sensing camera called Zcam built by the 3DVsystems. Time-of-flight principle cameras work similar to radars. The camera consists of an amplitude-modulated infrared light source and a sensor field that measures the intensity of backscattered infrared light. The infrared source is constantly emitting light that varies sinusoidal between a maximum and a minimum. Objects of different distances to the camera reflect the light in different intensities. The reason is that, at the same moment, objects that have different camera distances are reached by different parts of the sinus wave. The incoming reflected light is then compared to the sinusoidal reference signal which triggers the outgoing infrared light. The phase shift of the outgoing versus the incoming sinus wave is then proportional to the time of flight of the light reflected by a distant object. This means, by measuring the intensity of the incoming light, the phase-shift can be calculated and the cameras are able to determine the distance of a remote object that reflects infrared light. The output of the cameras consists of depth images and a conventional low-resolution gray scale video, as a byproduct. A detailed description of the time-of-flight principle can be found in [8, 9, 10]. The depth resolution depends on the modulation frequency. For our experiments we used a frequency of 20MHz which gives a depth range between 0.5m and 7.5 m, with a theoretical accuracy of about 1 cm. Usually, timeof-flight cameras allow to configure frame rate, integration time, and a userdefined region of interest (ROI) by writing to internal registers of the camera. The cameras then calculate the distances in an internal processor. The resolution of the Zcam camera is 320 240 non-square pixels. Unfortunately, 3D time-of-flight cameras are not yet available in higher resolutions such as NTSC or PAL.
TOF Camera based 3D Fingertip Location Estimation
403
(a)
(b) Fig. 3. (a) input image; (b) disparity image
3 A simple hand pose model In the present study, a hand model with the index finger extended was created. Here, in terms of the degrees of freedom (DOF) of general hand modeling, the hand pose model was modeled solely based on 5 DOF of the shoulders instead of considering the DOF of each knuckle. Each DOF represents the values on the x, y, and z axes that indicate the central locations of the hands and the angles of rotation, with the x and y axes as the standards.
404
Yangkeun Ahn et al.
Fig. 4. The simple hand pose model
4 Estimation of 3D fingertip locations In the present section, to estimate 3D fingertip locations, histograms were derived from input depth images to estimate the 3D depth information on the fingertips.
4.1 Extraction of the hand areas according to depth image histograms After obtaining histograms from the input depth images, the depth image histograms were subjected to preliminary differentiation. It then becomes possible to obtain the maximal and minimal values according to the differential values of the histograms and, as in Figure 5, to separate the hand areas, arm areas, or other noise areas from the entire image.
4.2 Detection of the 3D coordinates of the hand areas From the detected hand areas, the central values of the hand, which are used as the center points of the hand model, were detected. The x and y values represent pixel shift information, and the z value represents the average value of the depth information on the hand areas, all of which were separately detected. These can be expressed as in Equation (4). Here, N designates the number of pixels in the hand areas:
centerpoint(x, y, z) =
1 N
(x,y)∈hand
f (x, y, depth)
(4)
TOF Camera based 3D Fingertip Location Estimation
Fig. 5. Detection of the hand using histograms of the depth images
Fig. 6. Estimation of the X and Y coordinates in the hand areas
405
406
Yangkeun Ahn et al.
5 Matching according to the geometric transformation of the hand model The hand model was rotated along the x and y axes, with the shoulders as the standards. This can be expressed as Equation (5) and can be transformed into a numerical equation, as in Equation (6): H = Rx (θxω )Ry (θyω )H
(5)
⎞ ⎛ ⎞⎛ ⎞ 0 sin θ1 x cos θ1 x ⎝ y ⎠ = ⎝ sin θ1 sin θ2 cos θ2 − cos θ1 sin θ2 ⎠ ⎝ y ⎠ z − sin θ1 cos θ2 sin θ2 cos θ1 cos θ2 z
(6)
⎛
When the shoulders are the starting points and the locations of the hands when extended horizontally are the standards, because the x and y values are 0, the third matrix in Equation (6) expresses the movement of the hands from the standard positions. When the lengths of the hands are expressed as L, this movement can be expressed as in Equation (7): ⎞ ⎞ ⎛ sin θ1 x ⎝ y ⎠ = L ⎝ − cos θ1 sin θ2 ⎠ z cos θ1 cos θ2 ⎛
(7)
Here, designating the depth values of the hand areas obtained in Section 3.2 as D and the length from the camera to the shoulders as A, the distance between the shoulders and the hands is A - D. Because the x-y ratio in the 3D model is identical to the x-y ratio in the images, the matrix values are calculated as in Equation (8). $ cos θ1 =
(A − D)2 x2 + y 2 + y 2 − (A − D)2
x2
cos θ2 =
A−D cos θ1
(8)
Once the rotation equation of the hand model has been obtained, it is possible to find the locations of the rotated fingertips by assigning the locations of the fingertips to the input values in Equation (6).
TOF Camera based 3D Fingertip Location Estimation
407
6 Results of experiment As shown in Figure 7, the present researchers obtained the 3D coordinates of the fingertips obtained through the proposed algorithm by directly expressing the algorithm proposed through the use of Open GL.
Fig. 7. Diagrammatization of the hand model using OpenGL
References [1] Gokturk. S. B, Yalcin. H, and Bamji. C., ”A Time-Of-Flight Depth Sensor System Description, Issues and Solutions”, CVPRW ’04, p35, 2004. [2] G. J. Iddan and G. Yahav, ”3D Imaging in the Studio,” SPIE, vol. 4298, pp. 48, 2001. [3] B. Piper, C. Ratti, and H. Ishii, ”Illuminating Clay: A 3-D Tangible Interface for Landscape Analysis,” presented at CHI 2002 Conference on Human Factors in Computing Systems, 2002. [4] T. Starner, B. Leibe, D. Minnen, T. Westeyn, A. Hurst, and J. Weeks, ”The perceptive workbench: Computer-vision-based gesture tracking, object tracking, and 3D reconstruction for augmented desks,” Machine Vision and Applications, vol. 14, pp. 51-71, 2003. [5] A. Wilson, ”TouchLight: An Imaging Touch Screen and Display for GestureBased Interaction,” presented at International Conference on Multimodal Interfaces, 2004. [6] A. Wilson, ”PlayAnywhere: A Compact Tabletop Computer Vision System,” presented at Symposium on User Interface Software and Technology (UIST), 2005. [7] A. Wilson, ”Robust computer vision-based detection of pinching for one and two-handed gesture input,” presented at UIST, 2006. [8] S. B. Gurk, hakan Yalcin, and C. Bamji. A Time-Of-Flight Depth Sensor System Description, Issues and Solutions. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition, Washington D.C., USA, July 2004.
408
Yangkeun Ahn et al.
[9] X. Luan, R. Schwarte, Z. Zhang, Z. Xu, H.-G. Heinol, B. Buxbaum, T. Ringbeck, and H. Hess. Three-dimensional intelligent sensing based on the PMD technology. Sensors, Systems, and Next-Generation Satellites V. Proceedings of the SPIE., 4540:482–487, December 2001. [10] T. Oggier, M. Lehmann, R. Kaufmann, M. Schweizer, M. Richter, P. Metzler, G. Lang, F. Lustenberger, and N. Blanc. An all-solid-state optical range camera for 3D real-time imaging with sub-centimeter depth resolution (SwissRanger). Optical Design and Engineering. Proceedings of the SPIE., 5249:534-545, Februar 2004. [11] I. Jivet and A. Brindusescu, Real Time Representation of 3D Sensor Depth Images, WSEAS Transactions on Electronics, Issue 3, Vol 5, March 2008 pp:6571 [12] M Otesteanu, V Gui, 3D Image Sensors, an Overview, WSEAS Transactions on Electronics, Issue 3, Vol 5, March 2008 pp:53-56 [13] K Boehnke Fast Object Localization with Real Time 3D Laser Range Sensor Simulation, WSEAS Transactions on Electronics, Issue 3, Vol 5, March 2008 pp:83-92 [14] J.Y Lin, Ying Wu and T.S Huang, 2004, 3D model-based hand tracking using stochastic direct search method, Proceedings. Sixth IEEE International Conference on Automatic Face and Gesture Recognition. pp.99-104 [15] V. Athitsosand and S. Sclaroff, 2003, ’Estimation 3D hand pose form a cluttered image, CVPR’ 03. Vol.2, pp.432-439
Index
aborted, 128 active, 126 arrives, 125
inherited priorities, 129
base priority, 129 blocking, 131 ceiling-blocked, 131, 135 inheritance-blocked, 131, 135, 137 object-blocked, 131, 135 resource-blocked, 131, 137
read, 126 read/write resource, 130 resource-blocked, 131 retain, 127
ceiling, 130 read-ceiling, 130 write-ceiling, 130 writer-lock, 130 writer-task, 130 committed, 127 completed, 127 conflict, 126 conflict-access, 126 exclusive, 126 failure atomicity, 128 free, 127
period, 129
serializable, 138 sphere, 127 substitute, 129 substitute transaction, 128 subtransactons, 126 transaction instance, 125 transaction routine, 125 tree-based terminology, 126 ancestors, 126 children, 126 forest, 126 parent, 126 root transaction, 126 transaction tree, 126 write, 126
S.Y. Shin et al. (eds.), Reliable and Autonomous Computational Science, Autonomic Systems, DOI 10.1007/978-3-0348-0031-0, © Springer Basel AG 2011