123
Cairo University Faculty of Computers and Information Information Technology Department Improving QoS of Data Transmission over Wireless Sensor Networks A Thesis Submitted to the Faculty of Computers and Information Cairo University In Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy In Information Technology BY Mohamed Hamed Nasr El Din Taha Under the Supervision of Prof. Iman Aly Saroit Vice Dean of Education and Students Affairs Faculty of Computers and Information Cairo University Prof. Hesham N. Elmahdy Information Technology Department Faculty of Computers and Information Cairo University June 2013

Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

Cairo UniversityFaculty of Computers and InformationInformation Technology Department

Improving QoS of Data Transmission over

Wireless Sensor Networks

A Thesis Submitted to the

Faculty of Computers and Information

Cairo University

In Partial Fulfillment of the

Requirements for the Degree of

Doctor of Philosophy

In

Information Technology

BY

Mohamed Hamed Nasr El Din Taha

Under the Supervision of

Prof. Iman Aly SaroitVice Dean of Education and Students

AffairsFaculty of Computers and Information

Cairo University

Prof. Hesham N. ElmahdyInformation Technology Department

Faculty of Computers and InformationCairo University

June2013

Page 2: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

بسم هللا الرحمن الرحیم

صدق هللا العظیمطهسورةمن114االية

Page 3: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

ii

DeclarationI certify that this work has not been accepted in substance for any academic

degree and is not being concurrently submitted in candidature for any other

degree. Any portions of this thesis for which I am indebted to other sources

are mentioned and explicit references are given.

Student Name: Mohamed Hamed Nasr El Din Taha

Signature:

Page 4: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

iii

Acknowledgements

First of all, I thank God for giving the support and providing me with the

patience and guidance which I used in making this work.

I am so grateful to my supervisors Prof. Dr. Imane Aly Saroit and Prof. Dr.

Hesham Elmahdy for providing their valuable time to express their professional

thoughts. I would like to thank them for their help, continuous encouragement, fertile

discussion and valuable suggestions and comments throughout the research and the

thesis work.

This work would not be done without prays, help, support and care of the best

and great person in my life, my mother. Without her, nothing would be done at all. I

would like to thank her for her patience and love. Many thanks for my father who

supports me a lot in my life. I would like to thank my lovely sister for her support.

Finally, I would like to thank my friends who helped me through the PhD and

in the thesis. I pray for God in order to help them through their lives.

Page 5: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

iv

Table of ContentsPage

Acknowledgment iii

List of Figures iv

List of Tables ix

List of Abbreviations x

Abstract xv

Chapter 1: Introduction............................................................................ 1

1.1 Problem Definition.................................................................................................... 2

1.2 Research Objectives.................................................................................................. 3

1.3 Contributions............................................................................................................. 3

1.4 Thesis Organization.................................................................................................. 3

Chapter 2: Survey of Wireless Sensor Networks.................................... 5

2.1 Wireless Sensor Network Architecture..................................................................... 5

2.2 Wireless Sensor Network Layers.............................................................................. 8

2.3 Sensor Networks Applications.................................................................................. 12

2.4 WSN Design Objectives........................................................................................... 15

2.5 Challenges of WSN................................................................................................... 18

2.6 Research Areas in Wireless Sensor Networks.......................................................... 23

Page 6: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

v

2.7 Routing protocols in Sensor networks...................................................................... 27

2.8 Summary................................................................................................................... 33

Chapter 3: Scheduling Techniques in Wireless Sensor Networks........ 34

3.1 Scheduling in WSN................................................................................................... 34

3.2 End-to-End Packet Delay in WSN............................................................................ 35

3.3 Main Scheduling Concepts in Wireless Sensor Networks........................................ 37

3.4 Summary................................................................................................................... 46

Chapter 4: Proposed Energy Based Scheduling Schema....................... 47

4.1 Main Idea of the Proposed Schema.......................................................................... 48

4.2 Scheme Parameters................................................................................................... 48

4.3 Scheme Equations..................................................................................................... 50

4.4 Priority Queue........................................................................................................... 53

4.5 Integration with routing protocols............................................................................ 53

4.6 WSN Application adaptation.................................................................................... 55

4.7 Properties of proposed Energy Based Scheduling Schema...................................... 57

4.8 Overall proposed schema.......................................................................................... 58

4.9 Summary................................................................................................................... 59

Chapter 5: Simulation of the scheme and results................................... 60

5.1 The Network Simulator (NS-2)................................................................................ 60

Page 7: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

vi

5.2 The Hardware used in the Simulation....................................................................... 64

5.3 Simulations Parameters and environment................................................................. 65

5.4 The Simulations Metrics........................................................................................... 67

5.5 Simulation Results.................................................................................................... 69

5.6 Energy Based Scheduling Scheme with threshold.................................................... 79

5.7 Summary................................................................................................................... 82

Chapter 6: Conclusion and Future Work............................................... 83

6.1 Conclusion................................................................................................................ 83

6.2 Future Works............................................................................................................ 84

Outcome From the thesis.......................................................................... 86

References.................................................................................................. 87

Appendix A - Trace File Field Types....................................................... 95

Appendix B - Sample Awk Scripts........................................................... 98

Page 8: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

vii

List of Figures

Figure 2.1 Overview of main sensor node hardware component......................... 6

Figure 2.2 Protocol layers for sensor networks.................................................... 9

Figure 2.3 AODV route discovery....................................................................... 28

Figure 2.4 AODV RREQ packet.......................................................................... 29

Figure 2.5 AODV RREP packet........................................................................... 30

Figure 2.6 AODV RERR packet.......................................................................... 30

Figure 2.7 AODV Hello packets.......................................................................... 31

Figure 3.1 Scheduler function model................................................................... 34

Figure 3.2 Classifications of Packet scheduling techniques................................. 38

Figure 4.1 Scheduling Schema in WSN architecture........................................... 56

Figure 4.2 Packet Energy consumption vs. the threshold..................................... 57

Figure 5.1 Architecture of the WSN node in NS-2.............................................. 63

Figure 5.2 The position of the sink node in the simulated WSN.......................... 66

Figure 5.3 Network average Energy Level across Network life time.................. 70

Figure 5.4 Network Energy consumption vs. Packet Delivery Ratio................... 71

Figure 5.5 Fairness Index..................................................................................... 73

Figure 5.6 Network average Energy Level across Network life time.................. 74

Figure 5.7 Average Network Energy consumption vs. Packet Delivery Ratio in

DSDV..................................................................................................

75

Figure 5.8 Fairness Index of DSDV vs. the AODV with proposed schema........ 76

Figure 5.9 Network average Energy Level across Network life time.................. 77

Page 9: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

viii

Figure 5.10 Average Network Energy consumption vs. Packet Delivery Ratio in

DSR

78

Figure 5.11 Fairness Index of DSDV vs. the AODV with proposed schema........ 79

Figure 5.12 Fairness Index the Energy Based Scheduling Schema before and

after applying the threshold.................................................................

81

Figure 5.13 Dropping Probability vs. the distance from the sink node.................. 81

Page 10: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

ix

List of Tables

Table 3.1 Packet priorities when different VMS policies are used………....…. 43

Table 4.1 Amount of reserved bits (unused bits)…………………………….... 55

Table 5.1 Simulation Parameters…………………………………………….... 65

Page 11: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

x

List of Abbreviations

AODV Ad hoc On Demand Distance Vector

CBR Constant Bit Rate

DSDV Destination-Sequenced Distance-Vector

DSR Dynamic Source Routing

DVM Dynamic Velocity Monotonic Scheduling

EB-AODV Energy Based Scheduler with AODV

EETD End to End Estimation of Transmission Delay

ETD Estimation of Transmission Delay

FIFO First In First Out

JiTS Just-in-Time Schedules

LFF Lagging Flow First

IFq Interface Queue

LL Link Layer Object

MAC Medium Access Control

NAM Network Animator

NS-2 Network Simulator-2

OTCL Object Oriented Extension Of Tcl

PD Packet Deadline

PEC Packet Energy Consumption During Transmission

PEP Packet Energy Path Level

PS Packet Size

PSP Packet Sending Priority

QoS Quality of Service

RAM Random Access Memory

RERR Route Error Message

Page 12: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

xi

RREP Route Replay Message

RREQ Route Request Message

RREP-ACK Route Replay Message - Acknowledgment

SVM Static Velocity Monotonic Scheduling

TCL Tool Command Language

TTL Time to Live

WSN Wireless Sensor Network

Page 13: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

xv

Abstract

Wireless Sensor Networks (WSNs) consist of sensor nodes that are spatially

distributed. These sensor nodes are connected to each other through wireless

technology. They are an important emerging technology that will revolutionize

sensing for a wide range of military, scientific, industrial and civilian

applications. In many WSN applications, the sensor nodes are deployed in an

ad hoc style without careful any preplanning and engineering. Once deployed,

the sensor nodes must have the ability to autonomously organize themselves

into a wireless communication network.

New packet scheduling schemes have been developed for real-time data

communication. These schemes work on prioritizing packets according to their

deadlines. Packet prioritizing cannot support real time applications or assure

network lifetime. In extreme traffic environments, large queues may lead to

packet delay and packet dropping. Packet dropping leads to energy loss, as a

packet could have consumed high energy in order to be delivered to its

destination.

The continuous decrease in the size and cost of sensors has motivated

intensive research addressing the potential of collaboration among sensors in

data. Current research on routing and scheduling in wireless sensor networks

focused on energy aware protocols to maximize the lifetime of the network.

These researches are scalable to accommodate a large number of sensor nodes.

In addition, they are tolerant to sensor damage and battery exhaustion. Sensor

networks are deployed to gather information for later analysis, monitoring or

tracking of phenomena in real-time.

In WSNs, transmitted packets are queued at intermediate nodes. Each node

schedules the queued packets by assigning priorities to each packet. Priorities

are assigned to packets according to their deadlines. This method in packet

Page 14: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

xvi

prioritization does not take into consideration either the network life time or

energy consumption. Besides, it may lead to dropping high energy valuable

packets. In many applications, WSN lifetime is considered a very critical issue,

while setting up the network.

In this thesis, a new scheduling scheme, named Energy Based Scheduling

scheme is introduced. In this scheme, packets are not only prioritized according

to their deadlines but also according to some energy measures related to the

network, that are obtained from the network nodes and are used in packet

prioritization. The proposed scheme is integrated with the AODV routing

protocol. The unused bits in the AODV packets are used by the proposed

scheme in assigning sending priorities to each packet in the network. Through

this thesis, the proposed scheduling scheme is compared with the Basic Priority

Scheduling scheme, using NS-2. Comparisons are done according the network

life time, energy consumption and the fairness index measure. The results

prove that the Energy Based scheduling scheme increase the network life time

and decrease the energy consumption for the goodput packets. On the other

hand, the fairness index was affected.

Keywords: Wireless Sensor Networks, scheduling scheme, AODV, Basic

Priority scheduling scheme, NS-2

Page 15: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

1

Chapter 1

Introduction

Wireless networks, like wireless mobile ad-hoc networks and Wireless

Sensor Networks (WSNs) have played a great important role in a wide range of

applications. In the 21st century, they have been identified as one of the most

important technologies. WSNs are a rapidly emerging technology which will

have a strong impact on research and will become an integral part of life in the

near future. The huge application space of WSNs covers health care,

surveillance, military, environment monitoring and many more. Because of

their great usage applications, they have attracted considerable research interest

in recent years. WSNs support monitoring and controlling of physical

environments from remote locations with better accuracy [1].

Sensor networks are dense wireless networks of small and low-cost sensors.

They are composed of a large number of sensors deployed randomly in an ad-

hoc manner in the area/target to be monitored. Sensors collect and disseminate

environmental data. Each sensor has limited battery energy supply,

transmission radius and sensing capability. The random deployments of

sensors don’t require be engineering or predetermining. This allows fast

random deployment in inaccessible terrains or disaster relief operations [2]. On

the other hand, random deployment requires that sensor network protocols and

algorithms must possess self-organizing capabilities. They support monitoring

and controlling of physical environments from remote locations with better

accuracy [3].

In wireless sensor networks, energy sources provided for sensors are usually

battery power. It has not yet reached the stage for sensors to operate for a long

time without recharging. The energy conservation is the most critical issue

because of the weight and size limitations of sensor nodes [4].

Page 16: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

2

Since sensors are often purposed to work in remote or hostile environment,

such as a battlefield or desert, it is undesirable or impossible to recharge or

replace the battery power of all the sensors.

WSNs can be deployed in the places where the wired sensor system cannot

be deployed. These places are in the chemical environments that are

inaccessible by humans. They are used in ordet to facilitate monitoring and

controlling of physical environments from remote locations with better

accuracy [5].

1.1 Problem DefinitionSensors are often purposed to work in remote or hostile environment, such

as a battlefield or desert. So, it is unwanted or impossible to recharge or replace

the battery power of all the sensors [6].

WSNs contain a lot of constrains, such as energy limitation, decentralized

collaboration, and fault tolerance. These constraints cause many unresolved

design and implementation problems, so measurements are virtually

impossible. However, long system lifetime is expected by many monitoring

applications. The system lifetime, that is measured by the time until all nodes

have been drained out of their battery power or the network no longer provides

an acceptable event detection ratio, directly affects network usefulness [4, 7].

The most energy consuming operation is data transmission and reception.

Control messages and sensing and processing operations also contribute to the

energy consumption [8]. In order to minimize the consumed energy, dropping

packets should not be only according to the deadline but also according to the

packet energy consumption. So, the scheduling needs to consider the queuing

delay and packet energy consumption, in order to achieve better network QoS

and improve the WSN lifetime [9, 10].

Page 17: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

3

1.2 Research ObjectivesThe objective of this thesis is to introduce a new scheduling schema. Most

of WSN energy consumption is due to the packet transmission. The new

schema should have the ability to prioritize packets according to energy

consumption and deadline, besides improving the network quality of service.

In WSN, packets are buffer in each node on the path from source to

destination. As each node has a finite buffer size, packets are dropped and

transmitted in order to keep the queue ready for new packets. Dropping and

transmitting packets is done according to many constraints.

The process of managing the packets in each node queue is called

scheduling. Existing Scheduling algorithms are according to deadline or the

technique of first come first served. Energy consumption by the packets during

the transmission and reception process is not considered in any scheduling

algorithm.

1.3 ContributionsIn this thesis, we develop the Energy Based Scheduling schema for Wireless

Sensor Networks. It offers a significant improvement in the network lifetime

and QoS. It reduces the energy consumption and a packet delay for remote

nodes from the destination. Both data and control packets are treated in the

same manner, according to energy consumption and packet deadline.

1.4 Thesis OrganizationThe rest of the thesis is organized as follows:

Chapter 2 presents an introduction to wireless sensor networks, including

network architecture, layers, Applications and challenges. This introduction

includes the sensor hardware component and the types of WSN architectures.

In addition, the main types of routing protocol are mentioned including Pro-

Page 18: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

4

active (Table-Driven) routing and Reactive (On Demand) Routing Protocols.

The main routing protocols for these types were briefly discussed.

In chapter 3, we present a brief review of Scheduling techniques in Wireless

Sensor networks and the types of delay in WSN. This review includes the

main types of the scheduling techniques which they depend on in packet

scheduling.

Through chapter 4, the proposed energy based scheduling schema is

introduced. The equations used in the proposed schema are discussed. Besides,

the integration of the proposed schema with AODV routing protocol has been

discussed.

The simulation and results when comparing the proposed energy schema, is

introduced in chapter 5. In this chapter, a comparison is done between the

proposed energy schema with AODV and the basic priority scheduling schema

with AODV, DSR and DSDV.

Finally, chapter 6 concludes the thesis and presents a future work of it.

Page 19: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

5

Chapter 2

Survey on Wireless Sensor Networks

Advancements in the area of wireless communication technologies are

undergoing rapidly. The last years have experienced a huge growth in

research in the area of wireless sensor networks (WSNs). In WSNs,

communication is established with the help of distributed sensor nodes are

used to sense specific information [12]. WSNs consist of individual nodes

that are able to react with their environment by sensing, monitoring or

controlling physical parameters. WSNs are powerful because of its ability to

support a lot of different real-world applications. In a WSN, each sensor

node has the ability to independently perform some processing and sensing

tasks [1]. The position of sensor nodes doesn’t need to be engineered or pre-

determined. This means that wireless sensor network protocols and

algorithms must be able to possess self-organizing capabilities.

In this chapter, we will introduce wireless sensor network architecture,

applications, protocols and challenges.

2.1 Wireless Sensor Network ArchitectureA WSN is a network consisting of many sensor nodes with sensing,

wireless communications and computing capabilities. These sensor nodes

are dispersed in an unattended environment (i.e. sensing field) to sense the

physical world. The sensed data can be gathered by a few sink nodes which

have accesses to infrastructure networks like the Internet [13].

The hardware resources, which are available on micro-sensor nodes, are

significantly more limited than other wireless devices such as PDAs or

laptops. This limitation is driven by cost and size considerations. The

challenge is how to make balance the application requirements and the

limited available resources. Reducing the consumed energy is often the

primary target; since the transmission is one of the most costly operations

Page 20: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

6

(transmitting 1 byte 100 meters consumes similar energy as processing

several thousand instructions) [10, 14].

The concept of wireless sensor networks is based on a simple equation

[15]

Sensing + CPU + Radio = Thousands of potential applications

2.1.1 The Sensor node ArchitectureA basic sensor node comprises five main components (Figure 2.1) [16]:

Controller: A controller works on processing all the relevant data,

capable of executing arbitrary code.

Memory: It is used to store programs and intermediate data; usually,

different types of memory are used for programs and data.

Sensors and actuators: They are actual interface to the physical world:

devices which can be able to observe or control physical parameters of

the environment.

Communication: In order to turn nodes into a network, a device

requires sending and receiving information over a wireless channel.

Power supply: As usually no tethered power supply is available. Some

forms of batteries are necessary to provide energy. Sometimes, some

form of recharging by obtaining energy from the environment is

available as well (e.g. solar cells).

Figure 2.1 Overview of main sensor node hardware component

ControllerSensors /ActuatorsCommunication

device

Power supply

Memory

Page 21: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

7

2.1.2 Wireless Sensor Networks ArchitecturesWSNs are considered application specific. A sensor network is usually

deployed for a specific application. Therefore, it has some different

characteristics. According to different criteria, WSNs are classified into

different categories [17].

Static and Mobile Network. According to the mobility of sensor

nodes, a sensor network can be static or mobile. In a static sensor

network, all sensor nodes are static without movement, which is the

case for many applications. However, some sensor applications

require mobile nodes to accomplish a sensing task [18, 19].

Deterministic and Nondeterministic Network. According to the

deployment of sensor nodes, a sensor network can be deterministic or

nondeterministic. In a deterministic sensor network, the positions of

sensor nodes are preplanned and are fixed once deployed. It is difficult

to deploy sensor nodes in a preplanned manner because of the harsh or

hostile environments. Instead, sensor nodes are randomly deployed

without preplanning and engineering. Obviously, nondeterministic

networks are more scalable and flexible, but require higher control

complexity [20, 21].

Static - Sink and Mobile - Sink Network. A data sink in a sensor

network can be static or mobile node. In a static - sink network, the

sinks are static with a fixed position located close to or inside a

sensing region. All sensor nodes send their sensed data to the sink(s).

In a mobile - sink network, the sink(s) move around in the sensing

region to collect data from sensor nodes, which can balance the traffic

load of sensor nodes and alleviate the hotspot effect in the network

[22, 23].

Single - Sink and Multisink Network. A sensor network can have a

single sink or multiple sinks. In a single - sink network, there is only

Page 22: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

8

one sink located close to or inside the sensing region. All sensor nodes

send their sensed data to this sink. In a multisink network, there may

be several sinks located in different positions close to or inside the

sensing region [24].

Single - Hop and Multihop Network. According to the number of

hops between a sensor node and the data sink, a sensor network can be

classified into single - hop or multihop. In a single - hop network, all

sensor nodes transmit their sensed data directly to the sink, which

makes network control simpler to implement. Multihop networks have

a wider range of applications at the cost of higher control complexity

[25].

Self - Reconfigurable and Non - Self - Configurable Network.

According to the configurability of sensor nodes, a sensor network can

be self - configurable or non - self - configurable. In a non - self -

configurable network, sensor nodes have no ability to organize

themselves into a network. Instead, they have to rely on a central

controller to control each sensor node and collect information from

them. A network with such self - configurability is suitable for large -

scale networks to perform complicated sensing tasks [26].

Homogeneous and Heterogeneous Network. According to whether

sensor nodes have the same capabilities, a sensor network can be

homogeneous or heterogeneous. In a homogeneous network, all sensor

nodes have the same capabilities in terms of energy, computation, and

storage. In contrast, a heterogeneous network has some sophisticated

sensor nodes that are equipped with more processing and

communicating capabilities than normal sensor nodes [27].

2.2 Wireless Sensor Networks LayersThe protocol layers for WSNs consists of five protocol layers, the

physical layer, data link layer, network layer, transport layer, and

Page 23: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

9

application layer, as shown in Figure 2.2. The protocol layers can be divided

into a group of management planes across each layer. Each layer includes

power, connection, and task management planes. The power management

plane has the responsibility for managing the power level of a sensor node

for, processing, sensing, transmission and reception, which can be

implemented by employing efficient power management mechanisms at

different protocol layers [28]. The connection management plane is

responsible for the configuration and reconfiguration of sensor nodes to

establish and maintain the connectivity of a network in the case of node

deployment and topology change due to node addition, node failure, node

movement. The task management plane is responsible for task distribution

among sensor nodes in a sensing region in order to improve energy

efficiency and prolong network lifetime [29].

Figure 2.2 Protocol layers for sensor networks

2.2.1 Physical layerThe responsibilities of the Physical Layer are carrier frequency

generation, frequency selection, signal detection, modulation and

Page 24: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

10

encryption. Its first priority is energy minimization and secondary concerns

are the same as those of other wireless networks. This task is carried out by

devices called transceivers. So, it should deal with various related issues,

like transmission medium and frequency selection, carrier frequency

generation, signal modulation and detection, and data encryption.

2.2.2 Data Link LayerThe data link layer has the responsibility of multiplexing of data frame

detection, data streams, medium access and error control. It has the task of

ensuring a reliable communications link between neighboring nodes, which

in the case of WSNs means between nodes in radio range.

2.2.2.1 Medium Access Control (MAC) protocolsMedium Access Control (MAC) protocols are the first and most

important protocol layer above the Physical Layer. Medium access was and

still one of the most active research areas for WSNs. MAC is one of the

critical issues in the design of wireless sensor networks (WSNs) The main

functions of a MAC protocol for WSNs are the coordination and scheduling

of transmissions between the competing nodes. The design of MAC

protocols for WSNs must take in consideration the characteristics of these

networks such as the node mobility, the lack of any central coordination, the

unreliability of the wireless medium, the problems of hidden and exposed

nodes and the energy constrained problem.

Modified versions of the IEEE 802.11 MAC layer protocol are often used

by sensor network platforms. Since IEEE 802.11 is the most deployed

wireless MAC protocol, it has been chosen as the main MAC protocol in our

thesis.

The 802.11 MAC layer specifications specifies two kinds of access

methodologies as follows.

1. Point Coordination Function (PCF): It is usually used for real

time data transmission with priorities in infrastructure networks. This

Page 25: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

11

is a contention free access protocol; PCF is not used in Ad hoc

networks.

2. Distributed Coordination Function (DCF): Probably, all Ad hoc

networks (including sensor networks) use DCF as the access

methodology. This is a contention based access protocol. This section

describes the features of DCF.

2.2.3 Network LayerThe network layer is surely the area with the most active research

interest. Network layer mainly deal with determining the route from source

to destination and manage traffic problems. Generally, network layer is

responsible for end-to-end packet delivery, whereas the data link layer is

responsible for node-to-node (hop-by-hop) packet delivery [21]. Routing

protocols in WSN can be categorized as follows:

Data-Centric: Data are spreaded between sensors without the need

for global unique ID. It depends on the naming of desired data.

Hierarchical: Sensors are controlled by a sensor (cluster-head) to

aggregate data. Cluster-head is either a special (more powerful) node

or an elected sensor among each cluster.

Location-based: These protocols are location-aware; by utilizing a

Global Positioning System (GPS). The ability to find the location

makes it easier to route data to single and specific region instead of

broadcasting traffic to all regions.

Quality of Service based: Protocols which ensure some QoS

requirements such as minimum cost path, minimizing energy

consumption, low throughput and delay.

2.2.4 Transport LayerIt is responsible for packet transmission and reception. In other words, it

is responsible for reliable end to end data delivery between sensor nodes and

the sink(s). Routing protocols are handled in this layer. Normal transport

protocols developed for wireless or wired communication does not address

Page 26: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

12

WSN resource constrains [16]. Some consideration must be taken while

developing transport protocols specific for WSN:-

Reliability for both ways of communications; sink-to-sensors and

sensor-to sink.

A good Congestion Control mechanisms increases network efficiency

and save power.

Self-configuration approaches to adapt to frequent changes in

network topology.

Should be energy-aware.

Data-centric.

2.2.5 Application LayerMany WSNs’ applications heavily rely on coordinated services such as

localization, time synchronization, and in-network data processing to

collaboratively process data. Normal transport protocols developed for

wired or wireless communication does not address WSN resource

constrains. Although many sensor network applications have been proposed,

their corresponding application - layer protocols still need to be developed

[28].

2.3 Sensor Networks ApplicationsWSNs find a diversity of applications in both the civilian population and

the military a worldwide. They can be used in various applications such as

intelligent agriculture, medical health care, environment monitoring and

protection, and military battlefield surveillance. In many WSN applications,

individual nodes in the network cannot easily be connected to a wired power

supply, so they have to rely on onboard batteries [30]. This means that,

energy efficiency of any proposed solution is a very important issue, if the

power supply is an issue. WSNs can be divided into two types,

homogeneous and heterogeneous [30]. In heterogeneous networks, there are

different types of sensors. They perform multiple operations simultaneously.

While in homogeneous, each node has an identical function and performs

Page 27: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

13

the same task. In this section, some WSNs applications will be discussed

[27].

2.3.1 Environment applicationsEnvironmental monitoring can be used for animal tracking, forest

surveillance, flood detection, and weather forecasting. It is one of the

primary applications of wireless sensor networks. The advantages of WSNs

are the long-term, unattended, wirefree operation of sensors close to the

objects that have to be observed. WSNs can be used in gaining an

understanding of the number of plant and animal species that live in a given

habitat [31].

2.3.2 Military applicationsThe initial wireless sensor network is used in the military applications.

Since sensor nodes are low-cost, destruction of some nodes by hostile

actions in the battlefields may not affect a military operation. Military

applications are very closely related to the concept of wireless sensor

networks. WSNs are used in covering areas of interest extents from

information collection to battlefield surveillance, enemy tracking or target

classification [31].

Battlefield Monitoring: Sensors are deployed in a battlefield to

monitor the presence of forces and vehicles, and track their

movements, enabling close surveillance of opposing forces.

Object Protection: Sensor nodes are deployed around sensitive

objects, for example, atomic plants, strategic bridges, oil and

communication centers, gas pipelines, and military headquarters, for

protection purpose.

Intelligent Guiding: Sensors can be mounted on unmanned robotic

vehicles, tanks, submarines, missiles, fighter planes, or torpedoes to

guide them around obstacles to their targets and lead them to

Page 28: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

14

coordinate with one another to accomplish more effective attacks or

defenses.

Remote Sensing: Sensors could be deployed for remote sensing of

biological, nuclear and chemical weapons, detection of potential

terrorist attacks, and reconnaissance.

2.3.3 Health Care ApplicationsWSNs can be used to monitor and track elders and patients for health

care purposes, which can significantly relieve the severe shortage of health

care personnel and reduce the health care expenditures in the current health

care systems [32]

Behavior Monitoring: Sensors can be deployed in a patient’s home

to monitor the behaviors of the patient. For example, it can alert

doctors when the patient falls and requires immediate medical

attention. It can monitor what a patient is doing and provide

reminders or instructions over a television or radio.

Medical Monitoring: Sensors can be integrated into a wireless body

area network to monitor vital signs, environmental parameters, and

geographical locations. Besides, they allow long term, noninvasive,

and ambulatory monitoring of patients or elderly people with

instantaneous alerts to health care personal in case of emergency,

immediate reports to users about their current health statuses, and real

- time updates of users’ medical records.

2.3.4 Industrial Process ControlIn industry, WSNs can be used to monitor manufacturing processes or the

condition of manufacturing equipment. For example, wireless sensors can be

instrumented to production and assembly lines. So, they can be able to

monitor and control production processes. Chemical plants or oil refiners

can use sensors to monitor the condition of their miles of pipelines. Tiny

sensors can be embedded into the regions of a machine that are inaccessible

Page 29: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

15

by humans to monitor the condition of the machine and alert for any failure

[33].

2.3.5 Security and SurveillanceWSNs can be used in many security and surveillance applications. For

example, acoustic, video and other kinds of sensors can be deployed in

buildings, airports, subways and other critical infrastructure. Also, sensors

can be used in nuclear power plants or communication centers to identify

and track intruders, and provide timely alarms and protection from potential

attacks [32].

2.3.6 Home IntelligenceWSNs can be used to provide more convenient and intelligent living

environments for human beings [32].

Smart Home. Wireless sensors can be embedded into a home and

connected to form an autonomous home network. For example, a

smart refrigerator connected to a smart stove or microwave oven can

prepare a menu based on the inventory of the refrigerator. Then, it

sends relevant cooking parameters to the smart stove or microwave

oven, which will set the desired temperature and time for cooking.

The contents and schedules of TV, VCR, DVD, or CD players can be

monitored and controlled remotely to meet the different requirements

of family members.

Remote Metering. Wireless sensors can be used to remotely read

utility meters in a home like water, gas, or electricity and then sends

the readings to a remote center through wireless communication.

2.4 WSN Design ObjectivesSensor Networks characteristics and requirements for different

applications have a decisive impact on the network design objectives in

terms of network capabilities and network performance. WSN design should

follow some aspects in order to achieve its goal. They are:

Page 30: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

16

Small Node Size. One of the primary design objectives of sensor

networks is to reduce the node size. Sensor nodes are usually

deployed in a harsh or hostile environment in huge numbers.

Reducing node size can facilitate node deployment, and also reduce

the cost and power consumption of sensor nodes.

Low Node Cost. Node cost reduction is another primary design

objective of sensor networks. Since sensor nodes are usually

deployed in a harsh or hostile environment in large numbers and

cannot be reused, it is important to reduce the cost of sensor nodes so

that the cost of the whole network is reduced.

Low Power Consumption. Reducing power consumption is the most

important objective in the design of a sensor network. Since, the

sensor nodes are powered by battery and it is often very difficult or

even impossible to change or recharge their batteries. It is crucial to

decrease the power consumption of sensor nodes in order to increase

the lifetime of the sensor nodes, in addion to the whole network.

Self - Configurability. In sensor networks, sensor nodes are usually

deployed in a region of interest without careful planning and

engineering. Once deployed, sensor nodes should be able to

autonomously organize themselves into a communication network

and reconfigure their connectivity in the event of topology changes

and node failures.

Scalability. In WSNs, the number of nodes may be on the order of

tens, hundreds, or thousands. Thus, network protocols designed for

sensor networks must be scalable to different network sizes.

Adaptability. In sensor networks, any node may fail, join, or move,

which would result in changes in node density and network topology.

Thus, network protocols which are designed for sensor networks

should be adaptive to such density and topology changes.

Page 31: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

17

Reliability. For many sensor network applications, it is required that

data be reliably delivered over noisy, error - prone, and time - varying

wireless channels. To meet this requirement, network protocols

designed for sensor networks must have the ability to provide error

control and correction mechanisms to ensure reliable data delivery.

Fault Tolerance. Sensor nodes are apt to failures due to harsh

deployment environments and unattended operations. So, sensor

nodes must be able to be fault tolerant and have the abilities of self -

testing, self -repairing, self - calibrating and self - recovering.

Security. In many military applications, sensor nodes are deployed in

a hostile environment and thus are vulnerable to adversaries. In such

situations, a sensor network should introduce effective security

mechanisms to prevent the data information in the network or a

sensor node from unauthorized access or malicious attacks.

Channel Utilization. Sensor networks have limited bandwidth

resources. Thus, communication protocols designed for sensor

networks should efficiently make use of the bandwidth to improve

channel utilization.

QoS Support. In sensor networks, different applications might have

different QoS requirements in terms of delivery latency and packet

loss. For example, some applications, for example, fi re monitoring,

are delay sensitive and thus require timely data delivery. Some

applications, for example, data collection for scientific exploration,

are delay tolerant but cannot stand packet loss. Thus, the design of

network protocol should consider the QoS requirements of specific

applications.

Page 32: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

18

2.5 Challenges of WSNHandling a wide range of application types would hardly be possible

with any single realization of a WSN [34].

2.5.1 System ArchitectureThere is no unified system and networking architecture that is stable and

mature enough to build different applications on top. Most of the

applications and research prototypes are vertically integrated in order to

maximize performance.

2.5.2 Wireless ConnectivityWireless communication in indoor Environments is still quite

unpredictable using low-power consumption RF transceivers, in particular in

clutter environments common inside buildings, with many interfering

electromagnetic fields, such as the one produced by elevators, machinery

and computers, among others.

2.5.3 ProgrammabilitySome form of network re-programmability is desirable; doing so in

energy and communication conservative form remains a challenge. Nodes

should be programmable, and their programming must be changeable during

operation, when new tasks become important. This means that a fixed way

of information processing is not sufficient.

2.5.4 AdaptationThe network operation should adapt itself to application requirement

changes, time-varying wireless channels, and variations of the network

topology. For instance, the group of application requirements may change

dynamically and the communication protocol must adapt its parameters to

satisfy the specific requests of the control actions.

Page 33: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

19

2.5.5 Energy ConsumptionSensors nodes are battery powered nodes and thus have very limited

energy capacity. Energy consumption is a central design consideration for

wireless sensor networks whether they are powered using batteries or energy

harvesters. The energy constraint will not be solved soon due to slow

progress in developing battery capacity [30]. In many scenarios, nodes will

have to rely on a limited supply of energy. Replacing the energy sources in

the field is usually not practicable or a visible solution. Surveillance nature

of many sensor network applications requires long lifetime. So, it must be a

very important research topic to provide a form of energy-efficient

surveillance service for a geographic area.

The energy consumed for transferring one bit of data to a receiver at 100

m away is equal to that needed to execute 3,000 instructions. The ratio of

energy consumption for communicating 1 bit over the wireless medium to

that for processing the same bit could be in the range of 1,000 – 10,000.

Furthermore, the energy consumed for transmission dominates the total

energy consumed for communication and the required transmission power

grows exponentially with the increase of transmission distance. Therefore, it

is desired to reduce the amount of traffic and transmission distance in order

to increase energy savings and prolong network lifetime [30].

The precise definition of lifetime depends on the requirement of

application at hand. The main limiting factor for the lifetime of a sensor

network is the energy supply. Each sensor node should be designed to

manage its local supply of energy in order to maximize total network

lifetime. The node minimum lifetime is more important than the average

node lifetime [35].

There direct trade-offs between the lifetime of a network and quality of

service. As, investing more energy can increase quality but decrease

lifetime. In a wireless sensor node the radio consumes a vast majority of the

system energy. This power consumption can be reduced through decreasing

the transmission output power or through decreasing the radio duty cycle.

Both of these alternatives involve sacrificing other system metrics.

Page 34: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

20

2.5.6 Quality of ServiceQuality of service (QoS) is an important factor in networking, but it is

also a significant challenge. The QoS is one of the most important

challenges that face WSN. More energy is required to achieve better QoS.

Therefore, WSN lifetime is affected. Providing QoS guarantees have

become even more challenging when you add the complexities of wireless

and mobile networks [17].

2.5.6.1 Definition of Quality of ServiceQoS is the ability to provide different priorities to different applications,

users, or data flows, or to guarantee a certain level of performance to a data

flow. QoS guarantees are important if the network capacity is a limited

resource. Due to the limitation of network resources especially in wireless

networks, real time traffic need to be given higher priority to ensure that

arrival to the destination on time.

2.5.6.2 Quality of Service parametersQoS parameters differ from application to application. In sensor

networks, battery life and energy conservation would be the prime QoS

parameters. The QoS parameter considered here is aimed to real time

applications. However, maximizing QoS and minimizing energy

consumption are in most cases conflicting requirements [17].

2.5.6.3 Quality of Service in different layers Physical layer: It means the quality in terms of transmission

performance. Power control is used both to ensure the quality of

reception and to optimize the capacity. It seeks to avoid the

interference with other networks or natural sources of radiation.

Data Link layer: The scheduling of medium access and the

sequence of packets to be sent is changed to supply the QoS

requirements. These changes may be achieved by packet reordering

and by priority control and admission policies. It is possible to adjust

Page 35: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

21

the amount of control packets sent to increase the QoS of a data

packet. Current proposed MAC protocols in WSN concerns mainly

about power conserving. They don’t support real QoS due to the

tradeoffs between energy efficiency and QoS capability. QoS

implemented in MAC layer is also important. It could provide high

probability of access with low delay when stations with higher user

priority want to access the wireless medium [36].

Network Layer: It mainly deals with determining the route from

source to destination and manages traffic problems. Some routing

protocols in WSN are developed to ensure some QoS requirements

such as minimum cost path; in term of energy for example, low

throughput and delay. Similar to the link layer, it is possible to use

packet prioritization.

Application Layer: QoS may interpret in two different prospective.

One prospective defines QoS as quality perceived by the user or

application (subjective). The other is defining QoS in respect to

network

2.5.6.4 Models of Quality of ServiceQoS model are defined into two types. They are Integrated Service (IntServ)

and Differentiated Services (DiffServ) [38].

IntServ: provides QoS to individual applications or flows. Resource

Reservation Protocol is used to provide a circuit switched service in

packet switched network. IntServ decides if the desired service could

be provided with the current available network resource. The

scalability problem is the main drawback of IntServ. It caused by the

need of storing every flow state in the routes.

DiffServ: provides QoS to large classes of data or aggregated traffic.

Routers are divided into two types: edge routers and core routers.

Page 36: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

22

Edge routers are at the boundary of the networks. In edge routers,

traffic will be classified, conditioned and assigned to different

behavior aggregate when it traverse between different networks. Core

routers forward packets based on this ToS field. In addition, core

routes also need to follow the per-hope behavior which takes charge

of scheduling of packets.

2.5.6.5 Challenge of QoS in WSNWSNs differ from the traditional wired networks. Due to bandwidth,

memory and processor limitations, QoS in WSN is a challenging task.

WSNs have certain unique characteristics which cause difficulties for

providing QoS in such networks [39]. These characteristics are:-

Dynamically varying network topology

In a WSN, mobility problem can also exist if the sensor nodes are

mobile in the given application. When nodes are mobile, network

topology is changing dynamically. The route which is already set up

with required QoS could not satisfy QoS anymore if one of the nodes

on this established route moves. A node could move to an area with

more interference to it.

Limited resource availability

WSN life nature is limited because of the fact that most nodes

operate on unchangeable power source like battery; another reason is

the ease of node damage. The data rate is so limited for wireless

links if we compared it with the data rate available in wired network.

The basic characteristics of the wireless channel like fading, noise,

and shared data rate between neighbor nodes will also degrade the

wireless data rate. The actual radio data rate becomes much smaller.

As a result, it is very hard for a wireless network to provide too high

data rate which could be provided by the wired network. It also

brings problem of cooperation between wireless network and wired

network.

Page 37: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

23

Lack of precise state information

Because of the dynamic characteristic, information of nodes

transmitted to other nodes may change right after this information is

transmitted to its neighbors.

Application diversity

WSN consider being application specific rather than general purpose.

They carry only the software and hardware that is needed for the

application. The vast number of applications in WSN offers different

QoS requirements.

Data correlation

Data, which is collected by a sensor node, tends to be correlated to

the data collected by its neighbors, thus it may be dropped or

submitted to fusion or preprocessing in order to decrease bandwidth

utilization.

2.6 Research Areas in Wireless Sensor NetworksWireless sensor network faces a lot of problems. These problems appear

from the nature of the WSN [39]. Through this section, we focus on the

most important problems in wireless sensor networks.

2.6.1 Localization in WSNIn wireless sensor networks, localization is identified as the process of

determining the geographical positions of sensors. In other words, it is

defined as an algorithm that finds the Euclidean position for some or all of

the nodes in the network. Only some of the sensors in the networks have

prior knowledge about their geographical positions. In many applications of

wireless sensor networks, valuable location information of sensor nodes is

critical to the success of the applications. Most of the collected data from

Page 38: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

24

sensors are only meaningful when they are coupled with the location

information of the corresponding sensors [40].

For example, consider an application of habitat monitoring. Thousands of

sensors are dropped in the target region of a tropical rain-forest by an

aeroplane. sensing devices are attached with nodes to monitor the changes

of temperature and humidity of the environment.

2.6.2 Routing in WSNSensor networks can be considered a special class of ad hoc networks.

Routing for traditional ad hoc networks is considered a well-researched area

and it is possible to adapt protocols developed there to sensor network

operation. For some applications, messages should arrive at a destination by

a deadline. Due to the high degree of uncertainty in WSN it is difficult to

develop routing algorithms with any guarantees. However, several

characteristics of sensor networks make such protocols poorly suited for

them. These characteristics include [41]:

Data dissemination model of the sensor networks is far from the

view of the traditional wireless ad hoc networks where mostly the

communication is from one source to one destination;

Data-centric operation where communication is directed to sensors

that satisfy a query attributes differs from the IP-centric view of ad

hoc networks

The emphasis of ad hoc networks is on mobility, many sensor

networks are static.

Sensor network nodes are more energy constrained than ad hoc

nodes, and are not rechargeable. Because of these reasons, several

new routing protocols have been proposed for sensor networks.

There are two types of routing protocols which are reactive and

proactive. In reactive routing protocols, the routes are created only when

source wants to send data to destination whereas proactive routing protocols

are table driven. Reactive routing protocol uses traditional routing tables.

Page 39: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

25

One entry per destination and sequence numbers are used to determine

whether routing information is up-to-date and to prevent routing loops.

2.6.2.1 Pro-active (Table-Driven) routingProactive routing protocols preserve routes to all destinations, regardless

of whether or not these routes are needed. In order to preserve correct route

information, a node must periodically send control messages. Therefore,

proactive routing protocols may waste bandwidth since control messages are

sent out unnecessarily when there is no data traffic. The main advantage of

this category of protocols is that nodes can quickly obtain route information

and quickly establish a session [42].

2.6.2.2 Reactive (On Demand) Routing ProtocolsReactive routing protocols have the ability to dramatically reduce routing

overhead because they do not need to search for and maintain the routes on

which there is no data traffic. On demand routing protocols execute the path

finding process and exchange routing information only when there is a

requirement by the station when it want to initialize a transmission to some

destination. By using the method of on demand routing, the routing load is

decreased a lot. This property is very appealing in the resource-limited

environment [43].

2.6.2.2 Hybrid Routing ProtocolsThe advantages of proactive and of reactive routing are combined in this

type of routing protocols. The routing is initially established with some

proactively prospected routes and then serves the demand from additionally

activated nodes through reactive flooding.

Page 40: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

26

2.6.3 MAC protocols in Wireless Sensor networksAs in all shared-medium networks, medium access control (MAC) is an

important technique which enables the successful operation of the network.

A MAC protocol specifies how nodes in a wireless sensor network

coordinate their communication over a shared communication channel.

A significant amount of energy is consumed by the sensor node’s radio.

Great research has been done on the design of low power electronic devices

in order to reduce energy consumption of these sensor nodes. Due to the

hardware limitations, energy efficiency can be achieved through the design

of energy efficient communication protocols. MAC is an important

technique which ensures the successful operation of the network. One

fundamental task of the MAC protocol is to avoid collisions from interfering

nodes.

MAC protocols for the WSN must achieve two objectives. The first

objective is the creation of the sensor network. A large number of sensor

nodes are deployed and the MAC scheme should be responsible for

establishing the communication links between the sensor nodes. The second

objective is to achieve better fairness index value. This could be done by

sharing the communication medium fairly and efficiently.

The network topology changes over time as well due to many reasons. A

good MAC protocol should be able to easily accommodate such network

changes. Fairness, latency, throughput and bandwidth utilization are

generally the primary concerns in traditional wireless voice and data

networks.

2.6.4 Security in Wireless Sensor networksWSN is an emerging technology that are used in applications, including

wildlife and ocean monitoring, manufacturing machinery performance

monitoring, building safety and earthquake monitoring, and many military

applications. Because of the nature usage of the WSN, traditional security

techniques used in traditional networks cannot be applied directly. Sensor

nodes are often deployed in accessible areas, presenting the added risk of

Page 41: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

27

physical attack. Besides, sensor networks interact closely with their physical

environments and with people, posing new security problems. Therefore,

existing security mechanisms are inadequate [32].

2.7 Routing protocols in Sensor networksIn the section, we make introduce different routing protocol for WSN.

Besides, a detailed explanation of the AODV would be presented as it

integrated with the proposed energy based scheduling schema.

2.7.1 Ad Hoc On-Demand Distance Vector Routing Protocol

(AODV)AODV routing protocol is another on demand routing protocol. Routes

are established when they are required. Compared with DSR, AODV

maintains the routing table in each node rather than in each data packet

header.

2.7.1.1 Route DiscoveryWhen the source node initiates a route discovery process to the

destination, a RREQ packet will be broadcast to the network. When its

neighbours receive this packet, they will check the source address and

request id, which can uniquely identify this packet. If it is the first time they

receive this packet and they do not have the routing information to the

destination, they will rebroadcast it and the hop count of RREQ will be

increased by one. Otherwise, they will discard it. In addition, they will set

up a backward entry those points to the source in their routing table.

Eventually, the destination or any intermediate node that has routing

information to the destination receives this RREQs packet. Then a RREP

packet will be sent back to the source [48].

Figure 2.3 illustrates the process of route discovery. The RREP packet

will travel back to the source in the reverse direction. In addition, all

intermediate nodes will set up a forward entry in their routing table to the

Page 42: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

28

destination. When the RREPs packet arrives at the source, the route

discovery process is completed.

Figure 2.3 AODV route discovery

The RREP packet will travel back to the source in the reverse direction.

In addition, all intermediate nodes will set up a forward entry in their

routing table to the destination. When the RREPs packet arrives at the

source, the route discovery process is completed. When the route is set up

successfully, the source can start sending data packets to the destination.

Each routing entry has an expiration period. If this routing entry is idle for a

while, this route will be considered broken and a RERR packet will be

generated and sent back to the source indicating that the destination is

unreachable.

Each node can get to know its one-hop neighborhood by using HELLO

packets. The purpose of HELLO packets is to inform its neighborhood that

is still alive. Hello packets will not be forwarded. When a node receives a

HELLO packet, it updates the corresponding lifetime of the neighbor

information in its routing table. This local connectivity management should

be distinguished from general topology management to optimize response

time to local changes in the network.

Page 43: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

29

In addition, AODV uses sequence numbers to solve the loop problem.

Each node maintains its own sequence number. When it sends a RREQ, its

sequence number will be incremented. In addition, when it sends a RREP,

its own sequence number will be the maximum of the current sequence

number and the sequence number in the RREQ.

2.7.1.2 Route MaintenanceWhen a route which is active is down due to node failure, the

neighborhood nodes are notified through a RERR message. When a node

receives an RERR, it marks its route to the destination as invalid. When a

source node receives an RRER, it can reinitiate the route discovery.

2.7.1.3 Control MessagesThere are three kinds of control packets used in AODV. Control

messages used for the discovery and breakage of route are as follows [47]:

Route Request Message (RREQ)

A route request packet is flooded through the network when a route is

not available for the destination from source. This packet is used in a

route discovery operation when the destination is not available. It

includes the addresses of the source and the destination.

In addition, it has request ID, hop count and the sequence number of

the source and the destination. Figure 2.4 shows the fields contained

in a RREQ packet.

Source

Address

Request ID Source

Sequence

Number

Destination

Address

Destination

Sequence

Number

Hop

Count

Figure 2.4 AODV RREQ packet

Page 44: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

30

After receiving of request message, each node checks the request ID and

source address pair. The new RREQ is discarded if there is already RREQ

packet with same pair of parameters. A node that has no route entry for the

destination, it rebroadcasts the RREQ with incremented hop count

parameter. A route reply (RREP) message is generated and sent back to

source if a node has route with sequence number greater than or equal to

that of RREQ.

Route Reply Message (RREP)

If the intermediate node knows the route to the destination or the

destination receives a RREQ packet, they will send a RREP packet

back to the source. Figure 2.5 shows the fields contained in a RREP

packet.

Source

Address

Destination

Address

Destination

Sequence

Number

Hop Count Life Time

Figure 2.5 AODV RREP packet

Route Error Message (RERR)

The neighborhood nodes are monitored. When a route that is active is

lost, the neighborhood nodes are notified by route error message

(RERR) on both sides of link.

Unreachable

destination IP

address

Unreachable

destination

sequence

number

Additional

unreachable

destination IP

Address

Additional unreachable

destination sequence

number

Figure 2.6 AODV RERR packet

Page 45: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

31

HELLO Messages.

The HELLO messages are broadcasted in order to know

neighborhood nodes. The neighborhood nodes are directly

communicated. In AODV, HELLO messages are broadcasted in order

to inform the neighbors about the activation of the link. These

messages are not broadcasted because of short time to live (TTL)

with a value equal to one.

Destination

IP address

destination

sequence

number

Originator IP

Address

Originator sequence

number

Figure 2.7 AODV Hello packets

2.7.2 Dynamic Source Routing (DSR)The Dynamic Source Routing (DSR) Protocol is a source-routing on-

demand protocol. The difference in DSR and other routing protocols is that

it uses source routing supplied by packet’s originator to determine packet’s

path through the network instead of independent hop-by-hop routing

decisions made by each node. The two major phases of the protocol are:

route discovery and route maintenance. It is a simple and efficient routing

protocol designed specifically for use in multi-hop wireless ad hoc networks

of mobile nodes [45].

When the source node wants to send a packet to a destination, it looks up

its route cache to determine if it already contains a route to the destination.

Each node maintains route caches containing the source routes that it is

aware of. The node updates entries in the route cache as and when it learns

about new routes. If the node finds that an unexpired route to the destination

exists, then it uses this route to send the packet. On the other hand, if the

node does not have such a route, then it initiates the route discovery process

by broadcasting a route request packet throughout the network [46].

The route request packet contains the address (usually the IP) of the

source and the destination, and a unique identification number. Each

Page 46: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

32

intermediate node checks whether it knows of a route to the destination. If it

does not, it appends its address to the route record of the packet and

forwards the packet to its neighbors. To limit the number of route requests

propagated, a node processes the route request packet only if it has not

already seen the packet and its address is not present in the route record of

the packet [45, 46].

DSR uses Route Error packet to flag invalid links (links that are now

unreachable due to mobility). When a node faces a fatal transmission

problem at its data link layer (when the retransmit limit is reached), it

generates a Route Error packet. When a node receives a route error packet

informing it of a link that is now unusable, it removes the invalid link from

its route cache. All routes that contain invalid link are truncated to that

point.

In route discovery process, source node checks whether it has a route to

this destination in the route cache then it sends packets to a destination. If

the destination address is not in the table, the source node will initiate a

route request (RREQ) packet for broadcast. Nodes receiving this RREQ will

first see whether the destination is itself. If yes, it will reply with a route

reply (RREP) packet unicast to the source node with the reverse path the

RREQ traversed. Otherwise this node is an intermediate node. Intermediate

nodes who receive this packet should first check the freshness of this RREQ.

If the intermediate nodes have received this RREQ recently, it will ignore

the packet; or else the intermediate node will rebroadcast this RREQ,

another alternative is that the intermediate node replies the RREQ when it

knows a route to the destination.

Source node should be notified using route error (RERR) packets when

there is a break on any link on the route which is in use. Source node

receiving the RERR will delete all the routes which contain the reported

link. A new RREQ will be generated when the route is still needed.

The advantages of the DSR protocol include easily guaranteed loop-free

routing, support for use in networks containing unidirectional links, use of

only "soft state" in routing, and very rapid recovery when routes in the

Page 47: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

33

network change. The DSR protocol is designed mainly for mobile ad hoc

networks of up to about two hundred nodes. It is designed to work well with

even very high rates of mobility [46].

2.8 SummaryIn this chapter, we made an overview on the Wireless sensor networks.

This overview took into account many topics regarding the WSN. These

topics include architecture, design objectives, challenges and research areas.

Then, we explain in details routing protocols which are related to our work.

In the next chapter, we will introduce scheduling techniques which are

used in WSN.

Page 48: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

34

Chapter 3

Scheduling Techniques in Wireless Sensor

NetworksScheduling is the primary mechanism available to intermediate nodes

achieve their deadlines. The goal of real-time scheduling algorithms is to

ensure that critical timeliness constraints, such as response time and deadlines,

are met. When necessary, decisions are made that favor the most critical timing

constraints, even at the cost of violating others [49].

This chapter is divided into four sections. The first section gives a breaf

overview on the scheduling in WSN. Then, the types of packet delays are

mentioned. After that, the types of the scheduling schemas used in WSN, are

introduced with a brief explanation for each one of them.

3.1 Scheduling in WSNIn the applications based on sensor networks, the scheduling algorithms

have to work in a distributed manner. The scheduler residing on each node

makes scheduling plans without any global knowledge [50].

Traditional real-time scheduling algorithms are designed for centralized

systems such as a mainframe. Figure 3.1 shows a simple model of the function

of a scheduler. For an input set of parameter values of a specified job, the

scheduler outputs the priority of this job that is used for arbitrating scheduling

on a critical resource.

SchedulerSchedulingParameters ofspecified job

Priority ofthe job

Figure 3.1 Scheduler function model

Page 49: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

35

The challenge here is how to schedule multiple data packets at each node

independently so as to minimize the global data transmission miss ratio.

Besides minimizing the global transmission ratio, minimizing energy

consumption is another important challenge. Communication protocols for

sensor networks must have the ability to provide real-time assurances, data

transmission assurance and energy [26].

The nature of traffic in wireless sensor networks is bursty. It can cause the

exceed of the network resources. In addition, the ad hoc nature of multi-hop

sensor networks makes it difficult to schedule network traffic centrally as in

traditional real-time applications. The scheduler residing on each node makes

scheduling plans without any global knowledge. How to schedule multiple data

packets at each node independently so as to minimize the global data

transmission miss ratio is the challenge here [51, 52].

Existing real-time data communication work have developed packet

scheduling schemes. These schemes work on prioritizing packets according to

their deadlines. Packet prioritization cannot completely support real-time data

communication requirements nor the energy consumptions constrains.

Examples of the most used real-time sensor network protocols are the Basic

Priority Scheduling, RAP, Just in Time Scheduling (JiTS). In our thesis, we

will focus on the Basic Priority Scheduling in our simulations.

3.2 End-to-End Packet Delay in WSNEnd-to-end delay refers to the time taken for a packet to be transmitted from

source to destination across a network. For data communications across WSN,

the problem is providing timeliness guarantees for multi-hop transmission

under energy constraints. Any packet in the network, whether it is control or

data packets, needs to traverse multiple hops from the source to the sink

according to its deadline [53, 54].

Page 50: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

36

3.2.1 End-to-End Packets Delay ComponentsThe transport delay and the queuing delay are the main components of the

end to end delay. They affect the packet end to end delay during transmission

from source to destination.

3.2.1.1 Transport DelayThe transport time of packets from the source to sink are affected by the

processing delay and the propagation delay. Minimizing the transport time of

each packet is not close enough to minimize the end to end delay. The queuing

delay at intermediate nodes is more important. As most of packets time, is

consumed at intermediate nodes. The transport delay happens because of two

delays:-

Processing Delay

While the transmission of control and data packets through intermediate

nodes, specific processing might be necessary. Specific processing might

be necessary, for some applications.

Transmission Delay (or store-and-forward delay)

The propagation delay of packets is determined by the bandwidth and

the size of the message. In a network based on packet switching such as

WSN, transmission delay is the amount of time required to push all of

the packet's bits into the wire. In other words, this is the delay which is

caused by the data-rate of the link.

3.2.1.2 Queuing delayIt is the time spent in the queues at each intermediate nodes on the path from

the source to the sink. In other words, the time a job waits in a queue until it

can be executed. It is a key component of network delay. As a packet is

received at an intermediate node, it is placed in the MAC layer incoming

queue. The queuing delay may be controllable by a scheduler, since a queue is

used to store a data packet temporarily at any forwarding node. When the

Page 51: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

37

network layer receives from the queue, it looks at the packet and decides where

it needs to be forwarded next. The routing layer places the packet in a local

queue while making routing decision. Consequently, the packet is placed in the

MAC layer outgoing queue to be forwarded to the next hop. Since a queue is

used to store a data packet temporarily at any forwarding node, the queuing

delay may be controllable by a scheduler.

The queuing delay may grow to be the main part of the end-to-end packet

transport time especially under high load. More specifically, under moderate to

high data generation rates, congestion and other reasons, the queuing

contribution to delay can far outgrow the physical transmission and processing

contributions.

3.3 Main Scheduling Concepts in Wireless Sensor

NetworksIn WSN, there are different ways in packet scheduling. Scheduling could be

done according to deadline, where packet deadline is the main constraint that

affects the packet sending decision. Other technique depends on the available

time that a packet may have through its journey to the destination [50]. Figure

4.2 shows the types of packet scheduling.

3.3.1 Deadline-based SchedulingIn a wireless sensor network, the scheduling decision is made at each node

independently. The deadline-based scheduling procedure schedules all

incoming data packets based on their deadlines. If a data packet has an earlier

deadline, it receives a higher priority than another with later deadline. These

scheduling algorithms do not differentiate the up-to-date real-time status of

each packet through its forwarding path and therefore may hurt the overall

performance of the real-time scheduling system.

Page 52: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

38

3.3.1.1 Rate Monotonic SchedulingRate monotonic scheduling is a kind of fixed-priority scheduling strategy, it

is a deadline-based scheduling algorithm. The scheduling decision has to be

made distributedly. Once the priority of one task is identified according to its

periodicity, it will not change with time. A task in smaller periodicity has

higher priority. RM can schedule a group of tasks while other fixed priority

strategies can. Fixed-priority strategy is more suitable for wireless sensor

network operating system, because it needs to be scheduled one time before

running. Fixed-priority will be able to ensure the cyclical behavior, and the

tasks are scheduled only in one queue. RM's shortcoming is the lack of

flexibility due to its unchanged in running time. Therefore, it is not suitable for

working during running [51].

RMS is the optimal static-priority algorithm. If a set of tasks cannot be

scheduled using the RMS algorithm, it cannot be scheduled using any static-

priority algorithm. A major limitation of fixed-priority scheduling is that it is

not always possible to fully utilize the CPU [55]. Even though RMS is the

optimal fixed-priority scheme, it has a worst-case schedule bound of:

PacketScheduling

DeadlineBased

RateMonotonicScheduling

EarliestDeadline first

Real-Time

Lagging FlowFirst

AlgorithmBasic Priority

VelocityMonotonicScheduling

Just in TimeScheduling RAP

Figure. 3.2. Classfications of Packet scheduling techniques

Page 53: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

39

= ∗ (2 − 1) (3.1)

Where:-

n is the number of tasks in a system.

is the worst-case schedule bound

The worst-case schedulable bound for one task is 100%. However, as the

number of tasks increases, the schedulable bound decreases, eventually

approaching its limit of about 69.3% (ln2, to be precise). It is theoretically

possible for a set of tasks to require just 70% CPU utilization in sum and still

not meet all their deadlines.

3.3.1.2 Earliest deadline firstEarliest deadline first (EDF) or least time to go is a scheduling algorithm

used in packet scheduling. It places packets in a priority queue. Each packet is

assigned a sending priority according to its deadline. The closer the deadline of

a packet, the higher is its sending probability.

3.3.2 Real-Time Architecture for Sensor NetworksThe key role of a scheduling algorithm in real-time communication

architecture is to schedule the incoming packets for forwarding. Traditional

first come first served scheduling may not work well in real-time applications.

As, packets have different remaining times to their deadlines, besides the

difference in the distances to reach their destination. Most of the scheduling

schemas take neither the energy consumption nor the wireless sensor network

lifetime in the calculations of the priorities. In the following sections, we

present some scheduling schemas.

Page 54: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

40

3.3.2.1 Basic Priority SchedulingIt is a technique for scheduling, which is the default scheduling schema in

the NS-2. It depends on prioritizing the packets according to their usage.

Priority values are assigned to every packet in the network regardless its energy

consumption. High priority values are usually given to control packets, while

medium or low priority values are given to data packets. Data Packets of same

type are served in FIFO order [56].

3.3.2.2 Lagging Flow First AlgorithmLagging Flow First (LFF) is a location-free algorithm proposed in [57]. This

technique considers not only how to deliver the packets to arrive at their

destinations within their deadlines but also how to minimize the maximum

degradation. The degradation value is defined as ϵ:

ϵ = 1 − − (3.2)

Where:-

is the number of packets that flow i actually successfully

delivered

is the number of packets that flow i was supposed to deliver

is acceptable packet loss rate.

This technique maintains two queues, one is a reservation list to hold the

packets that will be delivered, and the other is a buffer to hold packets that do

not have spots in the reservation list. This technique is composed of two

phases. In first phase, whenever a packet is available to be scheduled, a time

slot could be reserved based on its deadline. Then this packet could be inserted

into a reservation list if it is possible. Otherwise, this packet will be inserted

into the second queue. In the second phase, a packet is scheduled in the

Page 55: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

41

reservation list. Therefore, we can observe that the packets in the reservation

list have higher priorities. This algorithm takes into consideration both the

deadline and the degradation of the traffic flow.

3.3.2.3 Velocity Monotonic Scheduling AlgorithmVelocity Monotonic Scheduling Algorithm is a location-based algorithm

proposed by [57]. The basic idea of this algorithm is to prioritize packets based

on their velocities. The definition of packet's velocity is the ratio of the distance

that it needs to travel to the time before its deadline. There are two versions of

velocity monotonic scheduling: static VMS (SVM) and dynamic VMS (DVM).

VMS improves the number of packets that meet their deadlines because it

assigns the “right” priorities to packets based on their different urgencies on the

current hop. VMS also solves the fairness problem in sensor networks because

packets that are far away from the base station will tend to have higher

priorities when it competes against other packets that are closer to the

destination.

VMS calculates the required packet “velocity”, which is used as its priority,

from the deadline and distance between source and sink. In Static VMS, the

velocity is computed once at the source. In Dynamic VMS velocity is

recomputed at intermediate nodes. It also modifies the MAC layer back-off

scheme to schedule packets according to priority. In the following section, we

explain in details the static and dynamic versions of VMS [58].

A. Static Velocity Monotonic SchedulingIn Static VMS (SVM), packets are prioritized based on a fixed requested

velocity. Velocity is computed at packet generation time. The values of

parameters used by prioritizing at any intermediate node are that of the data

source, not the forwarding node. All intermediate nodes have a separate queue

for each priority level and packets of higher priority are always forwarded

Page 56: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

42

before packets of lower priority. Since the priority is fixed at the beginning, an

intermediate node cannot change it even if any unpredictable delay occurs. So

the velocity is fixed or static and defined as follows:

= (3.3)

For routing protocols with different policies, the distance between source

and destination is measured in different ways. The distance is measured in

number of hops, when using shortest path routing. For geometric routing, it

would be measured in Euclidean distance. The shortcoming of SVM is that

since the delay times of packets at intermediate nodes are unpredictable, it is

unable to increase the priority of a packet that is unexpectedly delayed, or

reduce the velocity of a packet that is lucky enough to make quick progress

initially towards the destination.

B. Dynamic Velocity Monotonic Scheduling (DVM)Dynamic VMS recalculates the velocity and resulting priority at each

intermediate node. The value of velocity is decided by function:

= (3.4)

The advantage of dynamic VMS is that an intermediate node has an ability to

adjust the priority based on the specific situation. Table 3.1 shows how DVM

and SVM are calculated for a packet between node a and node b.

Page 57: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

43

Table 3.1: Packet priorities when different VMS policies are used

VMS policy At node a At node b

Static VMS distance(a, sink)E2E Deadline distance(a, sink)E2E DeadlineDynamic VMS distance(a, sink)E2E Deadline distance(b, sink)E2E Deadline − Elapsed Time

3.3.2.4 Just in Time Scheduling (JiTS)The Just in time scheduling is a scheduling scheme that is used for real-time

data communication in sensor networks [59]. This approach overcomes the

shortcoming of other real-time approaches by setting target transmission times

for the packets according to their deadline and the remaining distance along the

path to achieve more effective communication by allocating the slack time

(time until the deadline) among the intermediate hops. JiTS delays data packet

transmission during forwarding for a duration that correlates with their

remaining deadline and distance to the destination. Intuitively, this helps in

heavy-traffic communication environment by making sure that priority

inversion does not occur due to a node with low priority packets sending. Also,

it helps in preventing a node with high priority packets from doing so. The

Estimation of Transmission Delay (ETD) is used to approximate the MAC

layer transmission delay. Since this time is spent below the network layer, the

scheduling cannot directly affect it.

Before a data packet reaches the sink, the end-to-end transmission and

processing delay cannot be obtained. Therefore, previous measurements of

delay were used to estimate the overall delay: it is called this estimate the end-

Page 58: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

44

to-end Estimate of Transmission Delay (EETD). Summing the ETD’s of a data

packet hop by hop during its forwarding can lead to inaccurate estimates since

one hop ETD can fluctuate significantly. Therefore, we use the following

function to decide the EETD:

EETD = ETD . (3.5)

Where:-

The distance can be measured in different ways.

Different JiTS scheduling policies can be developed based on the allocation

of the available slack time among the different hops. The target transmission

times are either set by the source or computed at intermediate hops based on a

known algorithm. In the base JiTS algorithm, the target transmission time is set

to be equal at all hops and is determined as follows:

Target Delay = ( , ) . (3.6)

Where:-

α is a constant safety factor for insurance that the real-time

deadline would be met.

Packet priority is determined by the Target Delay. The time a packet is

delayed in the queue can be used as the key to a priority queue that holds the

packets to be transmitted. The end-to-end transmission and processing delay is

considered along with the queuing delay, by considering the end-to-end

deadline, distance and EETD.

Page 59: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

45

A. Static Just-in-Time SchedulingIn static JiTS, the target delay is set with the values of parameters at the data

source. In equation 3.6, the end-to-end deadline is fixed at the data source; the

EETD is measured with the ETD of forwarding node and the distance from

source to sink (X is the data source). So even we call it static, the different

ETD’s of forwarding nodes would make the target delay at each node different.

B. Dynamic Just-in-Time SchedulingIn dynamic JiTS, the target delay is re-set at each forwarding node with the

local value of parameters. In Equation 3.4, the end-to-end deadline of a packet

at some forwarding node is the remaining slack time, measured by E2E

Deadline − Elapsed Time. The EETD is decided by the one-hop ETD of the

forwarding node and the distance from it to the sink. It is not the distance from

source to sink. So, the dynamic JiTS is able to continuously refine the priority

of the packet.

C. Non-linear Just-in-Time SchedulingIt is possible to allocate the available slack time non-uniformly among the

intermediate hops along the path to the sink. For example, it is desired to

provide the packets with extra time as it gets closer to the sink. The anticipation

is that in a gathering application, the contention is higher as the packet moves

much closer to the sink. Different policies can be developed to break down the

available time. We explore the following policy:

Target Delay = . (3.7)

Page 60: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

46

3.3.2.5 RAP: a Real-time Architecture for Sensor NetworksRAP is a real-time framework developed at the University of Virginia [58].

RAP uses Velocity Monotonic Scheduling (VMS) to prioritize the data packets.

RAP does not consider the queuing delays of data packets; once the packet is

assigned a priority it remains at that priority regardless of queuing delay. RAP

also modifies the MAC layer back-off schemes to schedule packet

transmission. The main design goal of RAP is to develop a fair scheduling

algorithm for data dissemination in a distributed wireless sensor network, so as

to minimize the miss ratio of real-time data traffic. RAP requires support from

several layers in the network, which represents a significant deployment

barrier, especially for heterogeneous networks. In RAP, each incoming data

packet is assigned a priority by VMS scheduler based on its requested velocity,

and then queued into the priority queues before it is forwarded.

3.4 SummaryIn this chapter, we make a brief introduction of scheduling schemas in

WSN. This introduction includes the definitions of the scheduling process in

WSN. Then, we explored the types of end to end delays in WSN. Finally, we

introduced the some scheduling schema and algorithms used in WSN,

classified according to their packet priority assignment process.

In the next chapter, we will introduce in details our proposed energy based

scheduling schema.

Page 61: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

47

Chapter 4

Proposed Energy Based Scheduling Scheme

The key role of a scheduling algorithm in real-time communication

architecture is to schedule the incoming packets for forwarding. Traditional

FCFS scheduling does not work well in real-time applications because packets

have different remaining times to their deadlines, but also different distances to

reach their destination. In the context of sensor networks, packet scheduling

should be both deadline-aware and distance aware. Deadline-aware means that

a packet’s priority should relate to its deadline, the shorter the deadline, the

higher the packet priority. Distance aware means that a packet’s priority should

relate to its distance from the destination, the longer the distance, the higher the

packet priority.

The primary challenges here are how to prioritize and schedule packets.

Other challenge in real-time sensor network applications is how to carry out

sensor data dissemination given source-to-sink end-to-end deadlines when the

communication resources are scarce. In a sensor node, energy is consumed by

sensing, communication and data processing. More energy is required for data

communication than for sensing and data processing.

In this chapter, a new scheduling scheme that will not only prioritize packets

according to their deadlines but also according to their sizes, energy

consumption during transmission and energy path level. The new scheme

efficiently manages packet dropping at each node in order to avoid dropping

packets, which consumed high energy during transmission. Moreover, it does

not require any support from or changes to the lower layer protocols. In

addition, the new scheme can work with Ad hoc On Demand Distance Vector

(AODV) Routing Protocol.

Page 62: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

48

4.1 Main Idea of the Proposed SchemeEnergy usage in packet transmission is much greater than its usage in data

processing and sensing. Efficient usage of sensor's energy resources and

maximizing the network lifetime are the main design considerations for the

most proposed protocols and algorithms. However, depending on the type of

application, the generated data packets may differ in their energy

consumptions. This section, will introduce a new scheduling scheme called

Energy Based Scheduling Scheme

A. Energy Based Scheduling SchemeThe primary challenges of packet prioritizing according to deadline or

available time slack, is that it may lead to dropping high energy valuable

packets. Packets arriving from far sources may consume much energy.

Dropping these valuable energy packets may lead to shorten the network

lifetime. In addition, packet transmission path is a major issue that should be

considered in packet scheduling. Packet transmission decision should not only

be affected by the packet deadline, but also by packet energy consumption and

packet transmission path. Routing protocols are responsible for the path

selection. According to the selected path, packets are sent from source to

destination. During packet transmission, each node queues the packets to its

buffer. . Energy Based Scheduling Scheme schedules the buffered packets at

each node, according to specific parameters. This Scheme is the primary

contribution of this thesis.

4.2 Scheme ParametersThe proposed scheme depends on the fact, that energy usage in packet

transmission is so greater than its usage in data processing and sensing.

Scheduling schemes have the responsibility of whether to drop, delay or send

the packet according to some measures, form node queues. The problem is how

Page 63: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

49

to prioritize packets according to four constraints packet deadline, packet size,

packet energy consumption during transmission and packet energy path level.

According to this measure, we can find the path stability and strength that a

packet uses through its transmission from source to sink. The following

information is needed to schedule packets in the proposed scheme.

4.2.1 Packet DeadlineThis information is provided by the application in the data packet. It is

required by any real-time data communication application. According to this

information, each node might drop or delay the packet for a particular time.

When any packet reaches its deadline, the corresponding node, which is

holding that packet in its queue, must drop it.

4.2.2 Packet SizeIn WSN, there are two types of packets. They are control packets and data

packets. Control packets are used by the routing protocol for handling data

delivery. Data packets are the packets that are responsible for carrying the

required sensed data from a particular node to the destination. Control and data

packets contain reserved bits that will be used by our scheme. In the proposed

scheme, packet size might be used in prioritizing packets.

4.2.3 Packet Energy Path LevelIt is a new measure that is required by the proposed scheme. This energy

measure reflects the value of the energy nodes across a specific path.

According to this measure, we can find the path stability and strength that a

packet uses through its transmission from source to sink. This measure is

calculated at each node which a packet uses during transmission.

Page 64: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

50

4.2.4 Packet Energy Consumption during TransmissionDuring packet journey from source to destination, each node receives the

packet, buffers it and retransmits it to the destination or the next node close to

the destination. In the proposed scheme, Packet Energy Consumption during

Transmission is an important factor in prioritizing packets, as energy

consumption in packet transmission is so greater than its usage in data

processing and sensing.

4.3 Scheme EquationsBuffered packets at each are assigned sending priorities in a priority queue.

The priority queue holds the packets to be transmitted. In the proposed scheme,

each assigned priority is according to packet deadline, packet size, and packet

energy path level and packet energy consumption during transmission. These

four parameters have major effect on the network energy measures. These

measures might be the network life time or the energy consumption for the

goodput. Some other network measures might be affected when appling the

scheme. Through the next chapters, these measures are used in comparing the

proposed scheme against.

The following notations are used in the discussion.

PD: packet deadline

PS: packet size

PEP: packet energy path level

PEC: packet energy consumption during transmission

Subscript ‘i’ is often used with these parameters to indicate that they are for

a node i, while subscript ‘x’ is used to indicate that they are for a packet x.

For packet x, PEPx at node d, is calculated through the following equation:

Page 65: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

51

( ) = ∑ ( )∈ (4.1)

where:-

PEPx(d) is packet energy path level at node d for packet x

E(i) is the current energy for node i while receiving packet x

IEi is the initial energy for node i.

R denotes the set of nodes that packet x uses through

transmission from its source to node d. It shows the path strength

and stability according to the energy of each node.

To calculate the PECx for packet x at node d, we use the following equation:

( ) = ∑ ( )+ ∑ ( )∈∈ (4.2)

where:-

PECx(d) is the packet energy consumption during

transmission of packet x at node d

ETx is the energy transmission cost for packet x

ERx is the energy cost for packet x reception.

RTx and RRx are set of nodes used for transmission and

reception respectively.

So, the problem is simplified to find a suitable priority for each packet

during its transmission. This priority should consider packet deadline, packet

size, and packet energy path level and packet energy consumption during

transmission. According to this priority, any packet buffered in a queue, could

be sent or delayed. Therefore, the equation used for packet priority calculation

in our scheme should reflect the effect of its related parameters. In order to

apply the proposed scheme, the maximum packet size and deadline values,

Page 66: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

52

used by the network, are required. These values are used to normalize the

packet size and deadline.

The following equation is used to calculate the packet sending priorities

(PSP) for each packet x at each node d in:

( ) = × ( )( )× . (4.3)

Where:-

PSPx(d) is the packet sending priorities of packet x at node d

PECx(d) is the packet energy consumption during transmission of

packet x at node d

PEPx(d) is packet energy path level at node d for packet x

α is a constant factor for insurance that the packet deadline would

be met

Nx represents the number of nodes, which packet x used

PSN and PDN are the normalized values for packet size and

deadline.

According to PSP value, each node would decide whether to send the packet

at once or delay it. This scheme would help in increasing the network lifetime

for the remote node of the networks. Packets from remote nodes would have

increasing sending priorities through their path to the destination. We use PEP

in order to overcome the problem of higher sending priorities for packets from

remote nodes.

During the packet trip from its source to destination, it is buffered in every

node queue across its path. Each node carries the responsibility of calculating

the PSP for each packet in its buffer. In order to get the value of PSP for each

packet, we modify the packet header by adding new header parameters to it.

These parameters will be the values of PEP, PEC and the number of visited

Page 67: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

53

nodes without the current node. Using these parameters, each node will be able

to calculate PSP for each packet in its queue. Before packet transmission, the

node transmitting the packet must update the new added parameters in the

packet header.

4.4 Priority QueueManaging limited resources such as bandwidth on a transmission line can be

done through Priority queuing. The output of energy based scheduling scheme

is the queuing of packets, which is assigned sending priorities. This queue is

used by the routing protocol to decide which packet to retransmit according to

the assigned priority (by passing it to the MAC layer). A single priority queue

for packet forwarding based on the computed target transmission time is used

by the energy based scheduling scheme. When the queue is full, the scheme

selects the packet at the head of the queue to immediately forward it instead of

dropping any packet in the queue.

If there was no heavy traffic through the current node and priority queue is

not almost full, the energy based scheduling scheme is not needed. The

proposed scheme can be disabled and packets are forwarded normally.

A single priority queue is used in the routing layer for forwarding packets. It

can better track the priority of data packets than the approach of several FIFO

queues with different priority levels.

4.5 Integration with routing protocolsIn this section, we will show how to integrate the proposed scheme with the

Ad hoc On Demand Distance Vector routing algorithm. AODV don’t have any

effect on the sending priorities, as they are assigned by the proposed scheme.

Page 68: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

54

4.5.1 Energy Based Scheduling Scheme for AODVThe Ad hoc On Demand Distance Vector (AODV) routing algorithm is a

routing protocol designed for wireless mobile networks. It is selected as the

baseline routing protocol because it is an on-demand protocol without global

periodic routing advertisement. Besides, it consumes less overall network

bandwidth as the network is silent until a connection is needed. It creates no

extra traffic for communication along existing links [47]. AODV achieves

comparable results when it is used in wireless sensor networks and compared

with the common WSN routing protocols [60,61]. In [62 - 64] several updates

are applied to the AODV in order to make it applicable to be used in WSN.

4.5.1.1 Ad hoc On Demand Distance Vector (AODV) Routing

Protocol

The AODV was mentioned in chapter 2. Being a reactive routing algorithm,

AODV only maintains the routing paths which are used in packet transit. It is

considered a destination based reactive protocol, which avoids routing loops by

using of sequence numbers. In this protocol, the nodes use the sequence

numbers to avoid loops and take the path information as updated as possible.

When a source node wants to transmit information to a destination node, a

short route request (RREQ) message will be initiated and broadcast by the

source, with an estimated and pre-defined lifetime (TTL). RREQ is rebroadcast

until the TTL reaches zero or a valid route is detected. Each node, receiving the

RREQ will add a valid route entry in its routing table to reach the RREQ

source, called reverse route formation. When the RREQ reaches the destination

or a node that has a valid route to the destination, a route reply (RREP)

message is uni-cast by this node to the source. The RREP message will go to

the source, following the reverse route formed by the RREQ [47].

Page 69: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

55

4.5.1.2 Scheme Implementation for AODVIn order to apply our scheme on AODV, the energy for each node in

transmission path and the energy consumption during transmission should be

assigned to packet, which used that path. For AODV, there are four types of

packets, which are used for routing and path discovery. They are Route

Request (RREQ), Route Reply (RREP), Route Error (RERR) and Route Reply

Acknowledgment (RREP-ACK). According to [11], each packet has a number

of unused bits, called reserved bits. The number of unused bits in each packet

is shown in Table 4.1. Our proposed scheme works on making use of these

unused bits to store the PEP and PEC for each packet, in order to use them in

calculations. Figure 4.1 shows how the proposed scheduling scheme reacts

with the different components of the WSN.

4.6 WSN Application adaptation

As we mention in section 2.3, WSN applications differs in its requirements

from one application to another. These differences are according to application

nature or usage. Some WSN applications, which are used in Battlefield

Monitoring in military applications, might need to have a better network life

time. In addition, deploying sensors in a battlefield to monitor the presence of

forces and vehicles, and track their movements, enabling close surveillance of

opposing forces, would make replacing low battery nodes, so hard and

Table 4.1: amount of reserved bits (unused bits)

AODV packet type Number of unused bits

RREQ 11

RREP 9

RERR 15

RREP-ACK 8

Page 70: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

56

dangerous. So, the calculated packet sending priorities (PSP) could be

compared to a threshold. According to this threshold, each node can take the

decision of whether buffering the packet for a period of time or immediately

forward it, regarding the energy packet consumption.

Figure 4.1 Scheduling Scheme in WSN architecture

According to Figure 4.2, we could find that low threshold packets with low

energy consumption have the same chance as packets with high energy

consumption and high threshold. However, high threshold value would give

packets with high energy consumption much better chance in retransmission

than other packets. The proposed scheme by default could assign sending

probability to packets depending on the consumed energy for each packet.

Sometimes, WSN application might require high threshold value in order allow

Data

Routing Agent

MAC Layer

Application Differentiator

Scheduling Scheme

DeadlineEnergy PathLevelData

Data SendingPriority Data

Page 71: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

57

packets of high energy consumption to have much better sending probability.

The use of the threshold value and its effect on network lifetime and packet

delivery ratio would be disused in the next chapter.

4.7 Properties of proposed Energy Based Scheduling Scheme

The proposed scheme has some important features and properties that

differs it from other scheduling algorithms. These features and properties give

our scheme advantages in the energy and lifetime fields. In this section, we will

show the features of our scheme.

4.7.1 Routing protocol independentThe main advantage of the Energy Based scheduling scheme is the routing

protocol independency. The scheme can work with any routing protocol. The

required parameters for the scheduling scheme can be calculated easily at any

node, without any support from the routing protocol or the MAC layer.

However, a trade off might appear if the used routing protocol does not have

Figure 4.2: Packet Energy consumption vs. the threshold

Sending Priority

Threshold

Pack

et E

nerg

y co

nsum

ptio

n

Page 72: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

58

reserved bits in the used packets. Moreover, additional bits to any packet

format might lead to an increase in the networks energy.

4.7.2 MAC layer protocol independentUnlike the JiTS, the Energy based scheduling scheme does not require

MAC layer support for prioritized scheduling. This makes Energy based

scheduling scheme readily deployable on existing infrastructure. The Energy

based scheduling does not require MAC layer support for prioritized

scheduling or for tracking delay.

4.7.3 Energy awareThe important feature of the proposed scheme is its energy awareness. Any

priority assigned or packet dropped or retransmitted, is done according to some

energy measures. This way in taking decisions helps in increasing the network

life time and decreasing the energy consumption for the goodput.

4.7.4 QoS awareMinimizing the packet loss ratio is an important factor in the proposed

scheme. Moreover, decreasing the packet loss should be achieved with an

increase in the network lifetime and the energy consumption for the goodput.

4.8 Overall Proposed SchemeIn this section, we will show in steps how the proposed energy based

scheme works when a packet is queued in the queue of a node in WSN. When

a packet is buffered in the nodes the following should be done by the proposed

scheme:-

If the packet is buffered in its source node

1. The current node energy is normalized according to the node

initial energy and stored in the node header.

Page 73: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

59

2. The amount energy consumed by node for send a packet is

normalized according to current nodes energy and stored in the

packet header.

If the packet is buffered in an intermediate node

1. The current node extracts the values of the previous node(s)

energy and the amount of energy consumed by the node during it

journey.

2. The node adds the value of the current node energy after

normalization to the extracted energy value.

3. The PEP is calculated for this packet according to equation (4.1)

4. The node adds the value of the amount energy consumption after

normalization to other extracted energy values

5. The PEC is calculated for this packet according to equation (4.2).

6. The PSP is calculated according to equation (4.3)

7. According to the value of PSP, the decision of whether to send or

delay a packet in the queue is taken.

4.9 SummaryIn this chapter, we have presented the proposed energy based scheduling

scheme and its integration with the AODV.

The chapter starts with brief introduction of the effect of the energy on

WSN which followed by introducing the proposed scheduling energy based

scheme. Then, we present equations used in our scheme in order to calculate

the packet sending probability for every packet.

Next, we show how to integrate the proposed energy based scheme with

AODV routing protocol. Then, we present the steps used in calculating packet

send probability.

The next chapter will show how our scheduling scheme integrated with

AODV, works in WSN. Also, we will compare it with other routing protocols

Page 74: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

60

Chapter 5

Simulation of the Scheme and Results

The primary goal of the research is to develop a scheduling scheme, which

fulfills the demands for minimizing the energy consumption and maximizing

the WSN life time. A great attention should be paid for the QoS and fairness

while achieving these demands. The previous chapter presented the proposed

energy based scheduling scheme in wireless sensor networks. It shows the

mathematical equations, which are used in the proposed scheme in assigning

send priorities to data and control packets. In this chapter, a comparison is done

between the proposed scheme and the Basic priority scheme.

Simulation is the most deployed method to evaluate algorithms and

protocols for WSNs. It enables the researcher to deal with complex topologies,

network scalability, and repeating of experiments. Simulations are also carried

out at low cost, for these reasons simulation gains a lot of popularity as

evaluation method. In the simulation, NS2 was used as the network simulator.

The proposed scheme would be compared according to some network metrics.

This chapter introduces the evaluation and comparison of the proposed

energy scheme against the Basic priority scheme using simulations. The

comparison is done against the normal AODV, DSR and DSDV.

5.1 The Network Simulator (NS-2)The Network Simulator (NS-2) was used as simulation software to

accomplish the performance evaluation in this thesis. NS-2 is a discrete-event

simulator, which can be obtained as public domain software. Currently, it is

widely used in all kinds of network research areas such as, LAN, Internet and

wireless sensor network. It is free and open source software that makes NS very

popular and is used in several research projects [67].

Page 75: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

61

NS-2 is an object oriented simulator developed as part of the VINT project

at the University of California in Berkeley. The project is funded by DARPA in

collaboration with XEROX Palo Alto Research Center (PARC) and Lawrence

Berkeley National Laboratory (LBNL). Ns-2 is extensively used by the

networking research community. It provides substantial support for simulation

of TCP, routing, multicast protocols over wired and wireless (local and

satellite) networks, etc.

5.1.1 Why Network Simulator (NS-2)?Several extensions for NS-2 can be obtained from researchers worldwide. It

provides many useful tools such as NAM, trace file and TCL. In addition, many

protocols have already been implemented in this simulator for example, TCP,

UDP, many routing algorithms, multicast protocols and IEEE 802.1 1 DCF.

Therefore, it can concentrate on implementing and studying our scheduling

scheme.

NS-2 is written in both C++ and OTcl programming languages. The Code in

C++ is used for data path and in OTcl for control path. OTcl is an object

oriented language, which is an extension to the scripting language Tcl. OTcl is

an easy to use language that can be used to have rapid application development.

The OTcl linkage matches an OTcl object for one of the C++ objects to enable

the control of C++ objects to C++. NS-2 has also C++ objects, which operate

without the need of OTcl control. The simulator has modules that are

completely implemented in OTcl and are not in C++. NS-2 is controlled by

utilizing of user simulation scripts, which are written in OTcl [68].

The OTcl script maintains the main characteristics of the case study to be

simulated. An OTcl interpreter is used to set up the simulation configurations

and controls of C++ data path. NS-2 was firstly focused on wired networks and

later was extended to wireless and mobile hosts. Also, users can use NAM

which is a Tcl/TK based animation tool to observe network simulation. It

Page 76: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

62

provides network topology layout, packet transmission animation, and various

data inspection tools [68].

The simulation process of a protocol is achieved through the simulation

scripts in OTcl. Otherwise, the user needs to implement the protocol firstly in

C++. User can then simulate the protocol using simulation scripts written in

OTcl. The OTcl script maintains the main characteristics of the case study to be

simulated. An OTcl interpreter is used to set up the simulation configuration

and controls of C++ data path. As mentioned before, NS-2 was firstly focused

on wired networks and later was extended to wireless and mobile hosts.

5.1.2 Node Architecture in Network Simulator-2In NS-2, network physical activities are translated to events. Events are

queued and processed in the order of their scheduled occurrences. And the

simulation time progresses with the events processed. And also the simulation

“time” may not be the real lifetime as we “inputted”. It can configure transport

layer protocols, routing protocols, interface queues, and also link layer

mechanisms. We can easily see that this software tool in fact could provide us a

whole view of the network construction, meanwhile, it also maintain the

flexibility for us to decide. Thus, just this one software can help in simulating

nearly all parts of the network. This definitely will save us great amount of cost

invested on network constructing.

This thesis focuses on the implementation of IFq module and prioritized

MAC module. In this section, we mainly discuss the implementation of IFq

module. It is known that IFq module provides a buffer and a scheduling

algorithm. Therefore, one of our main tasks is to implement our proposed

algorithms to replace the original IFq algorithm. The architecture of the NS-2

MAC layer has been changed as shown in Figure 5.1. In this chart, the energy

based scheduling scheme is between the LL module and the MAC module. It

accepts packets from the LL module and selects a packet in terms of its

Page 77: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

63

scheduling algorithm. Then it transmits packets to the MAC module. The real-

time scheduling module contains the implementation.

Figure 5.1: architecture of the WSN node in NS-2

5.1.3 Simulation Process StepsIn order to evaluate, compare and study the effect and behavior of our

scheme, simulation is done against the Basic priority Scheme. Each time a

simulation is run the following steps are done.

1. Traffic pattern is generated by Matlab. These patterns connectivity of

sources in the OTcl script.

2. The user programs senario to be simulated with OTcl. This includes

event scheduler initiation, set up of network topology, starting and

ending of packet transmitting, setting values of corresponding data,

event log and visualization set up.

3. The Network Simulator executes the OTcl script.

Page 78: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

64

4. After executing of the OTcl script, the results are taken in form of trace

files. Each line in a trace file contains a packet event. It is very helpful

that tracing in NS-2 can be done at MAC level and at routing level. The

network simulator supports two trace formats that are called old and new

trace format. The new trace format is designed for the wireless traces.

The generated trace files are then analyzed by utilizing of scripts written

in a scripting language as AWK. NS-2 includes the NAM tool, which

enables the visualization of packets exchange.

5.1.4 The Simulation ScriptsSimulation scripts are the input to the network simulator, which include all

the information related to the simulation case study. The script begins usually

with the configuration of the simulation components of the network such as the

topography, the queues, the MAC protocol, the routing protocol and the

wireless channel.

The instructions to create the trace files are included in the simulation script.

The configuration of the mobile nodes is done and that is followed by the

creation of the nodes. The next part in the simulation script is to define the

initial positions of the nodes followed by definition of the mobility pattern of

the node.

5.2 The Hardware used in the SimulationAll simulation and programming works in this thesis were performed in

Window Server 2003 Enterprise Edition service pack 2 using the compiler gcc

2.9.6. All experiments were running on Dell PowerEdge 2800 tower server

with Intel Xeon CPU 3.40 GHz and 4 GB of RAM.

The simulation of wireless communication using NS-2 is a very time

consuming process. The execution of one simulation may take more than 10

hours. This simulation duration is increased by the increasing the traffic and

network simulation time. The NS-2 output trace files which requires a big

Page 79: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

65

memory space for storage. Some of the trace files have sizes of several giga

bytes. Appendix B will show the format of the trace files and the code required

for analyzing and processing the large size trace files.

5.3 Simulations Parameters and environmentIn our simulation, some parameters will be constant across all the

simulation, in order to have a clear view of the effect of the proposed scheme.

These parameters are shown in table 5.1. 100 sensor nodes are randomly

deployed in a square area in different scenarios to simulate our scheme [69].

The source and destination of traffic flows (CBR) are randomly selected as

well. All traffics are periodic of CBR type, with a constant packet size of 32

Byte. The physical and MAC layer parameters were set as in table 5.1 [69].

Table 5.1: Simulation Parameters

Mac layer Protocol IEEE 802.11

Transmission Radio Range 250 Meter

Data Packet Size 32 Byte

Data Rate 2 packet/sec

Simulation Area 1000 Meter X 1000 Meter

Number of Sensor nodes 100

Node Initial Energy 100 Joule

Transmission Power 0.024 Joule

Reception Power 0.0135 Joule

Figure 5.2 shows the network structure used in our simulations. The sink

node is placed roughly at the center of the network. Nodes publish data at the

Page 80: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

66

rate of 2 packets per second in order to simulate a fairly high load traffic

scenario. In this thesis, the proposed scheme is compared with the basic priority

scheduling. All nodes in the WSN have a queue size of 50. Figure 5.2 shows

three random deployments of 100 sensor nodes in a 1000 × 1000 m2 areas.

Figure 5.2a The position of the sink node in the simulated WSN

Page 81: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

67

Figure 5.2b The position of the sink node in the simulated WSN

5.4 The Simulations MetricsThe metrics measured in simulations, in order to compare the proposed

scheme against the Basic priority scheme. They are average end to end delay,

drop ratio, fairness index, average network lifetime and average energy

consumption fair received packets.

5.4.1 Average End to End Delay

Average end to end delay is defined as the delay of the successfully

transmitted packet from the source to the destination. This metric includes

queuing delay, retransmissions delays at MAC layer, propagation delay and

packet transfers times. It is an important factor to judge the effectiveness of a

network protocol. Equation 5.1 is calculated as follows.

= ∑ ( ) (5.1)

Page 82: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

68

5.4.2 Drop Ratio

The Drop ratio metric is defined as the number of unsuccessful received

packets during a specific time. It is another metric of throughput effectiveness

of a protocol. Equation 5.2 is used to calculate the drop ratio.

= (5.2)

5.4.3 Fairness Index

The fairness index is a measure used in network engineering in order to

determine whether users or applications are receiving a fair share of system

resources. Equation (5.3) is used to calculate the fairness index [70].

= ∑∑ (5.3)

Where:-

n represents the total number of sending nodes

x represent the throughput of every node.

5.4.4 Average Network lifetime

Wireless senor network lifetime is one of the most important constraints for

the network. Most, of routing, scheduling and MAC protocols focus on the

constraint. It is measured as the amount of time network spends until most of

its nodes are down.

5.4.5 Average Energy consumption for received packets

Energy consumption is another important constraint WSN. It is defined as

the average energy consumed by the whole network in order to deliver control

and data packets to the destination.

Page 83: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

69

Average energy consumption for received packets = Total Energy consumption by whole networkNumber of sussefuly received packets(5.4)

5.5 Simulation ResultsIn order to find the efficiency of our scheme, we compare it with the Basic

Priority Scheduling. This comparison is done against the AODV, DSR and

DSDV. Comparisons will be according to the previous mentioned simulation

metrics. After that, we show the effect of applying the threshold value on the

proposed and scheme and compare it to the Basic Priority Scheduling Scheme.

In all simulation, the energy based scheduling scheme is integrated with the

AODV (EB-AODV), as mentioned in the previous chapter. The sections show

the comparison of the EB-AODV against the AODV, DSR and DSDV.

5.5.1 Proposed scheme against AODV

In the following section, we will compare the proposed energy based

scheme with the AODV against the basic priority with AODV.

5.5.1.1 Network lifetimeThe WSN lifetime has increased because our scheme works on avoiding

dropping packets with high energy usage. This means that, remote nodes from

the sink will not have to retransmit the dropped packets. Because our scheme

avoids dropping packets with high energy consumption during transmission,

network lifetime has increased. Figure 5.3 shows how our proposed scheme

extends the network lifetime. Network lifetime was extended by 3%. As packet

size affects the sending priority, dropping small packets which consumes low

amount of energy, helps in saving network energy.

Page 84: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

70

Figure 5.3 Network average Energy Level across Network lifetime

5.5.1.2 Energy consumption and delivery ratioFrom Figure 5.4, it is found that the Energy Based Scheme achieves a better

packet delivery ratio value than the Basic Priority Scheduling. Through the

WSN energy consumption, the Energy Based Scheme makes an efficient usage

of the batteries attached to each node in the WSN. It increases the packet

delivery ratio by giving the packets, which consumes more energy, higher

sending priorities. Packets whose energy transmission path level (PEP) is low,

are prioritized with high sending priority. As shown in Figure 5.4, the Basic

Priority Scheduling achieves better delivery ratio at network energy level of

60%. This happens, because of the greedy nature of the propsed scheme.

Sometimes, remote data packets might take the higher priority through its

journey to the destination. This might affect data packets from sink closed

0

10

20

30

40

50

60

70

80

90

1000 3000 5000 7000 7300 7500

Ener

gy C

onsu

mpt

ion

(%)

Net work Lifetime (sec)

Basic Piriorty Scheduling Energy Based Scheduling

Page 85: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

71

nodes. The Energy Based Scheme works on achieving better packet delivery

ratio than the Basic Priority Scheduling. In the Energy Based Scheme, both

control and data packets have the treatment. They get their sending priorities

according to the energy consumption of each one of them.

Figure 5.4 Network Energy consumption vs. Packet Delivery Ratio

The greedy nature of the Energy Based Scheme is considered a normal

behavior. Most of the packets, which consume more energy in transmission, are

remote source packets. This means, that remote data packets have a great

chance to get high sending priority than the other packets. In order to know

how this greedy nature affects the WSN, we measure the fairness of the Energy

Based Scheme and compare it to the fairness of the Basic Priority Scheduling.

92.5

93

93.5

94

94.5

95

10 20 30 40 50 60 70 80 90 100

Deliv

ary

Ratio

(%)

Energy Consumption (%)

Basic Priority Scheduling Energy Based Schema

Page 86: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

72

5.5.1.3 Fairness IndexFigure 5.5, shows how the Basic Priority Scheduling with AODV

overcomes the proposed scheduling scheme in the fairness. In the Basic Priority

scheme, packets are assigned sending priorities only according to their type.

Assigning priorities to packets according to their types, helps in achieving

better fairness among all the WSN nodes. Sending priorities assigned to packets

from remote nodes are affected by the energy used to deliver the packets, the

energy path level and packet size. Although, these parameters are considered

in priority calculations for each packet, the fairness is affected. The fairness of

the Energy Based Scheme is affected because remote nodes have better chance

to deliver their packets. Besides, there are no weights in calculating the sending

priorities.

5.5.2 Proposed scheme against DSDVEnergy and power management are the main constraints that affects wireless

sensor networks lifetime. These constraints have this sort of importance due to

the nature and effect of WSN. Mainly, most of energy consumption is due to

the packet transmission and reception. In this section, we compare the energy

based scheduling scheme with AODV against the DSDV routing protocol. As,

DSDV is a proactive table driven routing protocol, routing information must be

updated periodically. This leads to overuse of the network energy and a

decrease in its lifetime.

Page 87: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

73

Figure 5.5 Fairness Index

5.5.2.1 Network lifetimeFigure 5.6 shows how the energy based scheduling scheme increases the

WSN lifetime. It achieves better network lifetime than the DSDV. As, AODV

is a reactive routing protocol (it establishes a route to a destination only on

demand), the energy consumption for transmission and reception is quite less

than in DSDV. Network lifetime was extended by 8%. In addition to that, the

energy based scheduling scheme maintains each operation done for

transmission or reception according to the energy consumption, Packet Energy

Path Level, packet size and deadline.

0.86

0.87

0.88

0.89

0.9

0.91

0.92

0.93

0.94

0.95

10 20 30 40 50 60 70 80 90 100

Fairn

ess I

ndex

Energy Consumption (%)

Basic Priority Scheduling Energy Based Schema

Page 88: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

74

Figure 5.6 Network average Energy Level across Network lifetime

5.5.2.2 Energy consumption and delivery ratioIn Figure 5.7, we find that the energy based scheduling scheme achieves a

better ratio delivery ratio. Besides, the proposed scheme consumes less energy

during the network lifetime in order to achieve better throughput. Although the

proposed scheme suffers from its greedy nature, which may affect the delivery

ratio, the proactivity nature of the DSDV plays an effective role in the energy

consumption for the goodput packets. The overall packet delivery ratio of our

proposed scheme under the AODV is better than the Basic Priority Scheme

under the DSDV routing protocol.

0

10

20

30

40

50

60

70

80

90

1000 3000 5000 7000 7300 7500

Ener

gy C

onsu

mpt

ion

(%)

seconds

Basic Piriorty Scheduling (DSDV) Energy Based Scheduling

Page 89: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

75

Figure 5.7 Avearage Network Energy consumption vs. Packet Delivery Ratio in DSDV

5.5.2.3 Fairness IndexAs it is mentioned before, the fairness index is an important factor in

evaluation of any scheduling or routing protocol. In the study, this measure is

used to know the nature of the energy based scheduling scheme against the

DSDV routing protocol. Figure 5.8 shows how the DSDV achieves better and

greater fairness index value than in the proposed scheme. DSDV achieves

better fairness index during the network lifetime, while the energy based

scheduling scheme suffers the fairness problem. This problem is due to the

greedy nature of the proposed scheme. In DSDV, packets of the same type and

nodes, regardless their position or distance from the sink node, are treated by

equally. While in the proposed scheme, there is no equality in packet treatment.

89

90

91

92

93

94

95

10 20 30 40 50 60 70 80 90 100

Deliv

ary

Ratio

(%)

Energy Consumption (%)

Basic Priority Scheduling (DSDV) Energy Based Schema

Page 90: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

76

Fig. 5.8 Fairness Index of DSDV vs. the AODV with proposed scheme

5.5.3 Proposed scheme against DSRDSR routing protocol is another protocol which is compared with the

proposed scheme with. In practical, the DSR is so closed to the AODV in the

way that forms a route on-demand when a transmitting computer requests one.

However, it uses source routing instead of relying on the routing table at each

intermediate device.

5.5.3.1 Network lifetimeIn Figure 5.9, it is found how the proposed scheme still archives better

overall network lifetime. Network lifetime was extended by 3%. The basic

priority scheduling with the DSR works on assigning equally sending priorities

to control packets then data packets, regardless how much energy is consumed

0.84

0.86

0.88

0.9

0.92

0.94

0.96

0.98

10 20 30 40 50 60 70 80 90 100

Fairn

ess I

ndex

Energy Consumption (%)

Basic Priority Scheduling(DSDV) Energy Based Schema

Page 91: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

77

by each of them. This way in treatment may lead to dropping high energy

consumption packets or packets from low energy path level.

Figure 5.9: Network average Energy Level across Network lifetime

5.5.3.2 Energy consumption and delivery ratioAs, DSR is an on demand routing protocol, the average energy consumption

for the goodput has lower value than in DSDV. However, the average energy

consumptions for the proposed scheduling scheme is still better than in DSR.

They happen due to the action of the Basic priority scheduling Scheme in DSR.

Packets may face the chance of being dropping, whatever how much energy

they have consumed, or how energy strength is the path that any packet has

used in its journey to the destination. This way in packet treatment leads to an

increase in the average energy consumption for the throughput. Figure 5.10

0

10

20

30

40

50

60

70

80

90

1000 3000 5000 7000 7300 7500

Ener

gy C

onsu

mpt

ion

(%)

seconds

Basic Piriorty Scheduling (DSR) Energy Based Scheduling

Page 92: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

78

shows how the energy based scheduling scheme with AODV still overcomes

the Basic priority scheme with DSR. The proposed scheme still achieves better

overall packet delivery ratio than in DSR. In the Basic priority scheme with

DSR, packets treatment is according to the type only. Control packets might

have better sending position in the buffering queue at each node than the data

packets. While in the energy based scheduling scheme with AODV, packets

whose energy transmission path level (PEP) is low, are prioritized with high

sending priority.

Figure 5.10 Average Network Energy consumption vs. Packet Delivery Ratio in DSR

5.5.3.3 Fairness IndexFigure 5.11 shows how the Basic scheduling scheme with DSR overcomes

the proposed energy based scheduling scheme integrated with AODV in

91

91.5

92

92.5

93

93.5

94

94.5

95

10 20 30 40 50 60 70 80 90 100

Deliv

ary

Ratio

(%)

Energy Consumption (%)

Basic Priority Scheduling (DSR) Energy Based Schema

Page 93: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

79

fairness. Sending nodes, when applying the Basic Priority scheme DSR have a

fair treatment of their packets. However, this fairness in the treatment of

packets, in most cases, may lead to an excessive decrease in the fairness in

index. Some sending nodes might be far from the sink node. Moreover, the

packet energy path level and packet energy consumption during transmission

plays an important role in assigning sending probabilities to each packet in the

queue.

Fig. 5.11 Fairness Index of DSDV vs. the AODV with proposed scheme

5.6 Energy Based Scheduling Scheme with ThresholdFairness is an important factor when applying and comparing any scheme.

Although, the fairness index values does not reflect the level of QoS, which

achieved in the network. However, some WSNs applications might require a

0.84

0.86

0.88

0.9

0.92

0.94

0.96

0.98

10 20 30 40 50 60 70 80 90 100

Fair

ness

Inde

x

Energy Consumption (%)

Basic Priority Scheduling(DSR) Energy Based Schema

Page 94: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

80

high value in fairness index. As, the energy based scheduling scheme suffers a

massive decrease in the fairness when comparing with the Basic Priority

scheduling scheme, a new method in calculating the sending priority for each

packets is used. This way is to use a threshold value.

The threshold is a value used by the Energy Based Scheduling Scheme in

order to increase the fairness index value. Each packet sending priority is

compared to this value. When the PSP exceeds the threshold value, it becomes

equal to 1. Otherwise, the PSP values do not change. Applying this threshold

would help in maximizing the fairness index of the proposed scheme. As,

packets from remote nodes would have the same sending probability like

packets from close nodes.

Figure 5.13 shows how the effect of the distance on the packets dropping

probability. Transmitted packets from remote nodes have lower dropping

probability than other packets from close to sink nodes. Therefore, the

proposed scheduling scheme decreases the fairness index of the entire network.

In order to apply fair treatment to any packets, regardless the location or

nearness of its source, the threshold value should be carefully chosen. The

value of the threshold and how it would be applicable to the used application

could be a future work for the thesis.

Page 95: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

81

Fig. 5.12 Fairness Index the Energy Based Scheduling Scheme before and afterapplying the threshold

Fig. 5.13 Dropping Probability vs. the distance from the sink node

0.86

0.87

0.88

0.89

0.9

0.91

0.92

0.93

0.94

0.95

0.96

10 20 30 40 50 60 70 80 90 100

Fair

ness

Ind

ex

Energy Consumption (%)

Energy Based Schema with Therashold Energy Based Schema

0

0.05

0.1

0.15

0.2

0.25

10 20 30 40 50

Dro

ppin

g Pr

obab

ility

Distance to the Sink Noes in Meters

Basic Priority Scheduling Energy Based Schema

Page 96: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

82

5.7 SummaryThis chapter have presented comparisons between the proposed scheduling

energy based schemes integrated with AODV against other the Basic priority

scheduling scheme with DSR and DSDV. These comparisons were according

to network lifetime, amount of energy consumption for the throughput and the

fairness index.

Next, it was shown how to overcome the problem of the fairness. This is

done applying a threshold value to proposed scheduling scheme.

The next chapter will be the conclusion and future works of this research.

Page 97: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

83

Chapter 6

Conclusion and Future Work

The aim of this research and thesis is to develop a new scheduling scheme for

wireless sensor networks. Through this thesis, we have a brief overview on the

wireless sensor networks architecture, applications, protocols layers and

challenges. After that we discuss the prevouis scheduling scheme and show

how they work. Then, we introduce our proposed energy based scheduling

scheme and show how its integration with the AODV routing protocol. This

scheme has the ability to schedule packets according to their deadlines and

energy consumption. The proposed scheme takes into account the packet

deadlines, size, energy path level and the energy consumption for each packet

during its journey from the source to the sink. After that, a comparison was

done between the proposed energy based scheduling scheme against the basic

priority scheduling scheme.

6.1 ConclusionMany researches have proposed different solutions. These solutions deal

with routing protocols, data packet prioritization, and real-time scheduling.

Most of these solutions prioritize packets at the MAC layer according to their

deadlines and distances to the sink. Packet prioritization by itself cannot

completely support real-time data communication requirements. The scheme

was implemented in NS-2, which is widely used open source software.

In this work, Energy Based Scheduling Scheme with AODV routing

protocol was developed. In this scheme, packets are not only scheduled

according to their deadlines or first in first out. The experimental and

simulation results showed how the proposed scheduling scheme can increase

Page 98: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

84

the overall network lifetime. Moreover, it can decrease the average energy

consumption for each transmitted packets. Dropping a packet which consumed

high energy during its transmission or a packet arrived from a low energy path

level would lead to a great loss in the overall energy of the network. So, the

proposed scheme works on preventing this behavior by considering the energy

consumption and energy path level in assigning sending probabilities.

However, the fairness index problem rises as a problem for the proposed

scheme. Packets from nodes near to the sink may face the probability of

assigning low sending priorities to them. In order to overcome this problem, we

introduce a threshold idea to be integrated with the proposed scheme. The

threshold works on increasing the fairness index.

The energy based scheduling scheme is integrated with the AODV routing

protocol. It works on the unused bits in the packet headers. Moreover, the

proposed energy based scheduling scheme does not require any support from

the MAC layer.

6.2 Future WorksMany challenges still remain in wireless sensor networks. A lot of research

is ongoing in the field of routing and scheduling. The following could be

considered as future work for this thesis:-

1. Adapting the energy based scheduling scheme to work in WSN with

mobile nodes will be the next step in this research.

2. It would be also an interesting idea if the proposed scheme is

integrated with the other routing protocol such as, Low-energy

adaptive clustering hierarchy.

3. The threshold value and its suitable value for WSN application could

be an interest future work.

4. An idle detection mechanism may be employed such that if an idle

period passes without packet transmission, the head of the queue is

sent immediately.

Page 99: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

85

5. The proposed scheme could be integrated with the other routing

protocols like Dynamic Source Routing or Destination-Sequenced

Distance Vector routing.

6. An update would be applied on the proposed scheme in order to

overcome the fairness problem.

Page 100: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

86

Outcome From the thesis

N. E. Mahmoud, M. H. N. Taha, H. N. Elmahdy, and I. A. Saroit, "A SecureEnergy Mechanism for WSN and Its Implementation in NS-2", CiiTInternational Journal of Wireless Communication, vol. 4, issue 16, pp. 984-990, 2012.

M. H. N. Taha , N. E. Mahmoud, H. N. Elmahdy, and I. A. Saroit, "EnergyBased Scheduling Scheme for Wireless Sensor Networks", CiiT InternationalJournal of Wireless Communication, vol. 4, issue 16, pp. 973-975, 2012.

Page 101: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

87

References

[1] Chee-Yee Chong and Srikanta P. Kumar, “Sensor Networks: Evolution,

Opportunities and Challenges”. Proceeding of the IEEE, vol. 91, no. 8,

Aug. 2003.

[2] P. Berman, G. Calinescu, C. Shah and A. Zelikovsky, “Power Efficient

Monitoring Management in Sensor Networks,” IEEE Wireless

Communication and Networking Conference (WCNC'04), pp. 2329-

2334, Atlanta, March 2004.

[3] H. Chan, A. Perrig and D. Song, “Random key Predistribution Schemes

for Sensor Networks,” proceeding of IEEE Symposium on Security and

Privacy (S&P 2003), pp. 197 - 213, Berkeley, CA, USA, May 2003.

[4] D. Brinza and A. Zelikovsky, “DEEPS: Deterministic Energy-Efficient

Protocol for Sensor Networks,” ACIS International Workshop on Self-

Assembling Wireless Networks (SAWN'06), Proc. of SNPD, pp. 261-

266, 2006.

[5] J. Yick, B. Mukherjee, and D. Ghosal, “Wireless Sensor Network

Survey,” Computer Networks, vol. 52, no. 12, pp. 2292-2330, August

2008.

[6] A. M. Khedr and H. Ramadan, “Effective Sensor Relocation Technique

in Mobile Sensor Networks,” International Journal of Computer

Networks & Communications, vol. 3, no. 1, pp. 204-217, 2011.

[7] Z. Hu and B. Li, “Fundamental Performance Limits Of Wireless Sensor

Networks,” IEEE Journal on Selected Areas in Communications - JSAC

, vol. 22, no. 6, pp. 961-965, 2004.

[8] K. Mekkaoui and A. Rahmoun, “Short-Hops vs. Long-Hops - Energy

Efficiency Analysis in Wireless Sensor Networks,” Proc. CIIA, 2011.

[9] X. Zhong and C. Xu. “Delay-Constrained Energy-Efficient Wireless

Packet Scheduling with QoS Guarantees,” IEEE Transactions on

Page 102: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

88

Mobile Computing, vol. 6, no. 10, pp. 1158-1170, October 2007.

[10] M. Cardei, and J. Wu, “Energy-Efficient Coverage Problems in

Wireless Ad-Hoc Sensor Networks”, Computer Communications

Journal (Elsevier), vol. 29, no. 4, pp. 413-420, Feb. 2006.

[11] M. Siraj and S. Kanrar, “Performance of Modeling Wireless Networks

in Realistic Environment,” International Journal of Computer Networks,

vol. 2, no. 1, 2010.

[12] V. K. Saraswat and A. Bakshi, “Wireless Sensor Networks:

Applications And Issues,” Global Journal Of Enterprise Information

System, vol. 3, no. 2, pp. 70-75, 2011.

[13] S. Suzuki, K. Kawabata, Y. Hada and Y. Tobe, “Deployment of

Wireless Sensor Network Using Mobile Robots to Construct an

Intelligent Environment in a Multi-Robot Sensor Network,” Advances

in Service Robotics, Austria, 2008.

[14] D. Sharma, N. Sharma and N. Shrivastava, “Wireless Sensor Network

and Its Architecture,” VSRD-IJCSIT, Vol. 1, no. 6, pp. 408-412, 2011.

[15] N. Batra, A. Jain and S. Dhiman, “An Optimized Energy Efficient

Routing Algorithm for Wireless Sensor Network,” International Journal

Of Innovative Technology & Creative Engineering, vol. 1, no. 5, pp. 41-

45, May 2011.

[16] J. N. Al-karaki and A. E. Kamal, “Routing Techniques In Wireless

Sensor Networks: A Survey,” IEEE Wireless Communications, vol. 11,

pp. 6-28, 2004.

[17] D. Chen and P. K. Varshney, “QoS Support in Wireless Sensor

Networks: A Survey,” International Conference on Wireless Networks,

pp. 227-233, 2004.

[18] T. Yang, L. Barolli, J. Iwashige, A. Durresi and F. Xhafa, “Comparison

Evaluation of Static and Mobile Sensor Nodes in Wireless Sensor

Networks Considering Packet-Loss and Delay Metrics,” Proceedings of

the 2011 Third International Conference on Intelligent Networking and

Collaborative Systems, pp. 196-202, 2011.

Page 103: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

89

[19] R. Pon, M. A. Batalin, V. Chen, A. Kansal, D. Liu, M. Rahimi, L.

Shirachi, A. Somasundra, Y. Yu, M. Hansen, W. J. Kaiser, M.

Srivastava, G. Sukhatme, and D. Estrin, “Coordinated Static and Mobile

Sensing for Environmental Monitoring,” Proceedings of the First IEEE

international conference on Distributed Computing in Sensor Systems,

pp. 403-405, 2005.

[20] P. Damuut and D. Gu, “A Survey of Deterministic Vs. Non-

Deterministic Node Placement Schemes in WSNs,” The Sixth

International Conference on Sensor Technologies and Applications, pp.

154-158, 2012.

[21] I.F. Akyildiz, W. Su, Y. Sankarasubramaniam and E. Cayirci, “Wireless

sensor network: a survey,” Computer Networks, vol. 38, pp. 393–422,

2002.

[22] X. Wu, “Dual-Sink: Using Mobile and Static Sinks for Lifetime

Improvement in Wireless Sensor Networks,” Proceedings of the 16th

International Conference on Computer Communications and Networks,

IEEE ICCC, pp. 1297-1302, 2007.

[23] M. I. Khana, W. N. Ganstererb and G. Haring, “Static vs. Mobile Sink:

The Influence of Basic Parameters on Energy Efficiency in Wireless

Sensor Networks,” Computer Communications, vol. 36, no. 9,pp: 965-

978, November 2012.

[24] D. Kumar, K. A. Kumar and M.S. Arthy, “An Overview of Mobile Sink

and Static Access Node Replication Attacks in WSN,” International

Journal of Engineering Science and Innovative Technology (IJESIT),

Vol. 1, no. 2, November 2012.

[25] L. Friedmann, “Effcient Multi-sink Relocation in Wireless Sensor

Networks,” Proceeding of the Third International Conference on

Networking and Services, pp. 90-98, 2007

[26] S. Singh, M. P. Singh, and D. K. Singh, “Routing Protocols in Wireless

Sensor Networks – A Survey,” International Journal of Computer

Science & Engineering Survey (IJCSES), vol. 1, no. 2, November 2010.

Page 104: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

90

[27] V. Mhatre and C. Rosenberg, “Homogeneous vs Heterogeneous

Clustered Sensor Networks: A Comparative Study,” In IEEE

International Conference on Communications, vol. 6, pp. 3646- 3651,

2004.

[28] A. Alkhatib and G. Baicher, “Wireless Sensor Network Architecture,”

International Conference on Computer Networks and Communication

Systems (CNCS 2012), vol. 35, pp. 11-15, 2012.

[29] E. Freitas, T. Heimfarth, I. Netto, C. Pereira, A. Ferreira, F. Wagner,

and T. Larsson, “Handling Failures of Static Sensor Nodes in Wireless

Sensor Network by Use of Mobile Sensors,” Proceedings of the 2011

IEEE Workshops of International Conference on Advanced Information

Networking and Applications, pp. 127-134, 2011.

[30] A. Dhawan, C. T. Vu, A. Zelikovsky, Y. Li, and S. K. Prasad,

“Maximum Lifetime of Sensor Networks with Adjustable Sensing

Range,” Proceedings of the International Workshop on Self-Assembling

Wireless Networks (SAWN), pp. 285–289, 2006.

[31] Q. Wang and I. Balasingham, “Wireless Sensor Networks - An

Introduction,” InTech Europe, 2010.

[32] S. Prasanna and S. Rao, “An Overview of Wireless Sensor Networks

Applications and Security,” International Journal of Soft Computing

and Engineering (IJSCE), vol. 2, no. 2, pp. 2231-2307, May 2012.

[33] G. Zhao, “Wireless Sensor Networks for Industrial Process Monitoring

and Control: A Survey,” Network Protocols and Algorithms, vol. 3, no.

1, pp. 46-63, 2011.

[34] S, Rahimi, “Algorithms For Data-Gathering In Wireless Sensor

Networks,” Master Thesis, Concordia University, 2008.

[35] J. Carle and D. Simplot-Ryl, “Energy Efficient Area Monitoring by

Sensor Networks,” IEEE Computer Society Press, vol. 37, no. 2, pp. 40-

46, 2004.

[36] L. H. A. Correia, D. F. Macedo, A. L. dos Santos and J. M. Nogueira,

“Issues on QoS Schemes in Wireless Sensor Networks,” Universidade

Page 105: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

91

Federal de Minas Gerais, April 2005.

[37] C. Basaran and K. Kang, “Quality of Service in Wireless Sensor

Networks,” Guide to Wireless Sensor Networks, Springer, London,

2009.

[38] H. Baia, M. Atiquzzamanb, and W. Ivancicc, “Running Integrated

Services over Differentiated Service Networks: Quantitative

Performance Measurements,” Proceedings of SPIE, vol. 4866, 2002.

[39] R. S. Dubey, R. Choubey and A. Dubey, “Challenges For Quality Of

Service (Qos) In Wireless Sensor Networks,” International Journal of

Engineering Science and Technology, vol. 2, no. 12, pp. 7395-7400,

2010.

[40] L. Cheng, Chengdong Wu, Y. Zhang, H. Wu, M. Li and C. Maple, “A

Survey of Localization in Wireless Sensor Network,” International

Journal of Distributed Sensor Networks, vol. 2012, 2012.

[41] K. Akkaya and M. Younis, “A Survey on Routing Protocols for

Wireless Sensor Networks,” Ad Hoc Networks, vol. 3, no. 3, pp. 325–

349, 2005.

[42] F. Sarkohaki, S. Jamali, R. Fotohi and J. Balov, A Simulative

Comparison of DSDV and OLSR Routing Protocols, Australian Journal

of Basic and Applied Sciences, vol. 6, no. 12, pp. 373-378, 2012.

[43] K. P. Vijayakumar, P. Ganeshkumar and M. Anandaraj, “Review on

Routing Algorithms in Wireless Mesh Networks,” International Journal

of Computer Science and Telecommunications, vol. 3, no. 5, May 2012.

[44] M. R. Pearlman and Z. J. Haas, Improving the Performance of Query-

Based Routing Protocols Through Diversity Injection,” Wireless

Communications and Networking, IEEE Conference, 1999.

[45] D. Johnson, Y. Hu and D. Maltz, rfc4728: The Dynamic Source Routing

Protocol (DSR) for Mobile Ad Hoc Networks for IPv4 , February 2007.

[46] H. Singh and G. Josan, “Performance Analysis of AODV & DSR

Routing Protocols in Wireless Sensor Networks,” International Journal

of Engineering Research and Applications (IJERA), vol. 2, no. 5, pp.

Page 106: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

92

2212-2216, 2012.

[47] C. Perkins, E. Belding-Royer and S. Das, rfc3561: Ad hoc On-Demand

Distance Vector (AODV) Routing, July 2003.

[48] F. Rabeb, “An Extensive Comparison Among DSDV, DSR and AODV

Protocols in Wireless Sensor Network,” International Conference on

Education and e-Learning Innovations (ICEELI), pp. 1-4, 2012.

[49] T. Tsai1, Y. Chung and Z. Tsai, “Introduction to Packet Scheduling

Algorithms for Communication Networks,” Communications and

Networking,InTech Europe, 2010.

[50] S. Kumar and S. Chauhan, “A Survey on Scheduling Algorithms for

Wireless Sensor Networks,” International Journal of Computer

Applications, vol. 20, no. 5, April 2011.

[51] D. Virmani and S. Jain, “Real Time scheduling with Virtual Nodes for

Self Stabilization in Wireless Sensor Networks,” International Journal

of Information Technology and Knowledge Management, vol. 4, no. 2,

pp. 477-483, 2011.

[52] D. Virmani and S. Jain, “Real Time Scheduling for Wireless Sensor

Networks,” International Journal of Hybrid Information Technology,

vol. 5, no. 1, pp. 61-68, 2012.

[53] B. Chellaprabha and S. Chenthur Pandian, “A Multipath Energy

Efficient Congestion Control Scheme for Wireless Sensor Network,”

Journal of Computer Science, vol. 8, no. 6, pp. 943-950, 2012.

[54] Shweta K. Kanhere1 , Mahesh Goudar, and Vijay M. Wadhai, “End-To-

End Delay Optimization in Wireless Sensor Network (WSN),”

International Journal of Smart Sensors and Ad Hoc Networks

(IJSSAN), vol. 1, no. 3, pp. 2248-9738, 2012.

[55] M. Naghibzadeh, “A Modified Version of Rate-Monotonic Scheduling

Algorithm And Its' Efficiency Assessment,” Proceedings of the Seventh

International Workshop on Object-Oriented Real-Time Dependable

Systems (WORDS 2002), pp. 289-294, 2002.

[56] M. Monowar, O. Rahman, A. Pathan, and C. Seon Hong, “Prioritized

Page 107: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

93

Heterogeneous Traffic-Oriented Congestion Control Protocol for

WSNs,” The International Arab Journal of Information Technology,

vol. 9, no. 1, pp. 39-48, 2012.

[57] M. Adamou, S. Khanna, I. Lee, I. Shin, and S. Zhou, “Fair Real-time

Traffic Scheduling over a Wireless LAN,” Proceedings of the 22nd

IEEE Real-Time Systems Symposium, pp. 279-288, 2001.

[58] C. Lu, “RAP: A Real-Time Communication Architecture for Large-

Scale Wireless Sensor Networks,” In Proceedings on The 8th IEEE

Real-Time and Embedded Technology and Applications Symposium

(RTAS 2002), pp. 55-66, 2002.

[59] Ke Liu Nael B. Abu-ghazaleh and Kyoung-Don Kang, “JiTS: Just-In-

Time Scheduling For Real-Time Sensor Data Dissemination,” IEEE

International Conference on Pervasive Computing and

Communications, pp. 42-46, 2006.

[60] A. K. Dwivedi, Sunita Kushwaha, and O. P. Vyas, “Performance of

Routing Protocols for Mobile Adhoc and Wireless Sensor Networks: A

Comparative Study,” International Journal of Recent Trends in

Engineering, vol. 2, no. 4, November 2009.

[61] R. Salom, P. Kaspar, T. Blecha, J. Freisleben, J. Bartovsky, P. Krist

and A. Hamacek, “Implementation of AODV Routing Protocol in

Sensor Wireless Networks,” Telecommunications Forum (TELFOR),

2012.

[62] A. K. Gupta, H. Sadawarti, and A. K. Verma, “Performance analysis of

AODV, DSR & TORA Routing Protocols,” IACSIT International

Journal of Engineering and Technology, vol. 2, no. 2, April 2010.

[63] D. Ahirwar, P. Verma1, and J. Daksh, “Enhanced AODV Routing

Protocol for Wireless Sensor Network Based on ZigBee,” Advances in

Computer Science and Information Technology. Networks and

Communications. Second International Conference, CCSIT 2012,

Bangalore, India, 2012.

[64] Z. Che-Aron, W. F. M. Al-Khateeb and F. Anwar, “The Enhanced

Page 108: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

94

Fault-Tolerant AODV Routing Protocol for Wireless Sensor Network,”

Proceeding of the 2010 Second International Conference on Computer

Research and Development (ICCRD '10), pp. 105-109, 2010.

[65] L. Qiong and Y. Jun, “An Improved AODV Routing Protocol of

Wireless Sensor Network,” International Conference on Image Analysis

and Signal Processing (IASP), pp. 1-4, November 2012.

[66] A. Abuarqoub, F. Alfayez, M. Hammoudeh, T. Alsboui and A. Nisbet,

“Simulation Issues in Wireless Sensor Networks: A Survey,” In

SENSORCOMM '12: Proceedings of the 2012 Sixth International

Conference on Sensor Technologies and Applications, Rome, Italy,

2012.

[67] A. Salleh, Z. Ishak , N. Md. Din and M. Jamaludin, “Trace Analyzer for

NS-2,” 4th Student Conference on Research and Development

(SCOReD 2006), Shah Alam, Selangor, MALAYSIA, June 2006.

[68] M. H. N. Taha, “subjective QoS for Voice over IP”, Master thesis,

Department of Information Technology, Cairo University, Egypt, 2009.

[69] B. Gedik, L. Liu, and P. S. Yu, “ASAP: An Adaptive Sampling

Approach to Data Collection in Sensor Networks,” IEEE Transactions

on Parallel and Distributed Systems, Vol. 18, No. 12, pp. 1766-1783,

February, 2007

[70] Hesham N. Elmahdy and M. H. N. Taha, “The Impact of Packet Size

and Packet Dropping Probability on Bit Loss of VoIP Networks”,

ICGST International Journal on Computer Network and Internet

Research, vol. 8, no. 2, pp. 25-29, 2009.

Page 109: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

95

Appendix A - Trace File Field Types

The trace format is shown below.

S –t 0.267662078 -Hs 0 -Hd -1 -Ni 0 -Nx 5.00 -Ny 2.00 -Nz 0.00 –Ne -1.000000 -N1

RTR -Nw --- -Ma 0 -Md 0 -Ms 0 -Mt 0 -Is 0.255 -Id -1.255 –It message -Il 32 -If 0 -Ii 0

-Iv 32

r –t 100.004776054 -Hs 0 -Hd -1 -Ni 1 -Nx 25.05 -Ny 20.05 -Nz 0.00 –Ne -1.000000 -

N1 AGT -Nw --- -Ma a2 -Md 1 -Ms 0 -Mt 800 -Is 0.0 -Id -1.0 –It tcp -Il 1020 -If 2 -Ii 21

-Iv 32 -Pn tcp -Ps 0 -Pa 0 -Pf 1 -Po 0

Field 0: event type s: send

r: receive

d: drop

f: forward

Filed 1: General tag -t: time

Field 2: Next hop info -Hs: id for this node

-Hd: id for next hop towards the destination

Field 3: Node property type tag -Ni: node id

-Nx –Ny -Nz: node’s x/y/z coordinate

-Ne: node energy level

-Nl: trace level, such as AGT, RTR, MAC

Page 110: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

96

-Nw: reason for the event

Field 4: packet info at MAC level -Ma: duration

-Md: dest’s ethernet address

-Ms: src’s ethernet address

-Mt: ethernet type

Field 5: Packet information at IP level -Is: source address. Source port number

-Id: dest address.dest port number

-It: packet type

-Il: packet size

-If: flow id

-Ii: unique id

-Iv: ttl value

Field 6: Packet info at “Application level”which consists of the type of application like ARP, TCP, CBR, the type of ad-hoc

routing protocol like DSDV, DSR, AODV etc. The field consists of a leading –P and the

list of tags for different applications. For values of the fields for AODV and CBR are

described below;

For AODV :

-Pt : Control message type,

-Ph: Hop-count,

-Pb: Broadcast-id,

-Pd: Destination,

-Pds: Dest Seqno,

-Ps: Source,

-Pss: Source Seqno

Page 111: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

97

-Pl: Lifetime.

-Pc: Pkt Type, REPLY/ERROR

For CBR :

-Pn: This denotes the application of “CBR”

-Pi: sequence number

-Pf: how many times this pkt was forwarded

-Po: optimal number of forwards

Page 112: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

98

Appendix B - SAMPLE AWK SCRIPTS

# Lim Kwang Yong

# Usage: awk -f <awk_script.awk> <trace_file.tr>

# Parse a ns2 wireless trace file and generate performance metrics

BEGIN {

droppedRTGpackets=0;

droppedbRTGbytes=0;

droppedMACbytes=0;

droppedMACpackets=0;

droppedbDATAbytes=0;

droppedbDATApackets=0;

droppedIFQpackets=0;

droppedLQIbytes=0;

droppedLQIpackets=0;

droppedIFQbytes=0;

totalDROPPEDpackets=0;

totalDROPPEDbytes=0;

dataSent=0;

dataRecd=0;

sentData=0;

sentDataBytes=0;

TotalsentData=0;

TotalsentDataBytes=0;

recdData=0;

recdDataBytes=0;

sends=0;

recvs=0;

RTGbytes=0;

fwdData=0;

Page 113: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

99

fwdDataBytes=0;

fwdRtg=0;

fwdRtgBytes=0;

fwdMac=0;

fwdMacBytes=0;

highest_packet_id=0; #used to compare with the packet id

highest_time=0

sum=0;

RTG=0;

MACDATA=0;

MACRTG=0;

}

{

#=============================

# Check for the highest packet ID & time

#=============================

action = $1;

time = $2;

node_id = $3

if ($7 =="cbr"){packet_id = $6;};

if ( packet_id > highest_packet_id ) {highest_packet_id = packet_id;};

if ( time > highest_time) {highest_time = time}

#============

# Calculate delay

#============

if ( start_time[packet_id] == 0 ) {start_time[packet_id] = time;};

if ( action != "D" ) {

if ( action == "r" ) {end_time[packet_id] = time;};

}

else {end_time[packet_id] = -1;};

Page 114: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

100

#===========

#Calculate PDF

#===========

if (($1 == "s") && ($7 == "cbr") && ($4 =="AGT")) {

sends++;

dataSent=dataSent+$8;

}

if ( ( $1 == "r") && ( $7 == "cbr" ) && ( $4 == "AGT" ) ) {

recvs++;

dataRecd=dataRecd+$8;

}

#===============

# Calculate RTG load

#===============

if ((( $1 == "s") || ($1=="f") ) && ( $7 == "cbr" ) && ( $4 =="RTR" )) {

sentData++;

sentDataBytes=sentDataBytes+$8;

}

if ( ( $1 == "r") && ( $7 == "cbr" ) && ( $4 == "RTR" ) ) {

recdData++;

recdDataBytes=recdDataBytes+$8;

}

#==============

# RTG protocol pkts

#==============

if ( (($1=="f") || ($1=="s") ) && ($4 == "RTR") && ($7 =="AODV" ) ) {

RTG++;

RTGbytes=RTGbytes+$8;

}

#============

# MAC data pkts

Page 115: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

101

#============

if ( (($1=="f") || ($1=="s") ) && ($4 == "MAC") && ($7 =="cbr" ) ) {

MACDATA++;

}

#=============

# MAC RTG pkts

#=============

if ( (($1=="f") || ($1=="s") ) && ($4 == "MAC") && ($7 =="AODV" ) ) {

MACRTG++;

}

#==============

# Dropped data pkts

#==============

if ( ($1 == "D") && ($7 =="cbr") && ( $4 == "RTR" )){

droppedDATAbytes=droppedDATAbytes+$8 ;

droppedDATApackets=droppedDATApackets+1;

}

#===============

# Dropped MAC pkts

#===============

if ( ($1 == "D") && ($4 == "MAC" )){

droppedMACbytes=droppedMACbytes+$8 ;

droppedMACpackets=droppedMACpackets+1;

}

#===============

# Dropped RTG pkts

#===============

if ( ($1 == "D") && ($4 == "RTR" ) && ($8 == "AODV")){

droppedRTGbytes=droppedRTGbytes+$8 ;

droppedRTGpackets=droppedRTGpackets+1;

}

Page 116: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

102

#==============

# Dropped IFQ pkts

#==============

if (($1 == "D") && ($4 == "IFQ")){

droppedIFQbytes=droppedIFQbytes+$8 ;

droppedIFQpackets=droppedIFQpackets+1;

}

#==============

# Dropped LQI pkts

#==============

if (($1 == "D") && ($4 == "IFQ")){

droppedLQIbytes=droppedLQIbytes+$8 ;

droppedLQIpackets=droppedLQIpackets+1;

}

#==============

# Total dropped pkts

#==============

if ($1 == "D") {

totalDROPPEDpackets++;

totalDROPPEDbytes=totalDROPPEDbytes+$8

}

#==============

# Forward data pkts

#==============

if ( ($1 == "f") && ($7 == "cbr") && ($4 == "RTR" ) ) {

fwdData++;

fwdDataBytes=fwdDataBytes+$8;

}

#==============

# Forward RTG pkts

#==============

Page 117: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

103

if ( ( $1 == "f") && ($7 == "AODV") && ($4 == "RTR") ) {

fwdRtg++;

fwdRtgBytes=fwdRtgBytes+$8;

}

#===============

# Forward MAC pkts

#===============

if ( ( $1 == "f") && ($4 == "MAC" ) ) {

fwdMac++;

fwdMacBytes=fwdMacBytes+$8;

}

#==============

# Total forward pkts

#==============

if ( $1 == "f") {

fwdpackets++;

fwdBytes=fwdBytes+$8;

}

if ($1 == "D") {

droppingnodes= $3;

}

}

END {

for ( packet_id = 0; packet_id <= highest_packet_id; packet_id++ ) {

start = start_time[packet_id];

end = end_time[packet_id];

packet_duration = end - start;

if (start < end) sum= packet_duration+sum;

}

#==========

# Show results

Page 118: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

104

#==========

printf("\n .......Data parsed from trace file with 25

NODES.............\n\n") >> "performance.txt";

printf(" 1. No. of CBR Packets sent = %d PACKETS \n ", sends) >>

"performance.txt";

printf(" 2. No. of CBR Bytes sent = %d BYTES \n", dataSent) >>

"performance.txt";

printf(" 3. No. of CBR Packets received = %d PACKETS \n", recvs) >>

"performance.txt";

printf(" 4. No. of CBR Bytes received = %d BYTES \n", dataRecd) >>

"performance.txt";

printf(" \n .......Routing details.............\n\n") >>

"performance.txt";

printf(" 5. No. of routing packets = %d PACKETS \n",RTG) >>

"performance.txt";

printf(" 6. No. of routing bytes = %d BYTES \n",RTGbytes) >>

"performance.txt";

printf(" \n .......MAC details.............\n\n") >> "performance.txt";

printf(" 7. No. of MAC packets for data sent = %d PACKETS \n", MACDATA)

>> "performance.txt";

printf(" 8. No. of MAC packets for Rtg sent = %d PACKETS \n", MACRTG) >>

"performance.txt";

printf(" 9. Total No. of MAC Packets sent = %d PACKETS \n",

MACRTG+MACDATA) >> "performance.txt";

printf(" \n .......Forwarding details............\n\n") >>

"performance.txt";

printf(" 10. No. of DATA Packets Fwd = %d PACKETS \n", fwdData) >>

"performance.txt";

printf(" 11. No. of DATA Bytes Fwd = %d BYTES \n", fwddataBytes) >>

"performance.txt";

printf(" 12. No. of RTG Packets Fwd = %d PACKETS \n", fwdRtg) >>

Page 119: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

105

"performance.txt";

printf(" 13. No. of RTG Bytes Fwd = %d BYTES \n", fwdRtgBytes) >>

"performance.txt";

printf(" 14. No. of MAC Packets Fwd = %d PACKETS \n", fwdMac) >>

"performance.txt";

printf(" 15. No. of MAC Bytes Fwd = %d BYTES \n", fwdMacBytes) >>

"performance.txt";

printf(" 16. Total No. of Fwd packets = %d PACKETS \n", fwdpackets) >>

"performance.txt";

printf(" 17. Total No. of Fwd Bytes = %d BYTES \n", fwdBytes) >>

"performance.txt";

printf(" \n ........Dropping details............\n\n") >>

"performance.txt";

printf(" 18. Dropping nodes are %d nodes \n", droppingnodes) >>

"performance.txt";

printf(" 19. No. of dropped data (packets) = %d PACKETS

\n",droppedDATApackets) >> "performance.txt";

printf(" 20. No. of dropped data (bytes) = %d BYTES \n",droppedDATAbytes)

>> "performance.txt";

printf(" 21. No. of dropped MAC (packets) = %d PACKETS

\n",droppedMACpackets) >> "performance.txt";

printf(" 22. No. of dropped MAC (bytes) = %d BYTES \n",droppedMACAbytes)

>> "performance.txt";

printf(" 23. No. of dropped RTG (packets) = %d PACKETS

\n",droppedRTGpackets) >> "performance.txt";

printf(" 24. No. of dropped RTG (bytes) = %d BYTES \n",droppedRTGbytes)

>> "performance.txt";

printf(" 25. No. of dropped IFQ (Packets) = %d PACKETS

\n",droppedIFQpackets) >> "performance.txt";

printf(" 26. No. of dropped IFQ (bytes) = %d BYTES \n",droppedIFQbytes)

>> "performance.txt";

Page 120: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

106

printf(" 27. No. of dropped LQI (Packets) = %d PACKETS

\n",droppedLQIpackets) >> "performance.txt";

printf(" 28. No. of dropped LQI (bytes) = %d BYTES \n",droppedIFQbytes)

>> "performance.txt";

printf(" 29. Total No. of Dropped (packets) = %d PACKETS

\n\n",totalDROPPEDpackets) >> "performance.txt";

printf(" 30. Total No. of Dropped (Bytes)) = %d BYTES

\n\n",totalDROPPEDbytes) >> "performance.txt";

printf("\n .............PERFORMANCE METRICES .....................\n\n")

>> "performance.txt";

printf(" 1. Packet Delivery Ratio (PDR %) = %f %\n", (recvs/sends)*100)

>> "performance.txt";

printf(" 2. Average Network delay = %f \n", sum/highest_packet_id) >>

"performance.txt";

printf(" 3. Network Throughput = %f \n", (dataRecd/highest_time)/25) >>

"performance.txt";

printf(" 4. Normalised routing load (Packets %) = %f %\n",

(RTG/sentData)*100) >> "performance.txt";

printf(" 5. Normalised routing load (Bytes %) = %f %\n",

(RTGbytes/sentDataBytes)*100) >> "performance.txt";

printf(" 6. Routing OVERHEAD (Packets %) = %f %\n",

(MACRTG/MACDATA)*100)

>> "performance.txt";

printf(" 7. Optimal Hop Count = %f \n\n", MACDATA/sends) >>

"performance.txt";

Page 121: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

صـــالملخ

(كموووقكط وووتشكار تلوووكتةكا تووواكموووتاكتشتمكلوووتكمكتط وووت ك تت ووو كWSNsتتكوووشبكاوووالكتشكار تلوووكتةكا ووو ك ك

تكتالوووذكهوووالكا تكطش شم وووتكمل ووو ككا ووو ك كارت وووترشهوووالكا ط وووتشكار تلوووكتةم كبالك ووولتكا وووالك كموووقك ووو ك

ا كسوووكذم ك ا ك وووو ك ا وووطتي ك ا سط وووو ك ووواكا كسمووووسكمووووقك جووووترشكا رطلوووتك ووووشثكتةوووسعك ووووشة ك ا وووك ك وووواك

تطوو كا تطال ووتشكمووتاكطلووذكا ط ووتشكار تلووكتةم ك بكا ةتموو ككا وواكت طوو فكمسووال كه وونكاطوو ك ووشةكطلووذكهووالكا ط ووتشك

كبلك كمست ك اكاالك كارت ترشكا ك طفسلتكمجبكابكتت تعكبت سة كي ىكتطظ اك

جس وووو كهوووولبكط وووو كا ال تطووووتشك وووواكا ش وووو كا ة ووووا كه وووونكتك وووو كهووووالكا ووووسك مووووك كم ططووووتشكمسمووووس كك

ا ططوووتشكي ووواكتةسموووسكل شموووتشكا ةووولبك وووتك شاي وووسهتكطلت ووو كابككيطوووتدكا شمووو ك ةووولبكركم كوووقكلبكتوووسياك

ووواكفوووذ ثكا وووشفكي ووواكا لوووالك رك وووسكمووو كاطتظوووتةككي وووذكا لوووالك كي وووىكمةوووت تطال وووتشكا ووولمقكا ة ووواكل ك

ابكك ووو تشكا ةلمووو كمووو كك وووىك وووسابكا طت ووو كه ووونكاطووو ككا كاتا تلوووت ا ةووولبك ككتوووت ذكا ةووولبك ووواكووووفشثكششم ووو

كةلم ك سكا تل ك كشت كيت كمقكلم كتس لتكك ىك ملتلت ا مقكا كقكابكتكشبك

ابكا تطووشمذكا سووت ذكمووقكاموو كا ت وو ك وواكهجوواك كتك فوو كا ط ووتشكار تلووكتةم ك ووسك ووتيسك وواكتمووت كاربةووتعكك

ي ووواكا ةفوووتفكي ووواكا طت ووو ك كتموووت ككاربةوووتعكا ةت ووو ك ووواكمجووترشكا تشم ووو ك كا ت طووو فككتذكووولك وواكهوووااكا جوووت

ك تك وووو كهووووالكا بةووووتعكي وووواكايطووووتدك تب وووو كر ووووت كتركيووووس ككال ووووذكمووووقكا ط ووووتشكار تلووووكتة كي ووووذكا لووووالك

اهوووسكملوووك كا طت ووو كا كت ووو كمشاملووو كةوووشعكمجوووبكتكطووواكا لوووالك كا وووسة كي ووواك بتإلموووت كك وووىكن ووو ك وووتبكهوووالكا ال

مووووتاكطلووووذكاووووالكتشكا تلووووكتةك ج ووووعكا ك شمووووتشك تة لووووتكره ووووت ك ةوووووسكل كتتالووووعكهتووووىككا ط ووووتشكار تلووووكتةم

كا ظشاهذك اكا ش كا ة ا

وووواكاووووالكتشكار تلووووكتةكا وووو ك ك ووووتبكا ةوووولبكا ذ وووو كمووووتاك مووووكلتك وووواك ت وووو كارطتظووووتةك وووواكا ط ووووتشك

مووتاكتك وو قكا شمووتشكك ووىكا ةوولبك ووتك كهلموو كه وونكتك وو ككوو كط طوو كي وواكتك وو قكا شمووتشكك ووىككووا ش وو ط ك

هوووااكا ووو شرك ووواكتةسموووسكا شموووتشكا ةلمووو كركمو ووواكبكووو قكاريتالوووتةك وووشادك ووواكي وووذكك شاي وووسكطلت ووو ك لوووت

ووواكا وووىكمتطوووبكن ووو ك دطووو ك وووسكمووو كك وووىكك ووو تشكا ةووولبكيت ووو كار وووت سابك طت ووو ككا لوووالك كل كا وووتل قكا طت ووو

الوووذكا ك وووذكار تذامووواك لوووالكتشكار تلوووكتةكا ووو ك كك ووو كهذمووو ك شتمووو كل طوووتدكا كسموووسكموووقكا تطال وووتش ك مكت

ككيسا كا لالك

جس وو كك وواكهووااكا طووفكمووتاك م طووفك جس وو كمسوو اكم طووفكا طت وو كا كم تووذ كمووتاكت ووسما وواكهووااكا الةوونك

تةسموووسكا شمووو كارة وووت ك ةووولبك ووو اك وووفك وووتك شاي وووسكا طلت ووو ك ك كوووقكام وووتك وووتك وووالك ك ت وووتشكا طت ووو ك

ا توووذ كا طووفككم ووشبك كه وونAODVا تووو كبت لووالك ك ك ووسكتوواك مووطكهووااكا طووفكمووعكبذ تشكووش كا تشم وو ك

م طوووفكا جس ووو ككي ووواكا وووت سابكا تطوووتشكخ وووذكا سوووت سم ك ووواكا ةلمووو كموووقك ووو كهوووااكا الةووون كتوووتاكم تةطووو

ك ووووذك كتووووتاكا تةطووووتشك ووووتكNS-2 ن وووو كبت ووووت سابككا تذهوووو كمووووعكم طووووفكا جس وووو كا ت وووو كناشكا شموووو

Page 122: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

ابكا طتوووت طكت الووو كلبكم طوووفكا طت ووو كا جس ووو كا ت ووو كمك ووو كي ووواككا لوووالك ك ا وووتل قكا طت ووو ك كم اوووذكا طلاهووو

كل ذى كك تبكم اذكا كسا كمتت ذك الت كتمت كه ت كا لالك ك ت كا تل قكا طت ك ةلب كمقكطته

مذموووعكك96م ةووو ك كم ةووو كبوووت الذامطك ك ت ووو كبوووت ذامعكتت ووو قكك2 كتت ووو قكا ذ وووت ك وووت كابوووشارك كيوووس ك

ك- كطشة ك تكم اكم صك لالكاربشار:

ا التركار :كم سم

كاربشاركا تت ك اكا ذ ت قكهااكا التركاذ ك لك ك كيذضكم صك كمت

ا تطا:كاالكتشكار تلكتةكا ك ا الترك

كمووتكمتك وو كبلووتكمووقكه تكوو ك ك كمت وو قكهووااكا الووتركاووذ كتف وو اك لووالكتشكار تلووكتةكا وو ك ك

كتطال تشك كتةسمتش كك تكتةتش كي اكاذ ك الذ تشكشرشكا تشم

ا التركا ت ن:كم كتط لم تشكا جس ك اكاالكتشكار تلكتةكا ك

كاذهتكتف تك ططتشكا جس ك اكاالكتشكار تلكتةكا ك كمت قكهااكا الترك

ا طت ي اككمكت سك جس كا التركا ذابع:كم طفكم تذ

ك كمت قكهااكا التركيذمتك كاذهتكتف تك طفكا جس كا تذ

ا ةتكت ك كا طتت طا التركا تما:ك

ك كمت قكهااكا التركيذمتك كاذهتكتف تكك طتت ط

ا ست س:كا و ك كا ك كا ست ال اا الترك

كهااكا التركيذمتكتف تك و ك كا ك كا ست ال اك ذ ت كمت قك

Page 123: Improving QoS of Data Transmission over Wireless …scholar.cu.edu.eg/?q=mnasrtaha/files/final_thesis_4-7...2013/04/07  · packets. In many applications, WSN lifetime is considered

رةــــــــــة القاھـــــــــــجامعكلیة الحاسبات و المعلومات

اتـــقسم تكنولوجیا المعلوم

الالسلكیةاإلستشعارشبكاتعبرالبیاناتتناقلجودةتحسین

إعداد

طھالدیننصرحامدمحمد

والمعلوماتالحاسباتكلیةإلىمقدمةرسالة

القاھرةجامعة

الدكتوراهدرجةعلىالحصولمتطلباتمنكجزء

المعلوماتتكنولوجیافي

تحت إشراف

أ.د ھشام نبیھ المھديأستاذ بقسم تكنولوجیا المعلومات

كلیة الحاسبات والمعلوماتجامعة القاھرة

أ.د إیمان علي ثروت إسماعیلوكیل الكلیة لشئون التعلیم والطالب

كلیة الحاسبات والمعلوماتجامعة القاھرة

یونیو2013