telecom: Introduce the masterOnly option.

When masterOnly is true, the port always returns NULL when computing
its best foreign master.  As a result, the port will never enter the
SLAVE state, and the clock will ignore Announce messages received on
that port.

This attribute is specifically called out in G.8275.1 and G.8275.2,
and it is implied by the "master only" mode G.8265.1.  In addition,
this option will probably appear in the next revision of IEEE 1588.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2017-02-14 20:12:01 +01:00
parent 0c30ab463f
commit 4d69d48f96
6 changed files with 15 additions and 0 deletions

View File

@ -214,6 +214,7 @@ struct config_item config_tab[] = {
PORT_ITEM_INT("logMinPdelayReqInterval", 0, INT8_MIN, INT8_MAX),
PORT_ITEM_INT("logSyncInterval", 0, INT8_MIN, INT8_MAX),
GLOB_ITEM_INT("logging_level", LOG_INFO, PRINT_LEVEL_MIN, PRINT_LEVEL_MAX),
PORT_ITEM_INT("masterOnly", 0, 0, 1),
GLOB_ITEM_STR("message_tag", NULL),
GLOB_ITEM_STR("manufacturerIdentity", "00:00:00"),
GLOB_ITEM_INT("max_frequency", 900000000, 0, INT_MAX),

View File

@ -29,6 +29,7 @@ syncReceiptTimeout 0
delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 20000000
masterOnly 0
G.8275.portDS.localPriority 128
#
# Run time options

View File

@ -27,6 +27,7 @@ delayAsymmetry 0
fault_reset_interval 4
neighborPropDelayThresh 800
min_neighbor_prop_delay -20000000
masterOnly 0
G.8275.portDS.localPriority 128
#
# Run time options

4
port.c
View File

@ -1568,6 +1568,7 @@ int port_initialize(struct port *p)
p->transportSpecific = config_get_int(cfg, p->name, "transportSpecific");
p->transportSpecific <<= 4;
p->match_transport_specific = !config_get_int(cfg, p->name, "ignore_transport_specific");
p->master_only = config_get_int(cfg, p->name, "masterOnly");
p->localPriority = config_get_int(cfg, p->name, "G.8275.portDS.localPriority");
p->logSyncInterval = config_get_int(cfg, p->name, "logSyncInterval");
p->logMinPdelayReqInterval = config_get_int(cfg, p->name, "logMinPdelayReqInterval");
@ -2200,6 +2201,9 @@ struct foreign_clock *port_compute_best(struct port *p)
dscmp = clock_dscmp(p->clock);
p->best = NULL;
if (p->master_only)
return p->best;
LIST_FOREACH(fc, &p->foreign_masters, list) {
tmp = TAILQ_FIRST(&fc->messages);
if (!tmp)

View File

@ -108,6 +108,7 @@ struct port {
int follow_up_info;
int freq_est_interval;
int hybrid_e2e;
int master_only;
int match_transport_specific;
int min_neighbor_prop_delay;
int net_sync_monitor;

View File

@ -245,6 +245,13 @@ The default is UDPv4.
Upper limit for peer delay in nanoseconds. If the estimated peer delay is
greater than this value the port is marked as not 802.1AS capable.
.TP
.B masterOnly
Setting this option to one (1) prevents the port from entering the
SLAVE state. In addition, the local clock will ignore Announce
messages received on this port. This option's intended use is to
support the Telecom Profiles according to ITU-T G.8265.1, G.8275.1,
and G.8275.2. The default value is zero or false.
.TP
.B G.8275.portDS.localPriority
The Telecom Profiles (ITU-T G.8275.1 and G.8275.2) specify an
alternate Best Master Clock Algorithm (BMCA) with a unique data set