Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

PTP / ESMC / CFM / R-APS / 802.3ah OAM (P2)

Status: draft

Notes on PTP (IEEE 1588-2008), SyncE ESMC (ITU-T G.8264), Ethernet CFM / OAM (IEEE 802.1Q clause 21 = 802.1ag, ITU-T Y.1731) with the ERPS R-APS messages (ITU-T G.8032) and EFM OAM (IEEE 802.3 clause 57 = 802.3ah) (M7). The definitions live in crates/wpg-protocols/src/{ptp,esmc,cfm,efm_oam}.rs, the samples in templates/protocols/timing/ and templates/protocols/oam/.

Stacks and samples

ethernet2 / ptp_*                         # EtherType 0x88f7 (IEEE 1588 annex F)
ethernet2 / ipv4|ipv6 / udp / ptp_*       # UDP 319 (event messages), 320 (general messages)
ethernet2 / esmc                          # Slow Protocols 0x8809, subtype 0x0a
ethernet2 [/ dot1q] / cfm_*               # EtherType 0x8902, also behind 802.1Q / 802.1ad tags
ethernet2 / efm_oam_*                     # Slow Protocols 0x8809, subtype 0x03

The Slow Protocols EtherType 0x8809 is demultiplexed by its first octet, the subtype: 1 LACP, 2 Marker, 3 OAM, 0x0a ESMC (l2control::slow_protocols_peek; other subtypes decode as raw). Marker PDUs now decode as marker instead of lacp. UDP destination ports are not Auto: set 319 for Sync / Delay_Req / Pdelay_Req / Pdelay_Resp and 320 for the other messages.

SampleContents
ptp-sync-two-step-l2Two-step Sync over Ethernet, 8 per second, incrementing sequence ID
ptp-follow-up-l2Follow_Up with the precise origin timestamp and a correction
ptp-pdelay-req-l2 / ptp-pdelay-resp-l2 / ptp-pdelay-resp-follow-up-l2Peer delay exchange of IEEE 802.1AS (majorSdoId 1) to 01:80:c2:00:00:0e
ptp-delay-req-udp / ptp-delay-resp-udpDelay request / response over UDP/IPv4 (224.0.1.129)
ptp-announce-udpAnnounce of a GPS-locked grandmaster (clock class 6)
ptp-signaling-unicastUnicast negotiation: Request Unicast Transmission TLVs for Announce and Sync
ptp-management-getManagement GET of the default data set
ptp-genericA Sync written in the generic layout
esmc-ql-prc / esmc-event-dnuESMC information PDU (QL-PRC, Extended QL TLV) / event PDU (QL-DNU)
cfm-ccmCCM on VLAN 100 (MD level 5, MEP 10, ICC-based MEG ID, Port / Interface Status TLVs)
cfm-lbm / cfm-lbrLoopback message / reply with a Data TLV
cfm-ltm / cfm-ltrLinktrace message / reply with their egress identifier and Reply Ingress TLVs
cfm-genericA G.8031 Linear APS (OpCode 39) in the generic layout
y1731-ais / y1731-lck / y1731-csfAIS, LCK and CSF signals
y1731-tstTest signal with a Test TLV
y1731-lmm / y1731-lmr / y1731-slm / y1731-slr / y1731-1slLoss measurement (frame counters, synthetic loss)
y1731-dmm / y1731-dmr / y1731-1dmDelay measurement (IEEE 1588 timestamps)
erps-raps-nr-rb / erps-raps-sfR-APS(NR, RB) of the RPL owner / R-APS(SF) after a failure
efm-oam-information / efm-oam-genericInformation OAMPDU (Local / Remote Information TLVs)
efm-oam-eventEvent Notification (Errored Frame and Errored Symbol Period events)
efm-oam-variable-request / efm-oam-variable-responseVariable retrieval
efm-oam-loopbackLoopback Control (enable remote loopback)
efm-oam-organization-specificOrganization Specific OAMPDU

Generic layer and dedicated messages

PTP, CFM and 802.3ah OAM follow the IS-IS pattern: one protocol per message (PTP), OpCode (CFM) or code (OAM), plus a generic layer (ptp, cfm, efm_oam: the common header and the rest as data octets). The parser decodes the generic layer first and re-decodes it as the dedicated one from message_type / opcode / code; values without a dedicated definition (CFM Linear APS, MCC, EXM / VSM, …) stay generic. When building, every dedicated protocol sets the EtherType / subtype by itself.

Protocolmessage_typeBody
ptp_sync / ptp_delay_req0 / 1origin_timestamp_{seconds,nanoseconds}
ptp_pdelay_req2origin timestamp, 10 reserved octets
ptp_pdelay_resp3request_receipt_timestamp_*, requesting_port_{clock_identity,port_number}
ptp_follow_up8precise_origin_timestamp_*
ptp_delay_resp9receive_timestamp_*, requesting_port_*
ptp_pdelay_resp_follow_up10response_origin_timestamp_*, requesting_port_*
ptp_announce11origin timestamp, current_utc_offset, grandmaster_priority1/2, grandmaster_clock_{class,accuracy}, grandmaster_offset_scaled_log_variance, grandmaster_identity, steps_removed, time_source
ptp_signaling12target_port_*
ptp_management13target_port_*, starting_boundary_hops, boundary_hops, action

PTP

The 34-octet common header has major_sdo_id (transportSpecific), message_type, minor_version, version, message_length (Auto), domain_number, minor_sdo_id, flags (16 bits: two_step is bit 9, unicast bit 10, ptp_timescale bit 3, …), correction_field (signed, nanoseconds × 2^16), message_type_specific, the source port identity (clock_identity, port_number), sequence_id, control_field and log_message_interval (signed). The defaults of control_field and log_message_interval follow the message (0x7f where not applicable).

Every message ends with tlvs (16-bit type, 16-bit length of the value, Auto). They end at message_length, so the zero padding of a short Ethernet frame is not read as TLVs.

- protocol: ptp_signaling
  fields:
    flags: 0x0400 # unicast
    tlvs:
      - request_unicast_transmission: { message_type: announce, log_inter_message_period: 1, duration_field: 300 }
      - grant_unicast_transmission: { message_type: sync, log_inter_message_period: -4, duration_field: 300, renewal_invited: 1 }
TypeTLV (name)Value fields
0x0001managementmanagement_id, data_field (octets)
0x0002management_error_statusmanagement_error_id, management_id, reserved, display_data
0x0003organization_extensionorganization_id, organization_sub_type, data_field
0x0004 / 0x0005request_unicast_transmission / grant_unicast_transmissionmessage_type, log_inter_message_period, duration_field (grant: renewal_invited)
0x0006 / 0x0007cancel_unicast_transmission / acknowledge_cancel_unicast_transmissionmessage_type
0x0008path_tracepath_sequence (list of clock identities)
0x0009alternate_time_offset_indicatorkey_field, current_offset, jump_seconds, time_of_next_jump, display_name (length Auto)

ESMC

esmc is the OSSP header (subtype 0x0a, itu_oui 00-19-a7, itu_subtype 1), version (1), event_flag and the TLVs (8-bit type, 16-bit length including the 3-octet header, Auto): ql (ssm_code: prc, ssu_a, ssu_b, sec, dnu, and the option 2 codes) and extended_ql (enhanced_ssm_code, synce_clock_identity, flags (mixed EEC / eEEC, partial chain), cascaded_eeecs, cascaded_eecs). The padding after the TLVs decodes as one raw item.

CFM / Y.1731 / R-APS

The common header is md_level, version, opcode, the flags and first_tlv_offset; the flags are split per OpCode (CCM: rdi, period; LTM / LTR: use_fdb_only, fwd_yes, terminal_mep; AIS / LCK / CSF: period, CSF type; others: flags). first_tlv_offset is constant per OpCode (a warning when changed). The TLVs end with the End TLV (end, type 0); the Ethernet padding after it is padding, not more End TLVs (wpg-core Length::UntilTlv).

OpCodeProtocolFields
1cfm_ccmsequence_number, mep_id, maid (48 octets), tx_fcf, rx_fcb, tx_fcb
2 / 3cfm_lbr / cfm_lbmtransaction_id
4cfm_ltrtransaction_id, reply_ttl, relay_action
5cfm_ltmtransaction_id, ttl, original_mac, target_mac
33 / 35cfm_ais / cfm_lck(period only)
37cfm_tstsequence_number
40cfm_rapsrequest_state, sub_code, rb, dnf, bpr, node_id
42 / 43cfm_lmr / cfm_lmmtx_fcf, rx_fcf, tx_fcb
45cfm_1dmtx_timestamp_f_*, rx_timestamp_f_*
46 / 47cfm_dmr / cfm_dmmtx_timestamp_f_*, rx_timestamp_f_*, tx_timestamp_b_*, rx_timestamp_b_*
52cfm_csf(type and period)
53cfm_1slsource_mep_id, test_id, tx_fcf
54 / 55cfm_slr / cfm_slmsource_mep_id, responder_mep_id, test_id, tx_fcf, tx_fcb

TLVs (8-bit type, 16-bit length of the value, Auto): end (0), sender_id (1: chassis_id_length Auto, chassis_id_subtype, chassis_id, management_address octets), port_status (2), data_tlv (3: value), interface_status (4), reply_ingress / reply_egress (5 / 6: action, MAC, port ID octets), ltm_egress_identifier (7), ltr_egress_identifier (8), organization_specific (31), test (32: pattern_type, test_pattern).

R-APS (cfm_raps, OpCode 40) defaults to version 1 (G.8032v2), first_tlv_offset 32 and R-APS(NR, RB). Send it to 01:19:a7:00:00:<ring ID>, usually on the R-APS VLAN at MEL 7.

802.3ah OAM

Every OAMPDU starts with subtype (3), flags (link fault, dying gasp, critical event, local / remote evaluating and stable; default 0x0050) and code.

CodeProtocolFields
0x00efm_oam_informationtlvs: local_information / remote_information (oam_version, revision, multiplexer_action, parser_action, oam_configuration, max_oampdu_size, oui, vendor_specific_information), organization_specific, end
0x01efm_oam_event_notificationsequence_number, tlvs: errored_symbol_period, errored_frame, errored_frame_period, errored_frame_seconds_summary (timestamp, window, threshold, errors, error_running_total, event_running_total), organization_specific, end
0x02efm_oam_variable_requestvariable_descriptors (octets: branch, leaf, …, zero branch)
0x03efm_oam_variable_responsevariable_containers (octets: branch, leaf, width, value, …, zero branch)
0x04efm_oam_loopback_controlremote_loopback_command (1 enable, 2 disable)
0xfeefm_oam_organization_specificoui, data

Information / Event TLV lengths include the 2-octet header (Auto) and the list ends with end.

Not covered

  • PTP: the authentication / security TLVs (IEEE 1588-2019 annex P), the data fields of the Management TLVs per management ID, PTP over other transports (annexes C, E-G except IPv6 / Ethernet), state machines and timestamping on transmit.
  • CFM: the MAID / MEG ID is the 48 octets as sent (not split into name formats), the CRC-32 of the Test TLV is not computed; Linear APS, MCC, EXM / EXR and VSM / VSR have no dedicated definition (generic cfm).
  • 802.3ah OAM: variable descriptors / containers are octets; the OAM discovery state machine.

Generated reference

Field reference of the protocols on this page (generated from the definitions):

lacp · marker · ptp · ptp_sync · ptp_delay_req · ptp_pdelay_req · ptp_pdelay_resp · ptp_follow_up · ptp_delay_resp · ptp_pdelay_resp_follow_up · ptp_announce · ptp_signaling · ptp_management · esmc · cfm · cfm_ccm · cfm_lbm · cfm_lbr · cfm_ltm · cfm_ltr · cfm_ais · cfm_lck · cfm_tst · cfm_raps · cfm_lmm · cfm_lmr · cfm_1dm · cfm_dmm · cfm_dmr · cfm_csf · cfm_slm · cfm_slr · cfm_1sl · efm_oam · efm_oam_information · efm_oam_event_notification · efm_oam_variable_request · efm_oam_variable_response · efm_oam_loopback_control · efm_oam_organization_specific · raw