1

Page | 1

Copyright © 2015 IEEE. All rights reserved.

This is an unapproved IEEE Standards Draft, subject to change. 1 Radio over Ethernet (RoE) base protocol

2 [///Editor’s Note: this clause will describe the native RoE encapsulation transport 3 format. The following subclauses will also describe the overall RoE architecture, 4 showing encapsulation and decapsulation function locations, and the mapper function 5 locations. This clause also lists the underlying assumptions a RoE enabled architecture 6 has.]

7 1 Overview

8 2 RoE Ethernet Type

9 3 Bit and octet ordering, and numerical presentation

10 4 RoE common frame format

11 4.1 ver (version) field

12 4.2 pkt_type (packet type) field

13 4.3 flow_id (flow identifier) field

14 4.4 Timestamp

15 The timestamp is 32 bits in size and in units of nanoseconds. The timestamp field is 32 16 bits in size and is expresses the absolute time for presentation, relative to a defined 17 reference plane, of the information within the packet time at the receiving endpoint of the 18 RoE packet receiving endpoint and calculated by the RoE packet sending endpoint. Both 19 the transmitting and receiving endpoints shall must share the same understanding of the 20 Time of Day (ToD) in order for the information to be presented at the desired time.

21 The format of the timestamp field is shown in Figure 2.

22

0 1 2 3 4 5 6 … 25 26 27 28 29 30 31

timestamp (integer ns) timestam p (fraction al ns) 23 Figure 1: Format of the timestamp field

24 The 30 most significant bits of the timestamp field count in units of nanoseconds and the 25 value ranges from 0ns to 999,999,999ns (0x0 to 0x3B9AC9FF, respectively). The two 26 least significant bits of the timestamp field count in units of 0.25ns and the value ranges

Page | 2

Copyright © 2015 IEEE. All rights reserved.

This is an unapproved IEEE Standards Draft, subject to change. 1 from 0ns to 0.75ns (0x0 to 0x3, respectively). If sub-nanosecond timestamping is not 2 used, these two bits shall be set to 0 at the transmitter and shall be ignored at the receiver.

3 The timestamp value is capable of expressing a presentation time of up to one second in 4 the future. Both endpoints must account for the rollover condition of the timestamp field 5 after 999,999,999.75ns. field is encoded as a 32 bit sliding window capable of 6 representing ~2 seconds worth of time. This implies the timestamp field is capable of 7 encoding a presentation time maximum ~1 second in the future. See Annex B for 8 example algorithms that truncate the presentation time into the timestamp field at the 9 transmitting endpoint and that recover the presentation time from the timestamp field at 10 the receiving endpoint. . The timestamp sliding window size is controlled by the 11 following variables:

12 tstampWindowSize = “size of the sliding window”; the value shall be a power of 2

13 tstampWindowMask = tstampWindowSize-1

14 tstampTstampMask = (tstampWindowSize*2)-1

15 Refer to subclauses Error: Reference source not found, Error: Reference source not 16 found, Error: Reference source not found, and Error: Reference source not foundError: 17 Reference source not found for more details on the usage of the timestamp and the 18 presentation time.

Page | 3

Copyright © 2015 IEEE. All rights reserved.

This is an unapproved IEEE Standards Draft, subject to change. 1 Example algorithm for timestamp calculation conversion example 2 algorithm

3 The following C-like pseudocode algorithm example illustrates how tothe RoE header 4 timestamp field is used to calculate: 5  convert an IEEE 1588v2-based presentation time into the 32 bit RoE timestamp 6 value (presentation_to_timestamp) 7  a 64 bit presentation time out of the 32 bit onwire timestamp value 8 (ptime_2_tstamp);convert the 32 bit RoE timestamp value into an IEEE 1588v2- 9 based (PTP-based) presentation time (timestamp_to_presentation) 10  a 32 bit onwire timestamp value out of the 64 bit presentation time 11 (tstamp_2_ptime).

12 The correct usage of the recovered presentation time from the 32 bit RoE timestamp 13 value requires common agreement on the local time. The clocks of the RoE packet 14 transmitter and receiver must be synchronized to a common reference.

15 The calculation of the 64 bit presentation time out of the 32 bit onwire timestamp value 16 also requires the knowledge of the local time. Both the RoE packet sender and the 17 receiver shall have their clocks synchronized and share the same view of time. The 18 algorithm does not define how and where the 64 bit local time is sourced from. It can be, 19 for example, converted from a PTP [ref to 1588] 80 bit timestamp.In this example 20 algorithm, the 2 bit fractional nanoseconds field is not used and is set to 00b by the RoE 21 transmitter and is ignored by the RoE receiver and the presentation time is limited to a 22 time that is less than 500,000,000ns after the timestamp was generated at the RoE packet 23 transmitter.

24 25 typedef uint64_t uint48_t; 26 27 #define TSTAMPSZE 1000000000 28 #define WINDOWSZE 500000000 29 30 struct Timestamp { 31 uint48_t secondsField; 32 uint32_t nanosecondsField; 33 }; 34 35 36 // Convert a PTP timestamp (the presentation time) to a 32 bit timestamp. 37 // The 2 fractional nanoseconds bits are forced to 00b. 38 uint32_t presentation_to_timestamp( const struct Timestamp* presPTP ) { 39 return presPTP->nanosecondsField << 2; 40 } 41 42 43 // Convert a 32 bit timestamp to a PTP timestamp (the presentation time). 44 // The 2 fractional nanoseconds bits are ignored. 45 void timestamp_to_presentation( const struct Timestamp* localPTP,

Page | 4

Copyright © 2015 IEEE. All rights reserved.

This is an unapproved IEEE Standards Draft, subject to change. 1 struct Timestamp* presPTP, 2 uint32_t ts ) { 3 4 int32_t diff; 5 uint32_t wrap; 6 7 ts >>= 2; // remove fractional nanoseconds 8 diff = ts - localPTP->nanosecondsField; 9 wrap = abs(diff) > WINDOWSZE ? 1 : 0; 10 presPTP->secondsField = localPTP->secondsField; 11 presPTP->nanosecondsField = ts; 12 13 if (diff < 0) { 14 presPTP->secondsField += wrap; 15 } else { 16 presPTP->secondsField -= wrap; 17 } 18 } 19

20 21 #define TWINDOWMASK 0x000000007fffffffLL // tstampWindowMask 22 #define TTSTAMPMASK 0x00000000ffffffffLL // tstampTstapMask 23 #define TWINDOWSIZE 0x0000000080000000LL // tstampWindowSize 24 25 // 64 bit presentation time to 32 bit onwire timestamp value. 26 // The input ptime is a 64 bit Time of Day in nanoseconds 27 uint64_t ptime_2_tstamp( uint64_t ptime ) { 28 // Actual window is less what we send over the wire 29 return ptime & TTSTAMPMASK; 30 } 31 32 // 32 bit onwire timestamp value to 64 bit presentation time. 33 // The input local_time is a 64 bit Time of Day in nanoseconds 34 uint64_t tstamp_2_ptime( uint64_t local_time, uint64_t tstamp ) { 35 // mask out window size of bits of the local time 36 uint64_t ptime = local_time & ~TWINDOWMASK; 37 38 if ((local_time ^ tstamp) & TWINDOWSIZE) { 39 // Window under/overflow taking place.. flip the 40 // timestamp MBS to take that into account. 41 tstamp ^= (local_time & TWINDOWSIZE); 42 } else { 43 // Timestamp and local time in the same window 44 // "half". Just take window worth of bits. 45 tstamp &= TWINDOWMASK; 46 } 47 // Adjust local time with timestamp 48 return ptime+tstamp; 49 } 50

51

Page | 5

Copyright © 2015 IEEE. All rights reserved.

This is an unapproved IEEE Standards Draft, subject to change.