tinyos – time to roll (routing over low power and lossy networks)

57
TinyOS – Time to ROLL TinyOS – Time to ROLL (Routing over Low power and Lossy (Routing over Low power and Lossy Networks) Networks) David E. Culler 1 st European TinyOS Technology Exchange TTX VI Feb 10, 2009

Upload: oriole

Post on 14-Jan-2016

37 views

Category:

Documents


1 download

DESCRIPTION

TinyOS – Time to ROLL (Routing over Low power and Lossy Networks). David E. Culler 1 st European TinyOS Technology Exchange TTX VI Feb 10, 2009. A decade ago…. Traditional Systems. Well established layers of abstractions Strict boundaries Ample resources - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

TinyOS – Time to ROLLTinyOS – Time to ROLL(Routing over Low power and Lossy Networks)(Routing over Low power and Lossy Networks)

David E. Culler1st European TinyOS Technology Exchange

TTX VIFeb 10, 2009

Page 2: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 2

A decade ago…

Page 3: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 3

Traditional Systems

• Well established layers of abstractions

• Strict boundaries

• Ample resources

• Independent Applications at endpoints communicate pt-pt through routers

• Well attended

User

System

Physical Layer

Data Link

Network

Transport

Network Stack

Threads

Address Space

Drivers

Files

Application

Application

Routers

Page 4: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 4

by comparison, WSNs ...

• Highly Constrained resources– processing, storage, bandwidth, power

• Applications spread over many small nodes– self-organizing Collectives – highly integrated with changing environment and network– communication is fundamental

• Concurrency intensive in bursts– streams of sensor data and

network traffic

• Robust– inaccessible, critical operation

• Unclear where the boundaries belong

– even HW/SW will move

=> Provide a framework for:

• Resource-constrained concurrency

• Defining boundaries

• Appl’n-specific processing and power management

allow abstractions to emerge

Page 5: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 5

Internet Research Perspective…then

• “Resource constraints may cause us to give up the layered architecture.”

• “Sheer numbers of devices, and their unattended deployment, will preclude reliance on broadcast communication or the configuration currently needed to deploy and operate networked devices.”

• “There are significant robustness and scalability advantages to designing applications using localized algorithms.”

• “Unlike traditional networks, a sensor node may not need an identity (e.g. address).”

• “It is reasonable to assume that sensor networks can be tailored to the application at hand.”

Page 6: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 6

And Now: Complete IPv6 in TinyOS

• Footprint, power, packet size, & bandwidth

ROM RAM

CC2420 Driver 3149 272

802.15.4 Encryption 1194 101

Media Access Control 330 9

Media Management Control 1348 20

6LoWPAN + IPv6 2550 0

Checksums 134 0

SLAAC 216 32

DHCPv6 Client 212 3

DHCPv6 Proxy 104 2

ICMPv6 522 0

Unicast Forwarder 1158 451

Multicast Forwarder 352 4

Message Buffers 0 2048

Router 2050 106

UDP 450 6

TCP 1674 50

24038 ROM

3598 RAM

(including runtime)

* Production implementation on TI msp430/cc2420

Page 7: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 7

… and in Open Source

Page 8: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 8

and Power and Reliability …

Data Rate Sensitivity (Router)

Data Rate Sensitivity (Router)

Data Rate Sensitivity (Edge)

Data Rate Sensitivity (Edge)

Deployment Duty CycleDeployment Duty Cycle Deployment ReliabilityDeployment Reliability

Page 9: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 9

Where Did We Go Wrong?

1/9/2001 Endeavour Retreat 6

Laptop “lab kit”

Parallel Portfor programming

serial Portfor basestation

“Sensor stacks”on central connector

Page 10: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 10

Internet – Networks of Networks

• Networks– Ethernet

– WiFi

– Serial links

• connect hosts and devices and other networks together

• Horizontally integrated

• Peripheral Interconnects

– USB, Firewire

– IDE / SCSI

– RS232,RS485

– IRDA

– BlueTooth

• connect one or more devices to a host computer

• Vertically integrated– Physical link to

application

ethernet

wifi

LoWPAN

vs

Page 11: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 11

Which are real sensors nets like?

WiFiEthernet

GPRS Controllers

FieldUnits

DataAnalytics

TrendingMonitoring

Management

OperationsRS232RS485

hartcomm.org

Page 12: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 12

A Network Starts with a Router

IP/LoWPAN Router

IP/LoWPAN Sensor Router

IP Device

IP Network(powered)

LoWPAN-Extended IP Network

IP/LoWPAN Router

IP/LoWPAN Sensor Router

IP Device

IP Network(powered)

LoWPAN-Extended IP Network

Page 13: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 13

Mote/TinyOS – let chaos reign

SmartDustWeC

Rene

Intelrene’

97

LWIM-III(UCLA)

9998 00 01 0302 04 0605 07

DARPA

SE

NS

IT

LWIM

Exp

edit

ion

NE

ST

NE

TS

/ N

OS

S

CE

NS

S

TC

NSF

Cyb

er-

Phy

sica

l

WINS(UCLA/ROckwell)

Mica

Intel/UCBdot

InteliMOTE

XBOWcc-dot

XBOWmica2

XBOWrene2

Intelcf-mica

Boschcc-mica

Dust Incblue cc-TI

digital sunrain-mica

XBOWmica

zeevo BT

Telos

XBOWmicaZ

IntelMOTE2

EyesBTNode

trio

8 kB rom½ kB ram

48 kB rom10 kB ram802.15.4

Page 14: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 14

And rain it did…

2002

2003

2004

2005

2006

2007

1999

2000

2001

2008

LinkLinkLinkLink

NetworkNetworkNetworkNetwork

TransportTransportTransportTransport

ApplicationApplicationApplicationApplicationS

PIN

SPIN

SPIN

SPIN

Bro

ad

cast

Sto

rmB

road

cast

Sto

rmB

road

cast

Sto

rmB

road

cast

Sto

rm

Tin

yO

S 0

.6Tin

yO

S 0

.6Tin

yO

S 0

.6Tin

yO

S 0

.6

WooM

AC

WooM

AC

WooM

AC

WooM

AC

GA

FG

AF

GA

FG

AF

S-M

AC

S-M

AC

S-M

AC

S-M

AC

Alo

ha P

SA

loh

a P

SA

loh

a P

SA

loh

a P

S

PS

FQPS

FQPS

FQPS

FQ

GD

IG

DI

GD

IG

DI

CO

DA

CO

DA

CO

DA

CO

DA

Min

tRou

teM

intR

ou

teM

intR

ou

teM

intR

ou

te

T-M

AC

T-M

AC

T-M

AC

T-M

AC

RM

ST

RM

ST

RM

ST

RM

ST

B-M

AC

B-M

AC

B-M

AC

B-M

AC

Mu

ltih

op

LQI

Mu

ltih

op

LQI

Mu

ltih

op

LQI

Mu

ltih

op

LQI

Fusi

on

Fusi

on

Fusi

on

Fusi

on

Delu

ge

Delu

ge

Delu

ge

Delu

ge

FPS

FPS

FPS

FPS

Wis

eM

AC

Wis

eM

AC

Wis

eM

AC

Wis

eM

AC

SP

SPSP

SP

Dri

pD

rip

Dri

pD

rip

Dra

inD

rain

Dra

inD

rain

BV

RB

VR

BV

RB

VR

Red

wood

sR

ed

wood

sR

ed

wood

sR

ed

wood

s

Nort

h S

ea

Nort

h S

ea

Nort

h S

ea

Nort

h S

ea

SC

P-M

AC

SC

P-M

AC

SC

P-M

AC

SC

P-M

AC

PED

AM

AC

SPED

AM

AC

SPED

AM

AC

SPED

AM

AC

S

X-M

AC

X-M

AC

X-M

AC

X-M

AC

Volc

an

oV

olc

an

oV

olc

an

oV

olc

an

o

CTP

CTP

CTP

CTP

Flu

shFl

ush

Flu

shFl

ush

Gold

en

Gate

Bri

dg

eG

old

en

Gate

Bri

dg

eG

old

en

Gate

Bri

dg

eG

old

en

Gate

Bri

dg

e

S4

S4S4

S4

Dip

DipDip

Dip

Page 15: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 15

A Low-Power Standard Link

802.15.4 802.15.1 802.15.3 802.11 802.3

Class WPAN WPAN WPAN WLAN LAN

Lifetime (days) 100-1000+ 1-7 Powered 0.1-5 Powered

Net Size 65535 7 243 30 1024

BW (kbps) 20-250 720 11,000+ 11,000+ 100,000+

Range (m) 1-75+ 1-10+ 10 1-100 185 (wired)

GoalsLow Power, Large Scale,

Low Cost

Cable Replacement

Cable Replacement Throughput Throughput

• Low Transmit power, Low SNR, modest BW, Little Frames

• Reined in the Phy Chaos, allowed MAC chaos to Reign

Page 16: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 16

Key Developments

• Event Driven Execution closely tied to storage mgmt– reliable concurrency, small footprint, and low-power usage

• Idle listening– Radio power: transmit ≈ receive ≈ just listening

– All the energy is consumed by listening for a packet to receive

» E = P*Time

=> Turn radio on only when there is something to hear

• Reliable routing on Low-Power & Lossy Links– Power, Range, Obstructions => multi-hop

– Always at edge of SNR => loss happens

=> monitoring, retransmission, and local rerouting

• Trickle – don’t flood (tx rate < 1/density, and < info change)– Connectivity is determined by physical points of interest, not network

designer. May have huge number of neighbors, so …

– never naively respond to a broadcast, re-broadcast very very politely

Page 17: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 17

Meanwhile: Key IPv6 Contributions

• Large simple address– Network ID + Interface ID

– Plenty of addresses, easy to allocate and manage

• Autoconfiguration and Management– ICMPv6

• Integrated bootstrap and discovery– Neighbors, routers, DHCP

• Protocol options framework– Plan for extensibility

• Simplify for speed– MTU discovery with min

• 6-to-4 translation for compatibility

PrefixPrefix IIDIID

ICMPv6ICMPv6ICMPv6ICMPv6

IPv6 IPv6 BaseBase

IPv6 IPv6 BaseBase HbH OptHbH OptHbH OptHbH Opt RoutingRoutingRoutingRouting FragmeFragme

ntnt

FragmeFragmentnt Dst OptDst OptDst OptDst Opt

128 bits

Page 18: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 18

IPv6 over 802.15.4: Not an obvious fit

Link frame

ctrl src UIDlen chkdst UID link payload

cls flow len hops src IP dst IP net payload

Network packet

UDP datagram or TCP stream segment

transport header application payload

…, modbus, BacNET/IP, … , HTML, XML, …, ZCL

16 B

128 Bytes MAX

1280 Bytes MIN

16 B

40 B + options

NH

Page 19: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 19

802.5Token Ring

6LoWPAN adaptation layer

802.3Ethernet

802.11WiFi802.3a

Ethernet10b2

802.3iEthernet

10bT

802.3yEthernet100bT

802.3abEthernet1000bT

802.3anEthernet1G bT

802.11aWiFi802.11b

WiFi802.11gWiFi802.11n

WiFi

X3T9.5FDDI

SerialModem

GPRS

ISDNDSL

Sonet

Transport (UDP/IP, TCP/IP)

Application (Telnet, FTP, SMTP, SNMP, HTTP)

Diverse Object and Data Models (HTML, XML, …, BacNet, …)

802.15.4LoWPAN

Network (IP)

Link2: link

3: net

4: xport

7: app

1: phy

6LoWPAN

Page 20: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 20

IPv6 Header Compression

• http://www.visi.com/~mjb/Drawings/IP_Header_v6.pdf

v6 zero

derive from 802.15.4 header

derive from 802.15.4 header

In 802.15.4 header

in HC byte

uncompressed

Page 21: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 21

6LoWPAN – IP Header Optimization

• Eliminate all fields in the IPv6 header that can be derived from the 802.15.4 header in the common case

– Source address : derived from link address

– Destination address : derived from link address

– Length : derived from link frame length

– Traffic Class & Flow Label : zero

– Next header : UDP, TCP, or ICMP

• Additional IPv6 options follow as options

Link frame

ctrl src UIDlen chkdst UID

Network packet40 B

6LoWPAN adaptation header

hops

3 B

cls flow len hops src IP dst IP net payloadNH

Page 22: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 22

Energy Consumption Analysis

Energy Δ forfixed payload

Payload Δ

**

Page 23: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 23

Multi-Hop Communication => Routing

• Short-range radios & Obstructions => Multi-hop Communication is often required

– i.e. Routing and Forwarding

– That is what IP does!

• “Mesh-under”: multi-hop communication at the link layer

– Still needs routing to other links or other PANs

• “Route-over”: IP routing within the PAN => ROLL

PAN

Page 24: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 24

IP Link ⇒ Broadcast DomainIP Link ⇒ Broadcast DomainIP Link ⇒ Broadcast DomainIP Link ⇒ Broadcast Domain

Structured DecompositionStructured DecompositionStructured DecompositionStructured Decomposition

Embedded IPv6 in Concept

IP Link ⇒ Always OnIP Link ⇒ Always OnIP Link ⇒ Always OnIP Link ⇒ Always OnRetain illusion even when always off

Retain strict modularitySome key cross-layer visibility

IPv6 can support a semi-broadcast link with few changes

IP Link ⇒ “Reliable”IP Link ⇒ “Reliable”IP Link ⇒ “Reliable”IP Link ⇒ “Reliable”Retain best-effort reliability over unreliable links

Page 25: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 25

AutoconfigurationConfiguring Large Numbers of Interfaces

Cur Hop Limit

Managed Addr Config

Other Config

Router Lifetime

Reachable Time

Prefix Length

Autonomous Config

Valid Lifetime

Preferred Lifetime

Prefix

ICMPv6 HdrICMPv6 HdrICMPv6 HdrICMPv6 Hdr Router AdvRouter AdvRouter AdvRouter Adv Prefix InfoPrefix InfoPrefix InfoPrefix Info

RFC 4861 – Neighbor DiscoveryRFC 4861 – Neighbor DiscoveryRFC 4862 – Stateless Addr RFC 4862 – Stateless Addr AutoconfAutoconfRFC 3315 – DHCPv6RFC 3315 – DHCPv6

Existing Options New Options

Network ID

Sequence Number

Router Hops

Flags

MHop MHop InfoInfo

MHop MHop InfoInfo

Trickle

Page 26: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 26

AutoconfigurationConfiguring Large Numbers of Interfaces

StatelessStatelessRFC 4861 + 4862RFC 4861 + 4862

StatelessStatelessRFC 4861 + 4862RFC 4861 + 4862

DHCPv6DHCPv6RFC 3315RFC 3315DHCPv6DHCPv6RFC 3315RFC 3315

L2e 00-17-3B-00-39-12-58-28

L2s 0x0001

L3 2001:abcd::1

L2e 00-17-3B-00-57-17-58-39

L2s 0x0023

L3

L2e 00-17-3B-00-79-49-66-23

L2s 0x0092

L3

L2e 00-17-3B-00-57-17-58-39

L2s

L3

L2e 00-17-3B-00-79-49-66-23

L2s

L3

2001:abcd::230x0023

L2e 00-17-3B-00-39-12-58-28

L2s 0x0001

L3 2001:abcd::1

RequestRequestRequestRequest

ResponsResponsee

ResponsResponsee

RequestRequestRequestRequest

ResponsResponsee

ResponsResponsee

2001:abcd::920x0092

2001:abcd::92

2001:abcd::23

Page 27: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 27

Routing & Forwarding

NetNetNetNet

RouterRouterRouterRouterRouting Routing ProtocolProtocol

Routing Routing ProtocolProtocol

Routing Routing TableTable

Routing Routing TableTablePrefix Next

ICMPvICMPv66

ICMPvICMPv66

LinkLinkLinkLink

Media Management ControlMedia Management ControlMedia Management ControlMedia Management ControlRemote MediaRemote MediaRemote MediaRemote Media Link StatsLink StatsLink StatsLink Stats

Neighbor Table

Addr Period Phase Pending RSSI PRR

Local MediaLocal MediaLocal MediaLocal Media

Sample Period

Sample Phase

DatDataa

DatDataa AckAckAckAck

ForwarderForwarderForwarderForwarderMulticastMulticastMulticastMulticast

Send Send ManageManage

rr

Send Send ManageManage

rr

BufferBufferBufferBufferUnicastUnicastUnicastUnicast

QueueQueueQueueQueue Forwarding Forwarding TableTable

Forwarding Forwarding TableTablePrefix Next

Default

Send Send ManageManage

rr

Send Send ManageManage

rr

Delivering datagrams over multiple hops Delivering datagrams over multiple hops with High reliability and Low Energy usage with High reliability and Low Energy usage Delivering datagrams over multiple hops Delivering datagrams over multiple hops

with High reliability and Low Energy usage with High reliability and Low Energy usage

Page 28: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 28

Cross-Fertilization of WSN and IETF ideas

Default RoutesDefault RoutesDefault RoutesDefault Routes

Discovering LinksDiscovering LinksDiscovering LinksDiscovering LinksICMPv6 HdrICMPv6 HdrICMPv6 HdrICMPv6 Hdr Router AdvRouter AdvRouter AdvRouter Adv MHop InfoMHop InfoMHop InfoMHop Info

Building a Connectivity GraphBuilding a Connectivity GraphBuilding a Connectivity GraphBuilding a Connectivity GraphRouting Routing TableTable

Routing Routing TableTablePrefix Next

Low Routing CostLow Routing Cost

High Routing CostHigh Routing Cost

Selecting the Next HopSelecting the Next HopSelecting the Next HopSelecting the Next HopRouting Routing TableTable

Routing Routing TableTablePrefix Next

Forwarding Forwarding TableTable

Forwarding Forwarding TableTablePrefix Next

Default

• Default route

• Hop-by-hop retry

• Reroute on loss

Page 29: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 29

Complete Embedded IPv6 Stack

LinkLinkLinkLink

NetNetNetNet

TranTranTranTran

AppAppAppApp

Media Management ControlMedia Management ControlMedia Management ControlMedia Management Control

Remote MediaRemote MediaRemote MediaRemote Media Link StatsLink StatsLink StatsLink StatsNeighbor Table

Addr Period Phase Pending RSSI PRR

Local MediaLocal MediaLocal MediaLocal Media

Sample Period

Sample Phase

RouterRouterRouterRouter

Routing Routing ProtocolProtocol

Routing Routing ProtocolProtocol

Routing Routing TableTable

Routing Routing TableTablePrefix Next

StatelesStatelesss

AutoconAutoconff

StatelesStatelesss

AutoconAutoconff

AutoconAutoconff

AutoconAutoconff

DHCPv6DHCPv6DHCPv6DHCPv6

UDPUDPUDPUDP TCPTCPTCPTCP

6Lo

WPA

N A

dap

tati

on

6Lo

WPA

N A

dap

tati

on

6Lo

WPA

N A

dap

tati

on

6Lo

WPA

N A

dap

tati

on

ICMPvICMPv66

ICMPvICMPv66

DatDataa

DatDataa AckAckAckAck

HTTPHTTPHTTPHTTP TelnetTelnetTelnetTelnet SNMPSNMPSNMPSNMP DNSDNSDNSDNS …………

ForwarderForwarderForwarderForwarder

MulticastMulticastMulticastMulticast

Send Send ManageManage

rr

Send Send ManageManage

rr

BufferBufferBufferBufferUnicastUnicastUnicastUnicast

QueueQueueQueueQueue Forwarding Forwarding TableTable

Forwarding Forwarding TableTable

Prefix Next

Default

Send Send ManageManage

rr

Send Send ManageManage

rr

Page 30: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 30

Adding up the piecesROM RAM

CC2420 Driver 3149 272

802.15.4 Encryption 1194 101

Media Access Control 330 9

Media Management Control 1348 20

6LoWPAN + IPv6 2550 0

Checksums 134 0

SLAAC 216 32

DHCPv6 Client 212 3

DHCPv6 Proxy 104 2

ICMPv6 522 0

Unicast Forwarder 1158 451

Multicast Forwarder 352 4

Message Buffers 0 2048

Router 2050 106

UDP 450 6

TCP 1674 50

24038 ROM

3598 RAM

(including runtime)

* Production implementation on TI msp430/cc2420

Page 31: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 31

So what’s Next?

Page 32: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 32

Rein in the Chaos – by layers

LinkLinkLink

NetNetNet

TranTranTran

AppAppApp

Media Management ControlMedia Management ControlMedia Management Control

Remote MediaRemote MediaRemote Media Link StatsLink StatsLink Stats

Neighbor Table

Addr Period Phase Pending RSSI PRR

Neighbor Table

Addr Period Phase Pending RSSI PRR

Local MediaLocal MediaLocal Media

Sample Period

Sample Phase

Sample Period

Sample Phase

RouterRouterRouter

Routing Protocol

Routing Routing ProtocolProtocol

Routing Table

Routing Routing TableTable

Prefix NextPrefix NextStatelessAutoconf

StatelessStatelessAutoconfAutoconf

AutoconfAutoconfAutoconf

DHCPv6DHCPv6DHCPv6

UDPUDPUDP TCPTCPTCPUDPUDPUDP TCPTCPTCP

6LoW

PAN

Adap

tatio

n6L

oWPA

N Ad

apta

tion

6LoW

PAN

Adap

tatio

n ICMPv6

ICMPvICMPv66

DataDataData AckAckAck

HTTPHTTPHTTP TelnetTelnetTelnet SNMPSNMPSNMP DNSDNSDNS ………

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Send Manager

Send Send ManagerManager

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Prefix Next

Default

Send Manager

Send Send ManagerManager

Page 33: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 33

Y-A-MAC?

LinkLinkLink

NetNetNet

TranTranTran

AppAppApp

Media Management ControlMedia Management ControlMedia Management Control

Remote MediaRemote MediaRemote Media Link StatsLink StatsLink Stats

Neighbor Table

Addr Period Phase Pending RSSI PRR

Neighbor Table

Addr Period Phase Pending RSSI PRR

Local MediaLocal MediaLocal Media

Sample Period

Sample Phase

Sample Period

Sample Phase

RouterRouterRouter

Routing Protocol

Routing Routing ProtocolProtocol

Routing Table

Routing Routing TableTable

Prefix NextPrefix NextStatelessAutoconf

StatelessStatelessAutoconfAutoconf

AutoconfAutoconfAutoconf

DHCPv6DHCPv6DHCPv6

UDPUDPUDP TCPTCPTCPUDPUDPUDP TCPTCPTCP

6LoW

PAN

Adap

tatio

n6L

oWPA

N Ad

apta

tion

6LoW

PAN

Adap

tatio

n ICMPv6

ICMPvICMPv66

DataDataData AckAckAck

HTTPHTTPHTTP TelnetTelnetTelnet SNMPSNMPSNMP DNSDNSDNS ………

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Send Manager

Send Send ManagerManager

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Prefix Next

Default

Send Manager

Send Send ManagerManager

• Yet-Another-MAC layer?

• If it is REALLY going to be a standard

– Interoperability ‘within the PAN’ requires compatible MACs.

– 802.15.4 left a big hole

» Beaconing doesn’t work

» No low power defined for FFD

• Perhaps the research community should stop “differentiating” and step forward to make one MAC stick

• Frame formats are not “up for debate”

• Visibility @ Link / Net Interface

Page 34: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 34

Routing - really

LinkLinkLink

NetNetNet

TranTranTran

AppAppApp

Media Management ControlMedia Management ControlMedia Management Control

Remote MediaRemote MediaRemote Media Link StatsLink StatsLink Stats

Neighbor Table

Addr Period Phase Pending RSSI PRR

Neighbor Table

Addr Period Phase Pending RSSI PRR

Local MediaLocal MediaLocal Media

Sample Period

Sample Phase

Sample Period

Sample Phase

RouterRouterRouter

Routing Protocol

Routing Routing ProtocolProtocol

Routing Table

Routing Routing TableTable

Prefix NextPrefix NextStatelessAutoconf

StatelessStatelessAutoconfAutoconf

AutoconfAutoconfAutoconf

DHCPv6DHCPv6DHCPv6

UDPUDPUDP TCPTCPTCPUDPUDPUDP TCPTCPTCP

6LoW

PAN

Adap

tatio

n6L

oWPA

N Ad

apta

tion

6LoW

PAN

Adap

tatio

n ICMPv6

ICMPvICMPv66

DataDataData AckAckAck

HTTPHTTPHTTP TelnetTelnetTelnet SNMPSNMPSNMP DNSDNSDNS ………

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Send Manager

Send Send ManagerManager

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Prefix Next

Default

Send Manager

Send Send ManagerManager

• At layer 3– Not 2, not 7, 3!

• Implemented with routing table, forwarder, and well-defined protocols

– Packets, States, Actions

• ROLL working group in IETF

• Application “requirements”

• Excellent Protocol Survey

• Entering actual work phase

Page 35: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 35

ROLL Internet Drafts

• draft-ietf-roll-protocols-survey -052009-01-26  

• draft-ietf-roll-terminology -00 2008-10-27  

• draft-ietf-roll-building-routing-reqs -05 2009-02-04  

• draft-ietf-roll-home-routing-reqs -062008-11-19  

• draft-ietf-roll-indus-routing-reqs -042009-01-22  

• draft-ietf-roll-urban-routing-reqs -032009-01-08 

Page 36: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 36

The Heart of ROLL

Page 37: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 37

Transport

LinkLinkLink

NetNetNet

TranTranTran

AppAppApp

Media Management ControlMedia Management ControlMedia Management Control

Remote MediaRemote MediaRemote Media Link StatsLink StatsLink Stats

Neighbor Table

Addr Period Phase Pending RSSI PRR

Neighbor Table

Addr Period Phase Pending RSSI PRR

Local MediaLocal MediaLocal Media

Sample Period

Sample Phase

Sample Period

Sample Phase

RouterRouterRouter

Routing Protocol

Routing Routing ProtocolProtocol

Routing Table

Routing Routing TableTable

Prefix NextPrefix NextStatelessAutoconf

StatelessStatelessAutoconfAutoconf

AutoconfAutoconfAutoconf

DHCPv6DHCPv6DHCPv6

UDPUDPUDP TCPTCPTCPUDPUDPUDP TCPTCPTCP

6LoW

PAN

Adap

tatio

n6L

oWPA

N Ad

apta

tion

6LoW

PAN

Adap

tatio

n ICMPv6

ICMPvICMPv66

DataDataData AckAckAck

HTTPHTTPHTTP TelnetTelnetTelnet SNMPSNMPSNMP DNSDNSDNS ………

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Send Manager

Send Send ManagerManager

ForwarderForwarderForwarder

MulticastMulticastMulticast

Send Manager

Send Send ManagerManager

BufferBufferBufferUnicastUnicastUnicast

QueueQueueQueue Forwarding Table

Forwarding Forwarding TableTable

Prefix Next

Default

Prefix Next

Default

Send Manager

Send Send ManagerManager

• Crazy not to support UDP and TCP

• Do we enter a TCP for LLNs renaissance?

• Do we define a new transport?

• What is the “embedded sockets API?”

Page 38: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 38

Issues in Communication Abstraction• Names

– What are they?– What do they mean? What is their scope?– How are they allocated?– How are they translated into useful properties

» Address? Physical Resource?

• Storage– Transmit

» When can it be reused? How do you know? What do you do when it is full?

– Receive» When is it allocated? Reclaimed? By whom? What

happens when it overflows?– Asynchronous event

» How do you know that something has arrived?

Page 39: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 39

Answers: Naming• TinyOS Active Messages

– TOS_local_addr, 16 bits, only within “a network”, allocated at program download time

– Scope limited to TOS_group, within PAN, Channel, and physical extent.

– The standards that try to do it all with IEEE 802.15.4 16 bit short address are not much better

• IP Architecture– Link name: IEEE 802.15.4 => EUID64 & SA16

» EUID64 globally unique, SA16 assigned to be unique over the PAN

– Net name: IP address» Prefix | Interface Id» Must be unique within routability extent» Several IP address: Link Local, Global, Multicast, …

- Service name: Port- Hostname Translated to IP by DNS

Page 40: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 40

Answers: Storage

• TinyOS Active Messages– Sender app allocates send buffer, OS owns it till sendDone

event

– OS provides App with recv buffer, app must return it or a replacement

• BSD Sockets– Sender app allocate buffer, copied to kernel on send

– Receiver allocates buffer and passes pointer to kernel, kernel copies

– Additional sets of buffer managed within the kernel

• TinyOS Sockets ???

Page 41: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 41

Example: UDP Interface

• Wiring to a UDP interface is enough for sendto – no allocate• Standard Unix sockaddr_in6_t• Bind – associates the component that uses the interface with the port

– Starts receiving whatever datagrams come in on it

• Sendto sends a datagram from a buf to an IP destination– Neighbor, intra-PAN, inter-network (wherever it needs to go!)– Linklocal address is 1-hop neighbor– Pan-wide routable prefix– Error when not in network or overrun transmit resources

• Recvfrom gets a buffer with a datagram and metadata about it• Able to fill the 15.4 frame without knowing details of header

compression

interface Udp { command error_t bind( uint16_t port ); command uint16_t getMaxPayloadLength( const sockaddr_in6_t *to ); command error_t sendto( const void *buf, uint16_t len, const sockaddr_in6_t *to ); event void recvfrom( void *buf, uint16_t len, sockaddr_in6_t *from,

link_metadata_t *metadata );}

Page 42: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 42

Example: UDP echo serviceconfiguration EchoUdpC { }

implementation { components KernelC; components EchoUdpP as EchoP; EchoP.Boot -> KernelC.Boot; EchoP.Udp -> KernelC.Udp0;}

module EchoUdpP { uses interface Boot, Udp;}implementation { event void Boot.booted() { call Udp.bind( ECHO_PORT ); /* bind to port 7 */ } event void Udp.recvfrom( void *buf, uint16_t len,

sockaddr_in6_t *from, link_metadata_t *linkmsg ) {

call Udp.sendto( buf, len, from ); /* echo msg back */ }}

Page 43: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 43

And what about TCP

• UDP is a datagram transport– Essentially the same as AM

– Fits naturally in event-driven model

– Can use NesC platform independent data structure to have unambiguous packet formats without hton / ntoh error prone bit twiddling.

• But TCP is a stream protocol…

Page 44: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 44

TCP Interface

• Transitions of the TCP protocol reflected as events• Recv per segment• Here, appln allocates send buffer but stack manages it.• Send is not split-phase (!!!)

interface Tcp { command error_t bind(uint16_t port, uint8_t *buf, uint16_t bufsize); event bool accept( sockaddr_in6_t *to ); command error_t connect( const sockaddr_in6_t *to, uint8_t *buf,

uint16_t bufsize ); event void connected(); command error_t send( const void *buf, uint16_t len ); event void acked(); event uint16_t recv( void *buf, uint16_t len ); command error_t close( bool force ); event void closed(); }

Page 45: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 45

TCP echo servermodule EchoTcpP { uses interface Boot, Tcp; }implementation { uint8_t m_buf[ BUF_SIZE ]; /* Transmit buffer */ event void Boot.booted() { call Tcp.bind( ECHO_PORT, m_buf, sizeof(m_buf) ); } event bool Tcp.accept( sockaddr_in6_t *to ) { return TRUE; } event void Tcp.connected() { } event void Tcp.acked() { } event uint16_t Tcp.recv( void *buf, uint16_t len ) { return ( call Tcp.send( buf, len ) == SUCCESS ) : len ? 0;} event void Tcp.closed() { /* setup socket for new connection */ call Tcp.bind( ECHO_PORT, m_buf, sizeof(m_buf) ); }

Page 46: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 46

Event-Driven Execution of Services

Hardware

Phy

Link

Network

Transport

HplSignal

RadioFlash MCU

Ports ADCTimers

Sof

twar

e

Kernel

HTTP – application protocol

Web Server Application

Drivers

Data Presentation

Hardware

Phy

Link

Network

Transport

HplSignal

RadioFlash MCU

Ports ADCTimers

Sof

twar

e

Kernel

HTTP – application protocol

Web Server Application

Drivers

Data Presentation

Start

Timer Fire

TCP

Bind

recv

Start

Service request

Page 47: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 47

Split-Phase Data Acquisition

Hardware

Phy

Link

Network

Transport

HplSignal

RadioFlash MCU

Ports ADCTimers

Sof

twar

e

Kernel

HTTP – application protocol

Web Server Application

Drivers

Data Presentation

Hardware

Phy

Link

Network

Transport

HplSignal

RadioFlash MCU

Ports ADCTimers

Sof

twar

e

Kernel

HTTP – application protocol

Web Server Application

Drivers

Data Presentation

Sample

Ready

Read

ReadDone

Page 48: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 48

Examples - Tasks

Hardware

Phy

Link

Network

Transport

HplSignal

RadioFlash MCU

Ports ADCTimers

Sof

twar

e

Kernel

HTTP – application protocol

Web Server Application

Drivers

Data Presentation

Hardware

Phy

Link

Network

Transport

HplSignal

RadioFlash MCU

Ports ADCTimers

Sof

twar

e

Kernel

HTTP – application protocol

Web Server Application

Drivers

Data Presentation

Sample

Ready

fired

readDone

serviceReqnotify

fired

Page 49: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 49

HTTP event bool HttpTcp.accept( sockaddr_in6_t *to ) { serverState = LISTENING; return TRUE; } event void HttpTcp.connected() { serverState = CONNECTED; init_pump(); } event uint16_t HttpTcp.recv( void *inbuf, uint16_t len ) { if (httppump(inbuf,len)) { switch (http_method) { case HTTP_GET : signal Http.GETservice (url, uindex); break; case HTTP_POST: signal Http.POSTservice(url, uindex); break; default: call HttpTcp.close( FALSE ); } } return len; } command error_t Http.serviceDone() { call HttpTcp.close( FALSE ); return SUCCESS; } command error_t Http.send( const void *buf, uint16_t len ) { return call HttpTcp.send( buf, len ); }

event void HttpTcp.acked() { }

event void HttpTcp.closed(){call HttpTcp.bind(port, resp, respLen);}

Page 50: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 50

Resource Blueprint at the Topconfiguration WebSense { }implementation { components KernelC; components WebC as WebC; /* Web request service */ components HttpC as HttpC; /* TCP HTTP (port 80) service */ components new TimerMilliC() as HttpTimer; /* Protocol deadman */ components Msp430Adc12C; /* Hardware ADC abstraction */ components Msp430PortsC; /* Hardware IO Ports */

WebC.Http -> HttpC.Http; /* Protocol interface */ WebC.Boot -> KernelC.Boot; WebC.IPv6Addresses -> KernelC.IPv6Addresses; WebC.Time -> KernelC.GlobalTime; HttpC.HttpTcp -> KernelC.Tcp0; HttpC.IPv6Addresses -> KernelC.IPv6Addresses; HttpC.Timer -> HttpTimer; /* Digital inputs */ components new DigitalInC("Door") as Din0; WebC.Door -> Din0.DigitalIn; Din0.Pin -> Msp430PortsC.Port1[2]; Din0.PinInt -> Msp430PortsC.Port1Interrupt[2];

/* Analog inputs */ components TempIntC; WebC.Temp -> TempIntC.TempInt; TempIntC.ADC -> Msp430Adc12C.Msp430Adc12[INCH_10]; /* Internal temp */ components new AnalogInC(REFVCC, "Pot") as TrimPot; WebC.Pot -> TrimPot.Sensor; TrimPot.ADC -> Msp430Adc12C.Msp430Adc12[INCH_4 ];}

Page 51: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 51

… or if you prefer Zigbee Profiles

• http://www.ietf.org/internet-drafts/draft-tolle-cap-00.txt

“A UDP/IP Adaptation of the ZigBee Application Protocol”

Page 52: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 52

what it means for sensors

• Low-Power Wireless Embedded devices can finally be connected using familiar networking technology,

– like ethernet (but even where wiring is not viable)

– and like WiFi (but even where power is not plentiful)

• all of these can interoperate in real applications

• Interoperate with traditional computing infrastructure

• Utilize modern security techniques

• Application Requirements and Capacity Plan dictate how the network is organized,

– not artifacts of the underlying technology

– Gateways and Proxies may or may not be at the media boundary

– …

Page 53: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 53

Making sensor nets make sense

802.15.4, …802.11Ethernet Sonet

XML / RPC / REST / SOAP / OSGI

IP

IETF 6lowpan

Web Services

TCP / UDP

HTTP / FTP / SNMP Pro

xy

/ G

ate

wa

y

LoWPAN – 802.15.4

• 1% of 802.11 power, easier to embed, as easy to use.

• 8-16 bit MCUs with KBs, not MBs.

• Off 99% of the time

ROLL

Page 54: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 54

• Thanks

Page 55: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 55

Technology Transformation - Bottom Line

• Sensors have become “physical information servers”

• Treat them as “information servers”

hartcomm.org Microcontroller

Radio

Flash Storage

Network

Page 56: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 56

Industrial Interconnects

• BACnet– RS-232 & RS-485 => IEEE 802.3 via BACnet/IP

• LONworks– Twisted Pair & Power Line => LonTalk/IP

• Common Industrial Protocol (CIP)– CAN & ControlNet => EtherNet/IP

• SCADA– Prop. RS-485 & Leased Line & Prop.

Radios => ModBUS => Ethernet => TCP/IP

• FieldBus– Modbus, Profibus, Ind. Ethernet,

Foundation HSE, H1, …SP100.11a?

In 2000, ODVA and CI introduced another member of the CIP family: EtherNet/IP, where “IP” stands for “Industrial Protocol.” In this network adaptation, CIP runs over TCP/IP and therefore can be deployed over any TCP/IP supported data link and physical layers, the most popular of which is IEEE 802.311, commonly known as Ethernet. The universal principles of CIP easily lend themselves to possible future implementations on new physical/ data link layers. [The Common Industrial Protocol (CIP) and

the Family of CIP Networks (Pub 123 )]

Specific LegacyPhysical Link

TCP/UDP/IP

Many IP links

ImplementationGlue

Object and Data Model

Page 57: TinyOS – Time to ROLL (Routing over Low power and Lossy Networks)

ETTX 57

A Decade Ago

Towards System Architecture for Tiny Networked Devices

David Culler

http://www.cs.berkeley.edu/~culler

U.C. Berkeley

Wireless hoo-hah

5/30/2000

5/30/2000 wireless hoo hah 2

An End-to-end Perspective

• Desktops– max out at few 100M– in your face– connected to the infrastructure

• Ubiquitous Devices– billions– sensors / actuators– PDAs / smartphones / PCs– heterogeneous

ServicePath

• Scalable Infrastructure– highly available– persistent state (safe)– databases, agents– service programming environment

5/30/2000 wireless hoo hah 6

TOS Component

Messaging Component

init

Po

wer

(mo

de)

TX

_pa

cke

t(bu

f)

TX

_pa

cke

t_d

one

(s

ucc

ess

)R

X_p

ack

et_

done

(b

uffe

r)

Internal State

init

pow

er(m

ode

)

send

_m

sg(a

ddr

, typ

e,

data

)

msg

_re

c(ty

pe,

dat

a)

msg

_sen

d_do

ne

(su

cce

ss)

send_msg_thread

/* Messaging Component Declaration */

//ACCEPTS:

char TOS_COMMAND(AM_SEND_MSG)(char addr,char type, char* data);

void TOS_COMMAND(AM_POWER)(char mode);

char TOS_COMMAND(AM_INIT)();

//SIGNALS:

char AM_MSG_REC(char type, char* data);

char AM_MSG_SEND_DONE(char success);

//HANDLES:

char AM_TX_PACKET_DONE(char success);

char AM_RX_PACKET_DONE(char* packet);

//USES:

char TOS_COMMAND(AM_SUB_TX_PACKET)(char* data);

void TOS_COMMAND(AM_SUB_POWER)(char mode);

char TOS_COMMAND(AM_SUB_INIT)();