Wireless USB Protocol: John S. Howard

Download as pdf or txt
Download as pdf or txt
You are on page 1of 38

Wireless USB Protocol

John S. Howard
Senior Architect
Intel Corporation
Agenda

Protocol Components
Data Transfers (general model)
Device Notifications
Flow Control

2
Wireless USB Channel
Review
WiMedia Physical Layer
Beacon
Channel Time Beacon
Beacon Superframe n Superframe n+1
Period Period Period
DRP DRP DRP DRP DRP DRP
WUSB WUSB WUSB WUSB WUSB WUSB
t=0 t=0 t=0
WiMedia
MAC

M M M M M M M M M M
M M M M M M M M M M Wireless USB Channel
C C C C C C C C C C

The Wireless USB Channel is encapsulated by the WiMedia channel


Wireless USB channel is continuous sequence of linked control packets
transmitted by the Host during reserved WiMedia channel time
WUSB time is reserved from WiMedia channel time (DRPs)
Called MMCs Micro-schedule Management Commands
All Wireless USB Data communications are over the Wireless USB Channel

3
Packet Layout
N * 6 OFDM Symbols 12 OFDM Symbols 30 OFDM Symbols

msb lsb
Non-secure Packet Pad Tail Payload Tail MAC PHY
FCS HCS PLCP Preamble
Format Bits Bits Variable Length: Z or more bytes Bits Header Header

WUSB
MIC Application Payload SFN Encrypt Rsrvd TKID Acc Info Seq. Control SrcID DestID Frame
Hdr
(8) (Variable Length: 0 to MaxPacketSize) (6) Offset (2) (1) (3) (2) (2) (2) (2) Control (2)
(2)
Secure Packet Isochronous
Type [8:6] Delivery Ident/Control Frame Subtype [12:9]
Format Packet Format (011B) Data Frame [12] = 1B; [11:9] = Stream Index
(001B) Control Frame [12:9] = Application Defined Control Value

bmStatus bmAttributes Endpoint Number [3:0]


(1) (1) Packet ID [6:4]
bNumIsoSegments (1)
wPresentationTime (2)
Isochronous Header(3)
Isochronous Segment0
wLength (2)
Isochronous Segment1 Segment Data (wLength)
Isochronous SegmentbNumIsoSegments -1

Cypher Text
(Encrypted Data)

WiMedia MAC Packet format


Utilizes Secure frame format
4
Wireless USB Channel

MMC plus time


Channel Time Dynamically Allocated for Data Communications
till next MMC Between the Host and Devices in its Wireless USB Cluster

MMC MMC

HDR
HDR

Information
Elements

Next MMC Time

Basic
Transaction Group
structure used to
maintain Wireless USB Channel
5
Transaction Group
Channel Time Allocations [WCTA_IE]

Data & Handshake Phase & Device Notification Time Slots

MMC MMC
Protocol
Attributes Time

WXCTA [EOL]
WXCTA [0]

W XCTA [1]

HDR
HDR
WCTA_IE Header

Endpoint Info Slot


Flags
Slot Type

Start Time
Start Time (s)
Type-Specific Start Time is Measured from the
beginning of the MMC packet(s)

Next MMC Time

Transaction Group

6
Transaction Group
Slot Durations

Slot time durations are derived from adjacent


WXCTA blocks
OUTs device know when they can stop listening
INs devices transmit what was requested
EOL WXCTA is always required to be present
MMC MMC
Protocol Protocol
Attributes Attributes Time Time
WX CTA [1]
WX CTA [0]
WCTA_IE Header

W XCTA [EOL]
HDR

HDR
Endpoint Info Endpoint Info Slot [0] Slot [1]
Flags Flags
Slot Type Slot Type

Start Time Start Time


Start Time [0] Start Time [1]

Type-Specific Type-Specific

Next MMC Time

Transaction Group

7
Time Slot Allocations

Three types of time slots:


WDRCTA (Device Receive)
WDTCTA (Device Transmit)
WDNTSCTA
(Device Notification) time slot
MMC MMC
WDRCTA WDNTSCTA WDTCTA
W_CTA HDR

WDNTSCTA
WDRCTA

WDTCTA

8
Time Slot Allocations [cont.]

WDRCTA, WDTCTAs are used for Transaction Protocol


Control, Bulk, Interrupt and Isochronous data streams
Access is : guaranteed time slot
Schedule based on client application data flow needs
WDNTSCTAs used to emulate USB signaling events
Connect, disconnect, etc.
Access is : contention based - Slotted Aloha
Host schedules sufficient number of slots to provide
adequate service for the cluster

9
Transaction Group
Protocol Synchronization

Scheduled Time Slots in MMC

MMC MMC
preamble preamble
(n-1) TS[0] TS[1] TS[2] TS[3] TS[4] (n)

t=0 Time at which a t=0


receiver must be
Slot start time listening before MMC start time
according to the scheduled according to
Time at which a Devices local start of the MMC Devices local
Receiver must be tG UARDTIME clock (MMC(n-1) tG UARDTIME clock
listening before NextMMC)
the Host could begin
slot start time Transmitter could
begin transmitting transmitting
anywhere in this MMC(n) anywhere
window in this window
(t MAXDRIFT ) (t MAXDRIFT )

10
Transaction Group
Protocol Synchronization (cont.)

PHY_ACTIVE Sync Delay


24 OFDM Symbols

Radio Medium
PLCP Preamble PLCP Header

t0
30 OFDM Symbols

t0 is the time of the first symbol of the MMCs


preamble
Devices can calculate this from the edge of
PHY_ACTIVE

11
Time Slot Scheduling
Requirements
Host Transmitted Packets Device Transmitted Packets

MMC MMC
TS[0] TS[1] TS[2] TS[3] TS[4]

tB USTURNI NTERS LOTTIMEE Standard


data PHY Hdr
Preamble

MMC
Packet
t INTERS LOTTIME Standard
data + PHY Hdr Data Packet
tGUARDTIME Preamble for TS[3]

Standard Data Packet


data t BUSTURNI NTERSLOTT IME PHY Hdr for TS[2]
Preamble

Standard
data t INTERS LOTTIME PHY Hdr Data Packet
Preamble for TS[1]

The first packet transmitted in a protocol


Standard Data Packet
MMC tI NTERS LOTTIME Preamble PHY Hdr for TS[0] time slot must have a standard preamble

12
Data Burst Timing

MMC to first Data OUT : IPGs between burst packets


MIFS (1.875 s) is fixed (MIFS)
MMC to first Data IN : First packet Preamble must
Bus Turn Time be Standard Length
Bus Turn + Guard Time Host determines subsequent
(SIFS + 1s) (11 s) preamble to use
OUT Data Phase Time Slot

Standard Short /Std


MMC PHY Hdr data PHY Hdr data
Preamble Preamble

tINTERSLOTTIME tSTREAMIPG
tSTREAMIPG

tBUSTURNINTERSLOTTIME
Standard PHY Hdr data Short/Std PHY Hdr data
MMC Preamble Preamble

IN Data Phase Time Slot


13
Agenda

Protocol Components
Data Transfers (general model)
Device Notifications
Flow Control

14
Data Stream Synchronization
Basic Model

Protocol-level support for Transmit


Window
Receive
Window
reliable data delivery 9
0
1
Data Packet Burst
(S0, S1, S2, S3) 9
0
1
8 2 8 2

Identifies: 7 3 7 3
6 4 6 4
5 5
Data ordering 0 0
9 1 1
requirements 8 2 Acknowledgement
8
9
2
(0011110000 B)
3
Guarantees advancement 7
6 4
7
6 4
3

of data stream only after 5 5

reliable data delivery


Transmitter sends data packets associated
Terms: with Transmit window Sequence numbers
Receiver acknowledges with new receive
Maximum Burst Size window (what is available now)
Maximum Sequence Protocol rules for recovering lost packets,
avoiding sequence range wrap, etc.
Maximum Sequence See Bursting Session
Distance
15
Transaction Transmit Bit Rate

MMCs are transmitted at base signaling rate (53.3 Mb/s)


Host dictates transmit bit rate for data and handshake
phase transmissions
Transmit bit rate applies to entire phase
OUTs : host uses only TBRs supported by device (assumes
Tx/Rx symmetry)
INs : WDTCTA.PHY_TXRate directs which TBR device must
use during protocol time slot
Handshakes:
Host must use base signaling rate for a handshake time slot
(OUTs)
Host must ensure a data phase time slot is always large enough to
accommodate a handshake transmitted at base signaling rate
16
Transaction Format
General Model
Idle

IN OUT

Token MMC HDR W DTCTA HDR W DRCTA WDT CTA

Direction = IN = 1
bvDINAck Direction = OUT = 0
PHY_TXRate
Smashed MMC Data not Ready, or Internal Error Smashed MMC

NAK or
DATA HNDSK DATA Number of packets in

Data OUT Phase Data Packets


(Seq# N) STALL (Seq# N)
Data IN Phase Data Packets

data phase depends on


Transaction Burst Size
or available data.
DATA DATA The next Sequence
(Seq# N+1) (Seq# N+1) number is always
Data derived (N+1) modulo

... ... MaxSequence.

DATA DATA
(Seq# N+Y) (Seq# N+Y)

Handshake ACK (bvAckCode)


HNDSK
MMC HDR W DTCTA or NAK or STALL

bvDINAck
Idle

Idle

17
Data IN Transfer
Streaming Example

TokenI.bvDINAcK =002H
TokenI .bvDINAcK =001 H

MMC MMC
Data (S0) Data (S 1)
(Token I)

(Token I)
W DTCTA

W DTCTA
HDR
HDR

Transaction Group N Transaction Group N + 1

Transaction 1

Transaction 0 Transaction 2

WDTCTA (IN) DATA(S0) WDTCTA (IN) DATA(S1) WDTCTA (IN)



bvDINAck = 001H (Use Data) bvDINAck = 002H (Use Data) bvDINAck = 001H

MMC Device EP TX MMC Device EP TX Host TX (MMC)

18
Data IN Transfer
End Of Transfer Example

Blank W DTCTA
BlanK .wStart = NextWxCTA.wStart
bvDINAcK=002H TokenI.bvDINAcK=000H
MMC MMC
Data (S1)
(Token I)

(Token I)
W DTCTA
W DTCTA

W DTCTA
HDR

HDR

EOL
Transaction Group N Transaction Group N + 1

Transaction N

Transaction N-1
Blank WDTCTA (IN)
WDTCTA (IN) DATA(S1) bvDINAck = 000H
bvDINAck = 002H (Use Data) wStart = NextWxCTA.wStart
End of List WxCTA (EOL)

MMC Device EP TX MMC

19
Data IN Transfer
Short Packet Example

TokenI.bvDINAcK =002H
TokenI .bvDINAcK =001 H

MMC MMC
Data (S0)

(Token I)
(Token I)

W D TCTA
W D TCTA

HDR
HDR

LastPacketFlag = 1B
Blank W DT CTA

Transaction Group N Transaction Group N + 1

Transaction 1
Transaction 0
DATA(S0)
WDTCTA (IN) LastPacketFlag = 1 WDTCTA (IN)
bvDINAck = 001H bvDINAck = 002H
(Use Data)
MMC Device EP TX MMC

Host may commence next transfer immediately (if buffer available)


20
Data OUT Transfers
Streaming Example

Token Phase Data Phase Handshake Phase

MMC MMC
Data (S 0) AcK Data (S 1) AcK

(Token O)

(Hndsk O)
(Token O)

(Hndsk O)

W DRCTA
W DRCTA

WDTCTA

W DTCTA
HDR
HDR

bvAckCode bvAckCode
10 B 01B

Transaction Group N Transaction Group N + 1

Transaction 1
Transaction 0

WDRCTA (OUT) DATA(0) HNDSHK WDRCTA (OUT) DATA(1) HNDSHK


WDTCTA (Handshake) (Use Data) bvAckCode = 02H WDTCTA (Use Data) bvAckCode = 01H
(Handshake)
Host TX (MMC) Host TX Device EP TX Host TX (MMC) Host TX Device EP TX

21
Data OUT Transfers
Short Packet Example

LastPacketFlag = 1
MMC MMC
Data (S 0) AcK
(Token O)

(Hndsk O)
WDTCTA
W D RCTA
HDR

HDR
bvAckCode
002 H

Transaction Group N Transaction Group N+1

Transaction 1
Transaction 0

WDRCTA (OUT) DATA(0) HNDSHK


WDTCTA (Handshake) LastPacketFlag = 1 bvAckCode = 02H
(Use Data)
Host TX (MMC) Host TX Device EP TX Host TX (MMC)

Host may commence next transfer immediately (if data available)


22
Control Transaction Format
Setup Stage w/Data Stage

Setup + first IN Data Stage Idle Setup + first OUT Data Stage
transaction transaction

HDR WDT CTA Setup Bytes MMC HDR WDRCTA Setup Bytes WDT CTA

Token MMC Setup Flag = 1B


w/Setup Setup Flag = 1B
ControlStatusFlag= 0B
Direction = OUT = 0
Direction= IN = 1 Direction = OUT = 0B
PHY_TXRate
bvDINAck= 001H
Data not Ready, or Bad Command
Smashed MMC

Smashed MMC

Data OUT Phase


Data IN Phase
Data Packet

Data Packet
DATA NAK or DATA
Data HNDSK (Seq# 0)
(Seq# 0) STALL

HNDSK ACK (bvAckCode)


Handshake MMC HDR WDT CTA or NAK or STALL

bvDINAck Idle
Idle

23
Control Transaction Format
Setup w/No Data Stage; Bare Status Stage

Idle
Setup + No Data Stage Status Stage

Token MMC HDR W DTCTA Setup Bytes MMC HDR WDTCTA

Setup Flag = 1B Setup Flag = 0B


ControlStatusFlag = 1B ControlStatusFlag = 1B
Direction = IN = 1 Direction = IN = 1
Smashed MMC

Data

Smashed MMC
ACK or ACK or
Handshake
HNDSK NAK or HNDSK NAK or
STALL STALL

Idle Idle

24
Control Transfer
Example (Set Address - No Data Stage)

Status Stage - Handshake


MMC MMC
Handshake
S etup Bytes (8)
W D T CTA
(S tat us
Stage)

ETC.
HDR

HDR
Setup Stage Status Stage

Transaction Group N Transaction Group N+1

Transaction 0
WDTCTA HNDSHK
SetupFlag = 1B Hndshk code = ACK
Ctrl/StatusFlg = 1B bvAckCode = 00H
(Handshake) Direction = IN
Setup Bytes (8) set address
Host TX (MMC) Device EP TX Host TX (MMC)
Setup Stage Status Stage

25
Control Transfer
Example (Control Write - SetKey)

Std. Out Transaction Handshake Transaction

MMC MMC MMC


Data (seq = 0) AcK HNSK

(Status Stg)
(Hndsk O )
(Token O)

WDTCTA
WDTCTA
W DRCTA

ETC.
HDR

HDR
HDR

Length = Y

Setup Bytes (8)


Setup Flag = 1 ControlStatusFlag= 1

Setup Stage Data Stage Status Stage

Transaction Group N Transaction Transaction GroupN+2


Group N+1

Transaction 0 Transaction 1
WDRCTA Data Out HNDSHK WDTCTA HNDSHK
SetupFlag = 1B Seq = 0B Hndshk code = ACK SetupFlag = 0B Hndshk code = ACK
Ctrl/StatusFlag = 0B (Set Key) bvAckCode = 02H Ctrl/StatusFlag = 1B bvAckCode = 00H
(Handshake) (Handshake) Direction = IN
Setup Bytes (8) set Key
WDTCTA - handshake

Host TX (MMC) Host TX Device EP TX Host TX (MMC) Device EP TX

Setup Stage Data Stage Status Stage

26
Control Transfer
(Control Write SetKey lost data packet)

Std. Out Transaction Std. Out Transaction Handshake Transaction


MMC MMC MMC MMC

(Status Stg)
Data (seq = 0) AcK Data (seq = 0) AcK HNSK
(Hndsk O)

(Hndsk O)
(Token O)
(Token I)

WDT CTA
WDT CTA

WDR CTA
WDT CTA

WDT CTA

ETC.
HDR

HDR
HDR

HDR
Length = Y Length = Y

Setup Bytes (8) bvAckCode = 001H bvAckCode = 002 H


Setup Flag = 1 ControlStatusFlag = 1

Setup Stage Data Stage Status Stage

Transaction Group N Transaction Transaction Group N+2


Group N+1

Transaction 0 Transaction 1
WDRCTA Data Out HNDSHK WDRCTA Data Out HNDSHK
SetupFlag = 1B Seq = 0B Hndshk code = ACK SetupFlag = 0B Seq = 0B Hndshk
Ctrl/StatusFlag = 0B (Set Key) bvAckCode = 01H Ctrl/StatusFlag = 0B (Set Key code = ACK
(Handshake) WDTCTA - handshake bvAckCode
Setup Bytes (8) set Key = 02H
WDTCTA - handshake

Host TX (MMC) Host TX Device EP TX Host TX (MMC) Host TX Device EP TX

Setup Stage Data Stage

27
Control Transfer
Example (Control Read Get Descriptor)

Std. IN Transaction Handshake Transaction

MMC MMC MMC


Data (seq = 0) HNSK

(Status St g)
(Token I)

W DTCTA
W DTCTA

Setup Bytes

ETC.
HDR

HDR
Length = Y
HDR

bvDINAcK = 002H
SetupFlag = 1 StatusStageFlag = 1
Setup
Data Stage
Stage Status Stage

Transaction Group N Transaction Group N+1

Transaction 0 Transaction 1
WDTCTA Data IN WDTCTA HNDSHK
SetupFlag = 1B Seq = 1B SetupFlag = 0B Hndshk code = ACK
Ctrl/StatusFlag = 0B (Get Descriptor Data) Ctrl/StatusFlag = 1B bvAckCode = 00H
bvDINAck = 001H bvDINAck = 002H Direction = IN
Setup Bytes (8) (Handshake)
Get Descriptor

Host TX (MMC) Device EP TX Host TX (MMC) Device EP TX


Setup Stage Data Stage
Status Stage
28
Control Transfer
Example (Control Read Get Descriptor)

Data packet gets smashed


Host will retry Data Stage
Handshake Transaction
If device saw Setup, MMC MMC MMC
Data (seq = 0) HNSK
will respond

(Status Stg)
(Token I)

WDTCTA
WDTCTA

ETC.
HDR

HDR
HDR

with Data
Std. IN Transaction

MMC

X
bvDINAcK = 002H
Data (seq = 0) StatusStageFlag = 1
(Token I)
WDTCTA

Setup Bytes
HDR

Length = Y

Handshake Transaction

SetupFlag = 1 MMC MMC MMC MMC


HNSK (STALL) Data (seq = 0) HNSK

(Status Stg)
WDTCTA
(Token I)
(Token I)

W DTCTA
W DTCTA

ETC.
Setup Bytes

HDR
HDR
HDR
HDR

If device did not see


a Setup, will
bvDINAcK = 002H
respond with STALL StatusStageFlag = 1

29
Agenda

Packet Layouts
Transaction Groups
Timing Constraints
Data Transfers (general model)
Device Notifications
Flow Control

30
Device Notifications Time Slots
DNTS

Devices are only allowed transmitters


Device notification messages (to the WUSB
Host) are only allowed data communications
Nature of notification messages are that they
are asynchronous and infrequent
Fixed Maximum Size for notification messages
Take advantage of this in the access method
Host policy to manage efficiently
Unused time is just lost to WUSB data stream
31
DNTS Access Method
Contention Based : Slotted Aloha

Fixed (maximum) sized


message 1 2 3 N
MMC
DNTS is a window of uniform
sized message slots

WDNTSCTA
WDNTSCTA indicates # Slots (N)
number of message slots
Device selects a message
slot using a uniformly
DNTS CTA Start
distributed random integer
Slot Select = uniform(1, N)
value (in range 1 to N)
Device transmits message
a message slot start time
32
Device Notifications
Reliability

Protocol for Device Notifications is


designed for unreliability:
Device Continues to send
Notification(s) Notifications until it observes Host
Response
Host will cease response
when it observes follow-up
device response (when
Host Response applicable)

Host must tolerate


retransmissions of Device must
tolerate Host
notification that occur
response
Device Response
while it is responding
retransmissions

33
Device Notification
Example (Device Perspective) - Connect

UnConnected Initiate Connect

Transmit
Xmit (DN_Connect, Self-Beaconing, MyCDID)
Notification

Sending DNTS Available


Notification
Receive
Wait For
Connect ACK MMC [ConnectAck_IE [MyCDID, DeviceAddress] []]

Connect
Connected Ack

34
Agenda

Packet Layouts
Transaction Groups
Timing Constraints
Data Transfers (general model)
Device Notifications
Flow Control

35
Flow Control

Used on All transfer types


Device provides flow-control information in its response to the host
bmStatus field in the WUSB Header of a Data, IData or Handshake
OUTs, the flow control response is in the AcK handshake
INs, the flow control response is in the Data(x) packet
Handshake encoded with NAKs always available
Flow control status from Endpoint results in removal of endpoint
from Active schedule
Resumption of service to a flow-controlled endpoint depends
on transfer type
Bulk & Control
Device delivers a Endpoint Ready (DN_EPRdy) notification to the host
during an DNTS
Interrupt & Isochronous
Next service interval
36
Control Transfer
Example (Control Read Flow Control)

Std. IN Transaction Handshake Transaction


NAK
MMC MMC MMC MMC MMC
HNSK Data (seq = 0) HNSK

(St atus St g)
WDNTSCTA
(Token I)

(Token I)
W DTCTA

W DTCTA
W DTCTA

Setup Bytes

ETC.
HDR

HDR

HDR

HDR
HDR

Length = Y
DN_EPRdy
bvDINAcK = 002H
SetupFlag = 1 StatusStageFlag = 1
Setup Data Stage (cont.)
Data Stage
Stage Status Stage

Transaction Group N Transaction Group Y Transaction Group Z Transaction Group Z+1

Host stops polling endpoint on NAK


Device notifies it is ready with DN_EPRdy
Host resumes polling endpoint
Retries data phase transaction in this example
37
Track II Announcement

You might also like