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 Beacon Period t=0 Wiedia AC DRP WUSB DRP WUSB Wiedia Physical Layer Channel Time Beacon Beacon Superframe n Superframe n+1 Period Period DRP WUSB DRP WUSB DRP WUSB DRP WUSB t=0 t=0 C C C C C C C C C C Wireless USB Channel The Wireless USB Channel is encapsulated by the Wiedia channel Wireless USB channel is continuous sequence of linked control packets transmitted by the Host during reserved Wiedia channel time WUSB time is reserved from Wiedia channel time (DRPs) Called s icro-schedule anagement Commands All Wireless USB Data communications are over the Wireless USB Channel 3
Packet Layout N * 6 OFD Symbols 12 OFD Symbols 30 OFD Symbols Non-secure Packet Format msb Pad Bits Tail Bits FCS Payload Variable Length: Z or more bytes Tail Bits AC PHY HCS Header Header PLCP Preamble lsb IC (8) Secure Packet Format Application Payload (Variable Length: 0 to axpacketsize) Isochronous Packet Format WUSB Hdr (2) SFN (6) Encrypt Offset (2) Rsrvd (1) TKID (3) Acc Info (2) Seq. Control (2) SrcID (2) Type [8:6] Delivery Ident/Control Frame Subtype [12:9] (011B) Data Frame [12] = 1B; [11:9] = Stream Index (001B) Control Frame [12:9] = Application Defined Control Value DestID Frame (2) Control (2) bmstatus (1) bmattributes (1) Isochronous Header (3) Isochronous Segment0 Isochronous Segment1 Endpoint Number [3:0] Packet ID [6:4] bnumisosegments (1) wpresentationtime (2) wlength (2) Segment Data (wlength) Isochronous SegmentbNumIsoSegments -1 Cypher Text (Encrypted Data) Wiedia AC Packet format Utilizes Secure frame format 4
Wireless USB Channel plus time till next Channel Time Dynamically Allocated for Data Communications Between the Host and Devices in its Wireless USB Cluster Information Elements Next Time Basic structure used to maintain Wireless USB Channel Transaction Group 5
Transaction Group Channel Time Allocations [WCTA_IE] Data & Handshake Phase & Device Notification Time Slots WCTA_IE Header WXCTA[0] Attributes Endpoint Info Flags Slot Type Start Time WXCTA[1] WXCTA [EOL] Protocol Time Slot Start Time (µs) Type-Specific Start Time is easured from the beginning of the packet (µs) Next Time Transaction Group 6
Transaction Group Slot Durations Slot time durations are derived from adjacent W X CTA blocks OUTs device know when they can stop listening INs devices transmit what was requested EOL W X CTA is always required to be present WCTA_IE Header WXCTA [0] Attributes Endpoint Info Flags Slot Type Start Time WXCTA [1] Attributes Endpoint Info Flags Slot Type Start Time WXCTA [EOL] Protocol Time Slot [0] Start Time [0] Protocol Time Slot [1] Start Time [1] Type-Specific Type-Specific Next Time Transaction Group 7
Time Slot Allocations Three types of time slots: W DR CTA (Device Receive) W DT CTA (Device Transmit) W DNTS CTA (Device Notification) time slot W_CTA W DR CTA W DNTS CTA W DT CTA W DR CTA W DNTS CTA W DT CTA 8
Time Slot Allocations [cont.] W DR CTA, W DT CTAs 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 W DNTS CTAs 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 preamble (n-1) TS[0] TS[1] TS[2] TS[3] TS[4] preamble (n) t=0 Time at which a Receiver must be listening before the slot start time t G UARDTIE Slot start time according to Device s local clock Transmitter could begin transmitting anywhere in this window (±t AXDRIFT ) Time at which a receiver must be listening before the scheduled start of the ((n-1) Next) t G UARDTIE t=0 start time according to Device s local clock Host could begin transmitting (n) anywhere in this window (±t AXDRIFT ) 10
Transaction Group Protocol Synchronization (cont.) PHY_ACTIVE 24 OFD Symbols Sync Delay Radio edium PLCP Preamble PLCP Header t0 30 OFD Symbols t0 is the time of the first symbol of the s preamble Devices can calculate this from the edge of PHY_ACTIVE 11
Time Slot Scheduling Requirements Host Transmitted Packets Device Transmitted Packets TS[0] TS[1] TS[2] TS[3] TS[4] data t B USTURNI NTERS LOTTIEE Standard Preamble PHY Hdr data t INTERS LOTTIE + tguardtie Standard Preamble PHY Hdr Data Packet for TS[3] Packet data tbusturni NTERSLOTT IE Standard Preamble PHY Hdr Data Packet for TS[2] data tinters LOTTIE Standard Preamble PHY Hdr Data Packet for TS[1] t I NTERS LOTTIE Standard Preamble PHY Hdr Data Packet for TS[0] The first packet transmitted in a protocol time slot must have a standard preamble 12
Data Burst Timing to first Data OUT : IFS (1.875 µs) to first Data IN : Bus Turn Time Bus Turn + Guard Time (SIFS + 1µs) (11 µs) IPGs between burst packets is fixed (IFS) First packet Preamble must be Standard Length Host determines subsequent preamble to use OUT Data Phase Time Slot Standard Preamble PHY Hdr data Short /Std Preamble PHY Hdr data t INTERSLOTTIE t STREAIPG t STREAIPG t BUSTURNINTERSLOTTIE Standard Preamble PHY Hdr data Short/Std Preamble PHY Hdr data IN Data Phase Time Slot 13
Agenda Protocol Components Data Transfers (general model) Device Notifications Flow Control 14
Data Stream Synchronization Basic odel Protocol-level support for reliable data delivery Identifies: Data ordering requirements Guarantees advancement of data stream only after reliable data delivery Terms: aximum Burst Size aximum Sequence aximum Sequence Distance 8 7 8 7 9 Transmit Window 6 9 6 0 5 0 5 1 1 4 4 2 3 2 3 Data Packet Burst (S0, S1, S2, S3) Acknowledgement (0011110000 B) Transmitter sends data packets associated with Transmit window Sequence numbers Receiver acknowledges with new receive window (what is available now) Protocol rules for recovering lost packets, avoiding sequence range wrap, etc. See Bursting Session 8 7 8 7 9 Receive Window 6 9 6 0 5 0 5 1 4 1 4 2 3 2 3 15
Transaction Transmit Bit Rate s are transmitted at base signaling rate (53.3 b/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 :.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 odel Idle IN OUT Token W DT CTA W DR CTA W DT CTA Smashed Direction = IN = 1 bvdinack PHY_TXRate Data not Ready, or Internal Error Smashed Direction = OUT = 0 Data Data IN Phase Data Packets DATA (Seq# N) DATA (Seq# N+1)... DATA (Seq# N+Y) HNDSK NAK or STALL Data OUT Phase Data Packets DATA (Seq# N) DATA (Seq# N+1)... DATA (Seq# N+Y) Number of packets in data phase depends on Transaction Burst Size or available data. The next Sequence number is always derived (N+1) modulo axsequence. Handshake W DT CTA HNDSK ACK (bvackcode) or NAK or STALL bvdinack Idle Idle 17
Data IN Transfer Streaming Example TokenI.bvDINAcK =001 H TokenI.bvDINAcK =002H (Token I) Data (S0) (Token I) Data (S1) Transaction Group N Transaction Group N + 1 Transaction 1 Transaction 0 Transaction 2 W DT CTA (IN) bvdinack = 001H DATA(S0) (Use Data) W DT CTA (IN) bvdinack = 002H DATA(S1) (Use Data) W DT CTA (IN) bvdinack = 001H Device EP TX Device EP TX Host TX () 18
Data IN Transfer End Of Transfer Example bvdinack=002h (Token I) Data (S1) (Token I) EOL Blank BlanK.wStart = NextWxCTA.wStart TokenI. bvdinack=000h Transaction Group N Transaction Group N + 1 Transaction N-1 Transaction N W DT CTA (IN) bvdinack = 002H DATA(S1) (Use Data) Blank W DT CTA (IN) bvdinack = 000H wstart = NextWxCTA.wStart End of List WxCTA (EOL) Device EP TX 19
Data IN Transfer Short Packet Example TokenI.bvDINAcK =001 H TokenI.bvDINAcK =002H W D TCTA (Token I) Data (S0) LastPacketFlag = 1B W DTCTA (Token I) Blank W DTCTA Transaction Group N Transaction Group N + 1 Transaction 0 W DT CTA (IN) bvdinack = 001H DATA(S0) LastPacketFlag = 1 (Use Data) Transaction 1 W DT CTA (IN) bvdinack = 002H Device EP TX Host may commence next transfer immediately (if buffer available) 20
Data OUT Transfers Streaming Example Token Phase Data Phase Handshake Phase Data (S 0) AcK Data (S 1) AcK WDRCTA (Token O) (Hndsk O) bvackcode 10B WDRCTA (Token O) (Hndsk O) bvackcode 01B Transaction Group N Transaction Group N + 1 Transaction 1 Transaction 0 W DR CTA (OUT) W DT CTA (Handshake) DATA(0) (Use Data) HNDSHK bvackcode = 02H W DR CTA (OUT) W DT CTA (Handshake) DATA(1) (Use Data) HNDSHK bvackcode = 01H Host TX () Host TX Device EP TX Host TX () Host TX Device EP TX 21
Data OUT Transfers Short Packet Example LastPacketFlag = 1 Data (S 0) AcK W DRCTA (Token O) (Hndsk O) bvackcode 002 H Transaction Group N Transaction Group N + 1 Transaction 0 Transaction 1 W DR CTA (OUT) W DT CTA (Handshake) DATA(0) LastPacketFlag = 1 (Use Data) HNDSHK bvackcode = 02H Host TX () Host TX Device EP TX Host TX () Host may commence next transfer immediately (if data available) 22
Control Transaction Format Setup Stage w/data Stage Setup + first IN Data Stage transaction Idle Setup + first OUT Data Stage transaction Setup Bytes WDRCTA Setup Bytes Token w/setup Setup Flag = 1B ControlStatusFlag= 0B Direction = IN = 1 PHY_TXRate bvdinack= 001H Setup Flag = 1B Direction = OUT = 0 Direction = OUT = 0B Data not Ready, or Bad Command Data Smashed DataIN Phase Data Packet DATA (Seq# 0) HNDSK NAK or STALL Smashed Data OUT Phase Data Packet DATA (Seq# 0) Handshake HNDSK ACK (bvackcode) or NAK or STALL Idle bvdinack Idle 23
Control Transaction Format Setup w/no Data Stage; Bare Status Stage Setup + No Data Stage Idle Status Stage Token Setup Bytes Setup Flag = 1B ControlStatusFlag= 1B Direction = IN = 1 Setup Flag = 0B ControlStatusFlag= 1B Direction = IN = 1 Data Handshake Smashed HNDSK ACK or NAK or STALL Smashed HNDSK ACK or NAK or STALL Idle Idle 24
Control Transfer Example (Set Address - No Data Stage) W DTCTA (S tat us Stage) Setup Bytes (8) Status Stage - Handshake Handshake ETC. Setup Stage Status Stage Transaction Group N Transaction Group N+1 Transaction 0 W DT CTA SetupFlag = 1B Ctrl/StatusFlg = 1B (Handshake) Setup Bytes (8) set address Host TX () Setup Stage HNDSHK Hndshk code = ACK bvackcode = 00H Direction = IN Device EP TX Status Stage Host TX () 25
Control Transfer Example (Control Write - SetKey) Std. Out Transaction Handshake Transaction WDRCTA (Token O) (Hndsk O) Data (seq = 0) Length = Y AcK (Status Stg) HNSK ETC. Setup Flag = 1 Setup Stage Setup Bytes (8) Data Stage ControlStatusFlag= 1 Status Stage Transaction Group N Transaction Group N+1 Transaction Group N+2 Transaction 0 Transaction 1 W DR CTA SetupFlag = 1B Ctrl/StatusFlag = 0B (Handshake) Setup Bytes (8) set Key W DT CTA - handshake Data Out Seq = 0B (Set Key) HNDSHK Hndshk code = ACK bvackcode = 02H W DT CTA SetupFlag = 0B Ctrl/StatusFlag = 1B (Handshake) HNDSHK Hndshk code = ACK bvackcode = 00H Direction = IN Host TX () Host TX Device EP TX Host TX () 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 (Token I) (Hndsk O) X Data (seq = 0) Length = Y AcK WDRCTA (Token O) (Hndsk O) Data (seq = 0) Length = Y AcK (Status Stg) HNSK ETC. Setup Flag = 1 Setup Bytes (8) bvackcode = 001H bvackcode = 002H ControlStatusFlag = 1 Setup Stage Data Stage Status Stage Transaction Group N Transaction Group N+1 Transaction Group N+2 Transaction 0 Transaction 1 W DR CTA SetupFlag = 1B Ctrl/StatusFlag = 0B (Handshake) Setup Bytes (8) set Key W DT CTA - handshake Data Out Seq = 0B (Set Key) HNDSHK Hndshk code = ACK bvackcode = 01H W DR CTA SetupFlag = 0B Ctrl/StatusFlag = 0B W DT CTA - handshake Data Out Seq = 0B (Set Key HNDSHK Hndshk code = ACK bvackcode = 02H Host TX () Host TX Device EP TX Host TX () Host TX Device EP TX Setup Stage Data Stage 27
Control Transfer Example (Control Read Get Descriptor) Std. IN Transaction Handshake Transaction (Token I) Setup Bytes Data (seq = 0) Length = Y (Status Stg) HNSK ETC. Setup Stage SetupFlag = 1 Data Stage StatusStageFlag = 1 Status Stage bvdinack = 002H Transaction Group N Transaction Group N+1 Transaction 0 Transaction 1 W DT CTA SetupFlag = 1B Ctrl/StatusFlag = 0B bvdinack = 001H Setup Bytes (8) Get Descriptor Data IN Seq = 1B (Get Descriptor Data) W DT CTA SetupFlag = 0B Ctrl/StatusFlag = 1B bvdinack = 002H (Handshake) HNDSHK Hndshk code = ACK bvackcode = 00H Direction = IN Host TX () Device EP TX Host TX () 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 If device saw Setup, will respond with Data Std. IN Transaction (Token I) Data (seq = 0) Handshake Transaction (Status Stg) HNSK ETC. (Token I) SetupBytes X Data (seq = 0) Length = Y bvdinack = 002H StatusStageFlag = 1 Handshake Transaction SetupFlag = 1 If device did not see a Setup, will respond with STALL (Token I) HNSK (STALL) (Token I) Setup Bytes Data (seq = 0) (Status Stg) StatusStageFlag = 1 HNSK ETC. bvdinack = 002H 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 aximum 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 ethod Contention Based : Slotted Aloha Fixed (maximum) sized message DNTS is a window of uniform sized message slots W DNTS CTA indicates number of message slots Device selects a message slot using a uniformly distributed random integer value (in range 1 to N) Device transmits message a message slot start time W DNTS CTA # Slots (N) DNTS CTA Start 123 N Slot Select = uniform(1, N) 32
Device Notifications Reliability Protocol for Device Notifications is designed for unreliability: Notification(s) Host Response Device Continues to send Notifications until it observes Host Response Host will cease response when it observes follow-up device response (when applicable) Host must tolerate retransmissions of notification that occur while it is responding Device must tolerate Host response retransmissions Device Response 33
Device Notification Example (Device Perspective) - Connect UnConnected Initiate Connect Xmit Notification Transmit (DN_Connect, Self-Beaconing, ycdid) Sending Notification DNTS Available Wait For Connect ACK Receive [ConnectAck_IE [ycdid, DeviceAddress] [ ]] Connected Connect 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 it s 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) (Token I) Setup Stage SetupFlag = 1 Setup Bytes NAK HNSK Data Stage WDNTSCTA DN_EPRdy (Token I) Std. IN Transaction Data (seq = 0) Length = Y Data Stage (cont.) Handshake Transaction W DT CTA (Status Stg) Status Stage HNSK StatusStageFlag = 1 ETC. bvdinack = 002H 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