mirror of https://github.com/wb2osz/direwolf.git
Issue 85 - Don't remove duplicates for IGate RX>IS direction.
This commit is contained in:
parent
5cb6e04c54
commit
b81de60aec
16
config.c
16
config.c
|
@ -869,6 +869,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
p_igate_config->tx_limit_1 = IGATE_TX_LIMIT_1_DEFAULT;
|
p_igate_config->tx_limit_1 = IGATE_TX_LIMIT_1_DEFAULT;
|
||||||
p_igate_config->tx_limit_5 = IGATE_TX_LIMIT_5_DEFAULT;
|
p_igate_config->tx_limit_5 = IGATE_TX_LIMIT_5_DEFAULT;
|
||||||
p_igate_config->igmsp = 1;
|
p_igate_config->igmsp = 1;
|
||||||
|
p_igate_config->rx2ig_dedupe_time = IGATE_RX2IG_DEDUPE_TIME;
|
||||||
|
|
||||||
|
|
||||||
/* People find this confusing. */
|
/* People find this confusing. */
|
||||||
|
@ -2234,10 +2235,18 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
t = split(NULL,0);
|
t = split(NULL,0);
|
||||||
}
|
}
|
||||||
else if (strcasecmp(t, "DROP") == 0) {
|
else if (strcasecmp(t, "DROP") == 0) {
|
||||||
|
text_color_set(DW_COLOR_ERROR);
|
||||||
|
dw_printf ("Config file, line %d: Preemptive digipeating DROP option is discouraged.\n", line);
|
||||||
|
dw_printf ("It can create a via path which is misleading about the actual path taken.\n");
|
||||||
|
dw_printf ("TRACE is the best choice for this feature.\n");
|
||||||
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_DROP;
|
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_DROP;
|
||||||
t = split(NULL,0);
|
t = split(NULL,0);
|
||||||
}
|
}
|
||||||
else if (strcasecmp(t, "MARK") == 0) {
|
else if (strcasecmp(t, "MARK") == 0) {
|
||||||
|
text_color_set(DW_COLOR_ERROR);
|
||||||
|
dw_printf ("Config file, line %d: Preemptive digipeating MARK option is discouraged.\n", line);
|
||||||
|
dw_printf ("It can create a via path which is misleading about the actual path taken.\n");
|
||||||
|
dw_printf ("TRACE is the best choice for this feature.\n");
|
||||||
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_MARK;
|
p_digi_config->preempt[from_chan][to_chan] = PREEMPT_MARK;
|
||||||
t = split(NULL,0);
|
t = split(NULL,0);
|
||||||
}
|
}
|
||||||
|
@ -4160,13 +4169,13 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
p_igate_config->igmsp = n;
|
p_igate_config->igmsp = n;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p_igate_config->satgate_delay = 1;
|
p_igate_config->igmsp = 1;
|
||||||
text_color_set(DW_COLOR_ERROR);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("Line %d: Unreasonable number of times for message sender position. Using default 1.\n", line);
|
dw_printf ("Line %d: Unreasonable number of times for message sender position. Using default 1.\n", line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p_igate_config->satgate_delay = 1;
|
p_igate_config->igmsp = 1;
|
||||||
text_color_set(DW_COLOR_ERROR);
|
text_color_set(DW_COLOR_ERROR);
|
||||||
dw_printf ("Line %d: Missing number of times for message sender position. Using default 1.\n", line);
|
dw_printf ("Line %d: Missing number of times for message sender position. Using default 1.\n", line);
|
||||||
}
|
}
|
||||||
|
@ -4182,6 +4191,9 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
||||||
|
|
||||||
else if (strcasecmp(t, "SATGATE") == 0) {
|
else if (strcasecmp(t, "SATGATE") == 0) {
|
||||||
|
|
||||||
|
text_color_set(DW_COLOR_INFO);
|
||||||
|
dw_printf ("Line %d: SATGATE is pretty useless and will be removed in a future version.\n", line);
|
||||||
|
|
||||||
t = split(NULL,0);
|
t = split(NULL,0);
|
||||||
if (t != NULL) {
|
if (t != NULL) {
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
54
igate.c
54
igate.c
|
@ -33,6 +33,9 @@
|
||||||
* APRS iGate properties
|
* APRS iGate properties
|
||||||
* http://wiki.ham.fi/APRS_iGate_properties
|
* http://wiki.ham.fi/APRS_iGate_properties
|
||||||
*
|
*
|
||||||
|
* Notes to iGate developers
|
||||||
|
* https://github.com/hessu/aprsc/blob/master/doc/IGATE-HINTS.md#igates-dropping-duplicate-packets-unnecessarily
|
||||||
|
*
|
||||||
* SATgate mode.
|
* SATgate mode.
|
||||||
* http://www.tapr.org/pipermail/aprssig/2016-January/045283.html
|
* http://www.tapr.org/pipermail/aprssig/2016-January/045283.html
|
||||||
*
|
*
|
||||||
|
@ -1959,9 +1962,37 @@ static void maybe_xmit_packet_from_igate (char *message, int to_chan)
|
||||||
* There is a 1 / 65536 chance of getting a false positive match
|
* There is a 1 / 65536 chance of getting a false positive match
|
||||||
* which is good enough for this application.
|
* which is good enough for this application.
|
||||||
*
|
*
|
||||||
|
*
|
||||||
|
* Original thinking:
|
||||||
|
*
|
||||||
|
* Occasionally someone will get on one of the discussion groups and say:
|
||||||
|
* I don't think my IGate is working. I look at packets, from local stations,
|
||||||
|
* on aprs.fi or findu.com, and they are always through some other IGate station,
|
||||||
|
* never mine.
|
||||||
|
* Then someone has to explain, this is not a valid strategy for analyzing
|
||||||
|
* everything going thru the network. The APRS-IS servers drop duplicate
|
||||||
|
* packets (ignoring the via path) within a 30 second period. If some
|
||||||
|
* other IGate gets the same thing there a millisecond faster than you,
|
||||||
|
* the one you send is discarded.
|
||||||
|
* In this scenario, it would make sense to perform additional duplicate
|
||||||
|
* suppression before forwarding RF packets to the Server.
|
||||||
|
* I don't recall if I saw some specific recommendation to do this or if
|
||||||
|
* it just seemed like the obvious thing to do to avoid sending useless
|
||||||
|
* stuff that would just be discarded anyhow. It seems others came to the
|
||||||
|
* same conclusion. http://www.tapr.org/pipermail/aprssig/2016-July/045907.html
|
||||||
|
*
|
||||||
|
* Version 1.5: Rethink strategy.
|
||||||
|
*
|
||||||
|
* Issue 85, https://github.com/wb2osz/direwolf/issues/85 ,
|
||||||
|
* got me thinking about this some more. Sending more information will
|
||||||
|
* allow the APRS-IS servers to perform future additional network analysis.
|
||||||
|
* To make a long story short, the RF>IS direction duplicate checking
|
||||||
|
* is now disabled. The code is still there in case I change my mind
|
||||||
|
* and want to add a configuration option to allow it. The dedupe
|
||||||
|
* time is set to 0 which means don't do the checking.
|
||||||
|
*
|
||||||
*--------------------------------------------------------------------*/
|
*--------------------------------------------------------------------*/
|
||||||
|
|
||||||
#define RX2IG_DEDUPE_TIME 60 /* Do not send duplicate within 60 seconds. */
|
|
||||||
#define RX2IG_HISTORY_MAX 30 /* Remember the last 30 sent to IGate server. */
|
#define RX2IG_HISTORY_MAX 30 /* Remember the last 30 sent to IGate server. */
|
||||||
|
|
||||||
static int rx2ig_insert_next;
|
static int rx2ig_insert_next;
|
||||||
|
@ -1982,6 +2013,12 @@ static void rx_to_ig_init (void)
|
||||||
static void rx_to_ig_remember (packet_t pp)
|
static void rx_to_ig_remember (packet_t pp)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// No need to save the information if we are not doing duplicate checking.
|
||||||
|
|
||||||
|
if (save_igate_config_p->rx2ig_dedupe_time == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
rx2ig_time_stamp[rx2ig_insert_next] = time(NULL);
|
rx2ig_time_stamp[rx2ig_insert_next] = time(NULL);
|
||||||
rx2ig_checksum[rx2ig_insert_next] = ax25_dedupe_crc(pp);
|
rx2ig_checksum[rx2ig_insert_next] = ax25_dedupe_crc(pp);
|
||||||
|
|
||||||
|
@ -2031,8 +2068,21 @@ static int rx_to_ig_allow (packet_t pp)
|
||||||
dw_printf ("rx_to_ig_allow? %d \"%s>%s:%s\"\n", crc, src, dest, pinfo);
|
dw_printf ("rx_to_ig_allow? %d \"%s>%s:%s\"\n", crc, src, dest, pinfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Do we have duplicate checking at all in the RF>IS direction?
|
||||||
|
|
||||||
|
if (save_igate_config_p->rx2ig_dedupe_time == 0) {
|
||||||
|
if (s_debug >= 2) {
|
||||||
|
text_color_set(DW_COLOR_DEBUG);
|
||||||
|
dw_printf ("rx_to_ig_allow? YES, no dedupe checking\n");
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Yes, check for duplicates within certain time.
|
||||||
|
|
||||||
for (j=0; j<RX2IG_HISTORY_MAX; j++) {
|
for (j=0; j<RX2IG_HISTORY_MAX; j++) {
|
||||||
if (rx2ig_checksum[j] == crc && rx2ig_time_stamp[j] >= now - RX2IG_DEDUPE_TIME) {
|
if (rx2ig_checksum[j] == crc && rx2ig_time_stamp[j] >= now - save_igate_config_p->rx2ig_dedupe_time) {
|
||||||
if (s_debug >= 2) {
|
if (s_debug >= 2) {
|
||||||
text_color_set(DW_COLOR_DEBUG);
|
text_color_set(DW_COLOR_DEBUG);
|
||||||
// could be multiple entries and this might not be the most recent.
|
// could be multiple entries and this might not be the most recent.
|
||||||
|
|
12
igate.h
12
igate.h
|
@ -39,6 +39,9 @@ struct igate_config_s {
|
||||||
char t2_passcode[8]; /* Max. 5 digits. Could be "-1". */
|
char t2_passcode[8]; /* Max. 5 digits. Could be "-1". */
|
||||||
|
|
||||||
char *t2_filter; /* Optional filter for IS -> RF direction. */
|
char *t2_filter; /* Optional filter for IS -> RF direction. */
|
||||||
|
/* This is the "server side" filter. */
|
||||||
|
/* A better name would be subscription or something */
|
||||||
|
/* like that because we can only ask for more. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* For transmitting.
|
* For transmitting.
|
||||||
|
@ -69,6 +72,11 @@ struct igate_config_s {
|
||||||
/* We allow additional flexibility of 0 to disable feature */
|
/* We allow additional flexibility of 0 to disable feature */
|
||||||
/* or a small number to allow more. */
|
/* or a small number to allow more. */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Receiver to IS data options.
|
||||||
|
*/
|
||||||
|
int rx2ig_dedupe_time; /* seconds. 0 to disable. */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Special SATgate mode to delay packets heard directly.
|
* Special SATgate mode to delay packets heard directly.
|
||||||
*/
|
*/
|
||||||
|
@ -82,6 +90,10 @@ struct igate_config_s {
|
||||||
#define IGATE_TX_LIMIT_5_DEFAULT 20
|
#define IGATE_TX_LIMIT_5_DEFAULT 20
|
||||||
#define IGATE_TX_LIMIT_5_MAX 80
|
#define IGATE_TX_LIMIT_5_MAX 80
|
||||||
|
|
||||||
|
#define IGATE_RX2IG_DEDUPE_TIME 0 /* Issue 85. 0 means disable dupe checking in RF>IS direction. */
|
||||||
|
/* See comments in rx_to_ig_remember & rx_to_ig_allow. */
|
||||||
|
/* Currently there is no configuration setting to change this. */
|
||||||
|
|
||||||
#define DEFAULT_SATGATE_DELAY 10
|
#define DEFAULT_SATGATE_DELAY 10
|
||||||
#define MIN_SATGATE_DELAY 5
|
#define MIN_SATGATE_DELAY 5
|
||||||
#define MAX_SATGATE_DELAY 30
|
#define MAX_SATGATE_DELAY 30
|
||||||
|
|
Loading…
Reference in New Issue