40
The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Embed Size (px)

Citation preview

Page 1: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

The Implementation of IPv6 Wireless Sensor Network Nodes

University of Electronic Science and Technology of China

UESTC

Page 2: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

• Sponsored by

China Next Generation Internet (CNGI)

Page 3: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Our Goals

• Architecture and key technologies of Wireless sensor network node

• IPv6 support

• Low power MCU

Work mode10mW ,sleep mode 2mW

• Node energy consumption: Transmission 50mW, Receive≤ 25mW , Sleep≤ 15mW

• Develop 30 nodes for experiment on CNGI

Page 4: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Network Architecture

CERNET2

Monitoring Area

cluster

Cluster headNode

Control Center

Gateway

IEEE 802.15.4

Ethernet

Sink

Multi-hop self-organized wireless network Autonomous sensor nodes: “nodes”placed in areas of scientific interest, form a multihop network

All data converge to sink

Gateway: a PC stores the data in a database and connects to Cernet2.

Page 5: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Node Architecture

Power: Rechargeable battery

DAU: Data Acquisition Unit

DPU: Data Processing Unit

DSRU: Data Sending and Receiving Unit

Power

MCU

Memory

Application

DPU

Sensor ADC

DAU

NETWORK

MAC

PHY

DSRU

Page 6: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DAU

Sensor• Temperature sensor

range: -40-100 / 0-2.5V ℃precision: ±1℃

• Humidity sensorrange: 20-90%RH / 0-2.5Vprecision: ±3%RH

• O2 sensorrange:0-20.9% / 0-2.1Vprecision:± 1%

Page 7: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DPU - ADC

ADC

• 8-bit SAR (Successive Approximation Register)-ADC

• Maximum Sampling Rate: 2M SPS

• Analog Input: : 0 ~ 2.7V

Page 8: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DPU - MCU

TaraxCore — Embedded low-power micro processor8bit RISC processor with Harvard architecture4 MHz System clockROM : on chip 128K×8bits 、 256K×8bits externalRAM : on chip 4K×8bitsPort: 56 bi-directional tri-state I/O portsInstruction set : 58105 pin ChipWatchdog with independent clock source for system reset an

d sleep wakeup

Page 9: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DPU - MCU

TaraxCore — Low power design

• Pwork ≤ 10mW , Psleep ≤ 2mW• 3.3V working voltage and 4 MHz system clock• Reduce the scale of logic gates to lower the load capacitance CL

Harvard architectureRISCtwo-phase clock pipeline

• Gated clock and sleep-wakeup mechanismfull speed working modelow energy sleep mode

Page 10: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DPU - MCU

TaraxCore architecture

Page 11: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DPU - MCU

NC NC NC TIP NC CWGS CWIN EGIN1 EGIN2 NC P60 P61 P62 P63 P64 P65 P66 P67 PD0 PD1PD2/URPD3/UTPD4/SCKPD5/SDOPD6/SDI

12345678910111213141516171819202122232425

75747372717069686766656463626160595857565554535251

EXD1EXD0P80P81P82P83P84P85P86P87P90P91P92P93P94P95P96P97PB0PB1PB2PB3PB4PB5PB6

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

PD

7/D

AO

U TV

DD

XIN

XO

UT

/RE

SE

TP

70/I

NT

0P

71/I

NT

1P

72/I

NT

2P

73/I

NT

3P

74/I

NT

4P

75/I

NT

5P

76/I

NT

6P

77/I

NT

7E

XS

EL

GN

DT

ES

TP

C7

PC

6P

C5

PC

4/A

0P

C3/

RD

PC

2/W

RP

C1/

CS

1P

C0/

CS

2P

B7

767778798081828384858687888990919293949596979899100101102103104105

EX

D2

EX

D3

EX

D4

EX

D5

EX

D6

EX

D7

RD

WRCS

EX

A0

EX

A1

EX

A2

EX

A3

EX

A4

EX

A5

EX

A6

EX

A7

EX

A8

EX

A9

EX

A10

EX

A11

EX

A12

EX

A13

EX

A14

EX

A15

EX

A16

EX

A17

EX

A18

EX

A19

EX

A20

105 pins QFP

TaraxCore

Page 12: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DPU - OS

TinyOS

http://www.tinyos.net/

Modularity: system is combined with modulesReusability : modules are connected by configuration files,

so modules could be reusedEvent-driven: work state changeSchedule: FIFO/PriorityCore: 15Kbytes

Page 13: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Main

process

DPU - OS

initialize

Executing task or waiting for task

1.RealMain_hardwareInit() ;Initialize the MCU.2.Spi_init ()3.CC2420_init(): Initialize the CC2420. 4.AD_init(): Initialize AD Module5.Uart_init(): Initialize UART Module6.Route_init():Initialize Route Module7.Timer_init() : Initialize TCC8.Timer_start() :Start Timer4.Sched_init() :Initialize task queue8.Enable_interrupt():Enable interrupt

main function

1.Run_task()2.if the queue is empty then sleep( ), else execute next task. 3.Response to any interruption in the procedure of waiting for task

Page 14: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

IEEE 802.15.4

Carrier frequency: 2.4 GHz

Max distance:125 m

Max data transmission rate: 250 Kbps

Chipcon CC2420

Page 15: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

FrameControl Field

(FCF)

DataSequenceNumber

AddressInformation

PreambleSequence

MAC ProtocolData Unit(MPDU)

FrameLength

PHY Protocol Data Unit(PPDU)

5+(0 to 20)+n

MAC Header(MHR) Mac Payload MAC Footer(MFR)

Start of FrameDelimiter

Frame payloadFrame Check

Sequence(FCS)

2 1 0 to 20 n 2

PHY Service Data Unit(PSDU)

Synchronisation Header(SHR)

PHY Header(PHR)

11+(0 to 20)+n

4

Bytes:

11Bytes:

PHYLayer

MACLayer

IEEE 802.15.4 Frame Format

Page 16: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

Bytes: 2 1 0/2/8

Frame control

Sequence number

Destination PAN

Destination address

sourcePAN

Frame header

0/2 0/2

Source address

0/2/8

Addressing fields

Bit:0-2 3 4 7-9

FrameType

SecurityEnabled

FramePending

ReservedDestinationaddressing

mode

10-11 12-13

ReseredSource

addressingmode

14-155 6

Acknowledgerequest

IntraPAN

• Address Information Fields

• Frame Control Field

Page 17: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

Frames

•HELLO Frame

limited broadcast for routing protocol

• DATA Frame

Upstream, sensor nodes—> sink node

• COMMNAD Frame

Downstream, sink node—> sensor nodes

Page 18: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

• HELLO Frame PayloadName Type Description

tfmy_hop Uint8_t bit7-bit6: frame type. 01-HELLO Frame, 10-DATA Frame, 11-COMMAND Frame

bit5-bit0: number of hops to sink node. 63=unreachable, 0=originated by sink node

tfn_flag Uint8_t Neighbor identification (number of neighbors)

tfmy_id Uint16_t Source Node ID

tfn1_id Uint16_t Neighbor node1 ID

tfn2_id Uint16_t Neighbor node2 ID

tfn3_id Uint16_t Neighbor node3 ID

tfn4_id Uint16_t Neighbor node4 ID

tfn5_id Uint16_t Neighbor node5 ID

tfn6_id Uint16_t Neighbor node6 ID

tfn7_id Uint16_t Neighbor node7 ID

tfn8_id Uint16_t Neighbor node8 ID

tfn9_id Uint16_t Neighbor node9 ID

tfn10_id Uint16_t Neighbor node10 ID

Page 19: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

• DATA Frame Payload

Name Type Description

FMy_Hop Uint8_t bit7-bit6: frame type. 01-HELLO Frame, 10-DATA Frame, 11-COMMAND Frame

bit5-bit0:reserved

FN_Flag Uint8_t Length of payload (in bytes): from FMy_Hop to the end of this data structure

FMy_ID Uint16_t Source Node ID

FN1_ID Uint16_t Next node ID (next hop) from source to sink node

Other data

Page 20: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

DSRU

• COMMAND Frame Payload

Name Type Description

FMy_Hop Uint8_t bit7-bit6: frame type. 01-HELLO Frame, 10-DATA Frame, 11-COMMAND Frame

bit5-bit0:reserved

FN_Flag Uint8_t Length of Path (number of hops): include sink node and destination node. Maximum=10 hops

FMy_ID Uint16_t Sink Node ID

FN1_ID Uint16_t Next node ID (next hop) along the path starting from sink node to destination node

………

FNx-1_ID Uint16_t Consecutive hop down to the destination node

FNx_ID Uint16_t Destination node

……. If Length of Path<10, leave them blank

FN10_ID Uint16_t Command ID

Page 21: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Networking and Routing

Ripple – a routing protocol

• Upstream path: from sensor node to sink node• Downstream path: from sink node to sensor node

3

2

Other network

4 7

85

9

1 6信息汇聚节点

downstream

Upstream

信息采集节点信息采集节点

信息采集节点

信息采集节点

Sink node

Sensor node

Sensor node

Sensor node

Page 22: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Networking and Routing

1

2

3

4

5

Backbone(IPv6)

Sink node

Sensor node

upstream path setting up1. Sink node broadcasts HELLO Frame to its one-hop neighbors2. one-hop neighbors add route to sink node

3. one-hop neighbors broadcast HELLO Frame to their one-hop neighbors( i.e. 2 hops to sink node)

4. 2-hop nodes add route to sink node5. All the nodes add route in the same way

6. Multiple sink node: find the closest sink node to balance the load

Page 23: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Networking and Routing

1

2

3

4

node

Next

2

1

3

2

4

3

1. Each DATA Frame piggybacks its source node address and the next hop address. Thus at sink node, a route table can be established

Route table recorded at sink node

downstream path setting up

2. Using the route table, sink node can set up the downstream path to each node

3. Sink node specifies the complete path for the downstream frames (COMMNAD Frame), using the source route delivery

Page 24: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Features

• Self-organized networking

• Load balancing between multiple sink nodes

• Unidirectional link identification and avoidance

• High efficiency and low cost

• Broadcast control

Networking and Routing

Page 25: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Networking and Routing

Limits

• Network Size :Hops>10, slow speed of convergence Network size<200 nodes

• Moving Speed: Limited capability and energy of nodesLow sending speed of HELLO Frame for routing maintenanceLow frequency of topology change

Page 26: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Gateway

IPv6 communication• Communicate with Control Center via IPv6 network

• Every node has its unique IPv6 address

Control CenterGateway

Sink node

Serial port cable

2001:da8:6000:2::a:1 2001:da8:6000:2::2 2001:da8:6000:2::888

IPv6 netWSN

Page 27: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Gateway

Function

• Connect WSN with Control Center

• data: WSN Control Center

• command: WSN Control Center

• Reformat the packet/frame

• in-net address (node ID) ipv6 address

• command name command ID

• Data Base

• Store sensor data

• Query operation

• Determine downstream path for command

Page 28: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Gateway

Linux

Control Center

Send client

Receive server

Windows

Gateway

Receive server

Send client

IPv6 socket

UART send

UART receive

Sink node

DB DB

TinyOS

new sensor packet

command

IPv6 socket

UART UART

UARTreceive

UART send

sensor data

command packet

Serial port cable IPv6 net

Architecture

Page 29: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Gateway

0100101000100101001010000100100010000010101000100

01001000010001001001001111111111110000100000100

Read a packet

Store data into TaraxDB

Query TaraxDBHandle data

Reframe packet

Send client

DB

Create socketSend packetClose socket

Send resultQuery TaraxDB

Get result

Accept connetcReceive command

Receive server

DB

Create socketBind addressCreate listen

Query TaraxDBHandle data

Is query?Frame packet

Put Into comm_file

UART receive

UART send

0101

0101 0101

0101

{ID,Path,Time,…}

Sensor_data_file

Comm_file

{0100010100110}

{data,node,next,...}

command

query result

{data,node,next,...}

Data direction

Program flow

Database operation

Implementation

Page 30: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Control Center

Linux

Control Center

Send client

Receive server

Windows

Gateway

Receive server

Send client

IPv6 socket

UART send

UART receive

Sink node

DB DB

TinyOS

new sensor packet

command

IPv6 socket

UART UART

UARTreceive

UART send

sensor data

command packet

Serial port cable IPv6 net

Page 31: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Control Center

Control Center

• PC / Windows XP• GUI

Sensor nodes real-time data curvesWireless sensor network topologyCommand input

Page 32: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Control Center

GUI

Page 33: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

WSN Topology

Control Center

Page 34: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Control Center

Real-Time Data Curve (Temperature)

Page 35: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Control Center

Command table

Cmmand number

Command NameDescription parameter

1 SAMPLE Get instant sample data none

2 QUERY Query history data querying period of history data (times)

3 MCU_ON Set MCU in work mode none

4 MCU_OFF Set MCU in sleep mode none

5 RF_RX Set RF in receive mode none

6 RF_TX Set RF in transmit mode none

7 RF_OFF Set RF in sleep mode none

8 INTERVAL Set sampling time interval Interval time (seconds)

Page 36: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Sensor node

Sensor Node

Page 37: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Application

Central air-conditioner monitoring system

Page 38: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Application

Permafrost monitoring of Tibet-Qinghai railway

Page 39: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Application

Outer Space Exploration

Page 40: The Implementation of IPv6 Wireless Sensor Network Nodes University of Electronic Science and Technology of China UESTC

Thanks !