Investigating the efficiency of multi-threading application programming interfaces for parallel packet classification in wireless sensor networks

2020 Turkish Journal of Electrical Engineering and Computer Sciences  
This paper investigates the most appropriate Application Programming Interface (API) that best accelerates 4 the flow-based applications on the Wireless Sensor Networks (WSNs). Each WSN include many sensor nodes which 5 have limited resources. These sensor nodes are connected together using base stations. The base stations are commonly 6 network systems with conventional processors which are responsible for handling large amount of communicated data in 7 flows of network packets. For this
more » ... e, classification of the communicated packets is considered as the primary process 8 in such systems. With the advent of high-performance multi-core processors, developers in the network industry have 9 considered these processors as a striking choice for implementing a wide range of flow-based wireless sensor networking 10 applications. The main challenge in this field is choosing and exploiting an API which best allows multi-threading; i.e. 11 one which maximally hides the latency of performing complex operations by threads and increases the overall efficiency 12 of the cores. This paper assesses the efficiency of Thread, Open Multi-Processing (OpenMP) and Threading Building 13 Blocks (TBB) libraries in multi-thread implementation of Set-Pruning and Grid-of-Tries (GOT) packet classification 14 algorithms on dual-core and quad-core processors. In all cases, the speed and throughput of all parallel versions of the 15 classification algorithms are much more than the corresponding serial versions. Moreover, for parallel classification of 16 a sufficiently large number of packets by both classification algorithms, TBB library results in higher throughput and 17 performance than the other libraries due to its automatic scheduling and internal task stealing mechanism. 18 Wireless Sensor Networks (WSNs) are ad-hoc networks comprising mainly of small sensor nodes with limited 22 resources and one or more base stations, which are computationally more powerful nodes that connect the 23 sensor nodes to other parts of the network [1-6]. The rapid development of the WSN based on the Internet of 24 Things has brought considerable contest and complex problems in processing data in high-speed networks [7-9]. 25 The continually growing number of sensor nodes in WSN has increased the transmitted traffic and the variety 26 * Correspondence: abbasi@basu.ac.ir This work is licensed under a Creative Commons Attribution 4.0 International License. of monitored parameters. This extensible complexity in the information of the WSN should be handled at the 1 base stations [7, 10-13]. 2 To accelerate the complex functions in analyzing high-dimensional and self-correlated data over WSN, 3 packet classification, a primary process inherited form software-defined networking (SDN), is inevitable [7, 4 10, 11, 14-17]. This process accelerates the overall process of base stations by provisioning fast flow-based 5 network functions instead of slow packet-based ones [18, 19]. Packet classification is nothing but discriminating 6 packets according to a set of predefined rules [20, 21]. Accelerating this fundamental process directly affects 7 the overall performance of the WSN systems so that the packet loss, delay and buffer requirement are reduced 8 [4, 11, 14, 18, 22, 23]. 9 Work done on the parallelization of packet classification algorithms in wireless sensor networks is few and 10 far between. The work of Rjakamal et.al can be considered as the preliminary work in using parallel packet 11 classification in WSNs [24]. They introduce the design of a parallel co-processor which could assist the network 12 processor of a base station in a WSN to classify network packets very fast. Xianyang et.al, introduce using 13 classifications techniques for provisioning the quality of service in WSN[25]. Some researchers like Letswamotse 14 et. al, introduce the idea of Software-Defined Wireless Sensor Networks (SDWSN) as a network computing 15 paradigm for applying software-defined networking (SDN) strategies to WSNs[26]. This network paradigm is 16 enriched with the idea of the parallel classification of network packets. 17 The review of the literature shows a few studies have considered parallel packet classification techniques 18 in WSNs. Also, none of them have considered the limited computational resources of the base stations of WSN 19 for parallel packet classification. This key challenge has been the main motivation of the proposed study which 20 investigates the best multi-threading programming interface which lets optimum using of multi-core processors 21 on the base stations of the WSNs to accelerate the flow-based applications. 22 Recently due to increasing volume of incoming packets, multi-core processors are used in the architecture 23 of base stations to speed up packet classification [10, 27, 28]. Interestingly, while the concept of parallel 24 programming is almost as old as the computer itself, the design and implementation of parallel algorithms is 25 still a challenge for many developers. Various APIs such as OpenMP and TBB (Threading Building Blocks) 26 have so far been produced for code parallelization in different programming languages [29][30][31]. However, an 27 important task ahead of the developers of parallel programming on multi-core systems is to select the most 28 appropriate API to get a high-performance parallel application. 29 In this regard, this paper examines the most common APIs (C++ 11, OpenMP, TBB) that support code 30 parallelization in different programming languages with the aim of parallelizing packet classification algorithms. 31 The std::thread class from the standard library of C++ 11 easily enables the programmer to create threads 32 from the thread library in the program code. In the simplest case, the task to be accomplished by the thread 33 is a recursive or void function with or without parameters. In this case, the function is executed by the thread 34 until the recursion, and then the thread stops . OpenMP API is another flexible API that allows for multi-35 threaded parallelization with shared memory architecture. OpenMP includes a set of compiler instructions, 36 variables, and library functions for parallelization of programs as used in computational applications in the 37 fields of science and engineering [32]. A great advantage of OpenMP is its simple programming method using 38 compiler instructions. However, the programmer should have a good command of these instructions to decide 39 how and when to use them [33]. TBB is a C++ library for parallelization that extends C++ through abstraction 40 of thread management and simple parallel programming. To use this library, the programmer specifies tasks 41 rather than threads and allows the library itself to efficiently assign tasks to threads. One of the advantages 42
doi:10.3906/elk-1910-168 fatcat:nb6ewtgxnvg4fhi4z64o3thymi