Skip to content

Commit b093f78

Browse files
committed
Use multipath backup, not standby
1 parent d49cbe7 commit b093f78

File tree

12 files changed

+51
-51
lines changed

12 files changed

+51
-51
lines changed

UnitTest1/unittest1.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2841,8 +2841,8 @@ namespace UnitTest1
28412841
Assert::AreEqual(ret, 0);
28422842
}
28432843

2844-
TEST_METHOD(multipath_standby) {
2845-
int ret = multipath_standby_test();
2844+
TEST_METHOD(multipath_backup) {
2845+
int ret = multipath_backup_test();
28462846

28472847
Assert::AreEqual(ret, 0);
28482848
}

picoquic/frames.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5508,9 +5508,9 @@ int picoquic_queue_path_abandon_frame(picoquic_cnx_t* cnx,
55085508
return ret;
55095509
}
55105510

5511-
/* Multipath PATH STANDBY and AVAILABLE frames
5511+
/* Multipath PATH BACKUP and AVAILABLE frames
55125512
*/
5513-
uint8_t* picoquic_format_path_available_or_standby_frame(
5513+
uint8_t* picoquic_format_path_available_or_backup_frame(
55145514
uint8_t* bytes, const uint8_t* bytes_max, uint64_t frame_type,
55155515
uint64_t path_id, uint64_t sequence, int* more_data)
55165516
{
@@ -5525,7 +5525,7 @@ uint8_t* picoquic_format_path_available_or_standby_frame(
55255525
return bytes;
55265526
}
55275527

5528-
int picoquic_queue_path_available_or_standby_frame(
5528+
int picoquic_queue_path_available_or_backup_frame(
55295529
picoquic_cnx_t * cnx, picoquic_path_t * path_x, picoquic_path_status_enum status)
55305530
{
55315531
int ret = 0;
@@ -5544,7 +5544,7 @@ int picoquic_queue_path_available_or_standby_frame(
55445544
path_x->p_remote_cnxid->sequence;
55455545
int is_pure_ack = 0;
55465546
int more_data = 0;
5547-
uint8_t* bytes_next = picoquic_format_path_available_or_standby_frame(
5547+
uint8_t* bytes_next = picoquic_format_path_available_or_backup_frame(
55485548
frame_buffer, frame_buffer + sizeof(frame_buffer), frame_type, path_id, sequence, &more_data);
55495549
size_t consumed = bytes_next - frame_buffer;
55505550
ret = picoquic_queue_misc_frame(cnx, frame_buffer, consumed, is_pure_ack,
@@ -5557,7 +5557,7 @@ int picoquic_queue_path_available_or_standby_frame(
55575557
return ret;
55585558
}
55595559

5560-
const uint8_t* picoquic_skip_path_available_or_standby_frame(const uint8_t* bytes, const uint8_t* bytes_max)
5560+
const uint8_t* picoquic_skip_path_available_or_backup_frame(const uint8_t* bytes, const uint8_t* bytes_max)
55615561
{
55625562
/* This code assumes that the frame type is already skipped */
55635563
if ((bytes = picoquic_frames_varint_skip(bytes, bytes_max)) != NULL){
@@ -5566,7 +5566,7 @@ const uint8_t* picoquic_skip_path_available_or_standby_frame(const uint8_t* byte
55665566
return bytes;
55675567
}
55685568

5569-
const uint8_t* picoquic_parse_path_available_or_standby_frame(const uint8_t* bytes, const uint8_t* bytes_max,
5569+
const uint8_t* picoquic_parse_path_available_or_backup_frame(const uint8_t* bytes, const uint8_t* bytes_max,
55705570
uint64_t* path_id, uint64_t* sequence)
55715571
{
55725572
if ((bytes = picoquic_frames_varint_decode(bytes, bytes_max, path_id)) != NULL){
@@ -5575,7 +5575,7 @@ const uint8_t* picoquic_parse_path_available_or_standby_frame(const uint8_t* byt
55755575
return bytes;
55765576
}
55775577

5578-
const uint8_t* picoquic_decode_path_available_or_standby_frame(const uint8_t* bytes, const uint8_t* bytes_max,
5578+
const uint8_t* picoquic_decode_path_available_or_backup_frame(const uint8_t* bytes, const uint8_t* bytes_max,
55795579
uint64_t frame_id64, picoquic_cnx_t* cnx, uint64_t current_time)
55805580
{
55815581
uint64_t path_id;
@@ -5588,7 +5588,7 @@ const uint8_t* picoquic_decode_path_available_or_standby_frame(const uint8_t* by
55885588
picoquic_connection_error_ex(cnx, PICOQUIC_TRANSPORT_FRAME_FORMAT_ERROR,
55895589
frame_id64, "multipath not negotiated");
55905590
}
5591-
else if ((bytes = picoquic_parse_path_available_or_standby_frame(bytes, bytes_max, &path_id, &sequence)) == NULL) {
5591+
else if ((bytes = picoquic_parse_path_available_or_backup_frame(bytes, bytes_max, &path_id, &sequence)) == NULL) {
55925592
/* Bad frame encoding */
55935593
picoquic_connection_error_ex(cnx, PICOQUIC_TRANSPORT_FRAME_FORMAT_ERROR,
55945594
frame_id64, "bad status frame");
@@ -5599,18 +5599,18 @@ const uint8_t* picoquic_decode_path_available_or_standby_frame(const uint8_t* by
55995599
if (path_number < 0) {
56005600
/* Invalid path ID. Just ignore this frame. Add line in log for debug */
56015601
picoquic_log_app_message(cnx, "Ignore path %s frame with invalid ID: %" PRIu64,
5602-
(frame_id64 == picoquic_frame_type_path_available)?"available":"standby", path_id);
5602+
(frame_id64 == picoquic_frame_type_path_available)?"available":"backup", path_id);
56035603
}
56045604
else {
56055605
if (cnx->path[path_number]->status_sequence_to_receive_next > sequence) {
56065606
/* Old frame, ignore. */
56075607
}
56085608
else {
5609-
/* Status will be set to 1 for standby, 2 for available.
5610-
* Default status is 0?
5609+
/* Status will be set to 1 for backup, 0 for available.
5610+
* Default status is 0.
56115611
*/
56125612
cnx->path[path_number]->status_sequence_to_receive_next = sequence + 1;
5613-
cnx->path[path_number]->path_is_standby = (frame_id64 == picoquic_frame_type_path_available) ? 0:1;
5613+
cnx->path[path_number]->path_is_backup = (frame_id64 == picoquic_frame_type_path_available) ? 0:1;
56145614
}
56155615
}
56165616
}
@@ -5626,7 +5626,7 @@ int picoquic_path_available_or_backup_frame_need_repeat(picoquic_cnx_t* cnx, con
56265626

56275627
*no_need_to_repeat = 0;
56285628

5629-
if ((bytes = picoquic_parse_path_available_or_standby_frame(bytes, bytes_max, &path_id, &sequence)) == NULL){
5629+
if ((bytes = picoquic_parse_path_available_or_backup_frame(bytes, bytes_max, &path_id, &sequence)) == NULL){
56305630
/* Malformed frame, do not retransmit */
56315631
*no_need_to_repeat = 1;
56325632
}
@@ -6541,7 +6541,7 @@ int picoquic_decode_frames(picoquic_cnx_t* cnx, picoquic_path_t * path_x, const
65416541
break;
65426542
case picoquic_frame_type_path_backup:
65436543
case picoquic_frame_type_path_available:
6544-
bytes = picoquic_decode_path_available_or_standby_frame(bytes, bytes_max, frame_id64, cnx, current_time);
6544+
bytes = picoquic_decode_path_available_or_backup_frame(bytes, bytes_max, frame_id64, cnx, current_time);
65456545
ack_needed = 1;
65466546
break;
65476547
case picoquic_frame_type_max_path_id:
@@ -6889,7 +6889,7 @@ int picoquic_skip_frame(const uint8_t* bytes, size_t bytes_maxsize, size_t* cons
68896889
break;
68906890
case picoquic_frame_type_path_backup:
68916891
case picoquic_frame_type_path_available:
6892-
bytes = picoquic_skip_path_available_or_standby_frame(bytes, bytes_max);
6892+
bytes = picoquic_skip_path_available_or_backup_frame(bytes, bytes_max);
68936893
*pure_ack = 0;
68946894
break;
68956895
case picoquic_frame_type_max_path_id:

picoquic/logger.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ size_t textlog_path_abandon_frame(FILE* F, const uint8_t* bytes, size_t bytes_ma
13981398
return byte_index;
13991399
}
14001400

1401-
size_t textlog_path_available_or_standby_frame(FILE* F, const uint8_t* bytes, size_t bytes_max)
1401+
size_t textlog_path_available_or_backup_frame(FILE* F, const uint8_t* bytes, size_t bytes_max)
14021402
{
14031403
const uint8_t* bytes_end = bytes + bytes_max;
14041404
const uint8_t* bytes0 = bytes;
@@ -1755,7 +1755,7 @@ void picoquic_textlog_frames(FILE* F, uint64_t cnx_id64, const uint8_t* bytes, s
17551755
break;
17561756
case picoquic_frame_type_path_backup:
17571757
case picoquic_frame_type_path_available:
1758-
byte_index += textlog_path_available_or_standby_frame(F, bytes + byte_index, length - byte_index);
1758+
byte_index += textlog_path_available_or_backup_frame(F, bytes + byte_index, length - byte_index);
17591759
break;
17601760
case picoquic_frame_type_max_path_id:
17611761
byte_index += textlog_max_path_id_frame(F, bytes + byte_index, length - byte_index);

picoquic/logwriter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ static const uint8_t* picoquic_log_path_available_or_backup_frame(FILE* f, const
443443
{
444444
const uint8_t* bytes_begin = bytes;
445445
bytes = picoquic_log_varint_skip(bytes, bytes_max); /* frame type as varint */
446-
bytes = picoquic_skip_path_available_or_standby_frame(bytes, bytes_max); /* skip available or standby frame */
446+
bytes = picoquic_skip_path_available_or_backup_frame(bytes, bytes_max); /* skip available or backup frame */
447447
picoquic_binlog_frame(f, bytes_begin, bytes);
448448

449449
return bytes;

picoquic/picoquic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ typedef enum {
229229

230230
typedef enum {
231231
picoquic_path_status_available = 0, /* Path available for sending */
232-
picoquic_path_status_standby = 1 /* Do not use if other path available */
232+
picoquic_path_status_backup = 1 /* Do not use if other path available */
233233
} picoquic_path_status_enum;
234234

235235
/*

picoquic/picoquic_internal.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ typedef struct st_picoquic_path_t {
10941094
unsigned int challenge_failed : 1;
10951095
unsigned int response_required : 1;
10961096
unsigned int nat_challenge_required : 1;
1097-
unsigned int path_is_standby : 1;
1097+
unsigned int path_is_backup : 1;
10981098
unsigned int path_is_demoted : 1;
10991099
unsigned int path_abandon_received : 1;
11001100
unsigned int path_abandon_sent : 1;
@@ -2042,8 +2042,8 @@ void picoquic_update_peer_addr(picoquic_path_t* path_x, const struct sockaddr* p
20422042

20432043
int picoquic_skip_frame(const uint8_t* bytes, size_t bytes_max, size_t* consumed, int* pure_ack);
20442044
const uint8_t* picoquic_skip_path_abandon_frame(const uint8_t* bytes, const uint8_t* bytes_max);
2045-
const uint8_t* picoquic_skip_path_available_or_standby_frame(const uint8_t* bytes, const uint8_t* bytes_max);
2046-
int picoquic_queue_path_available_or_standby_frame(
2045+
const uint8_t* picoquic_skip_path_available_or_backup_frame(const uint8_t* bytes, const uint8_t* bytes_max);
2046+
int picoquic_queue_path_available_or_backup_frame(
20472047
picoquic_cnx_t* cnx, picoquic_path_t* path_x, picoquic_path_status_enum status);
20482048
/* Internal only API, notify that next path is now allowed. */
20492049
void picoquic_test_and_signal_new_path_allowed(picoquic_cnx_t* cnx);

picoquic/quicctx.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ void picoquic_delete_abandoned_paths(picoquic_cnx_t* cnx, uint64_t current_time,
18161816
if (cnx->path[i]->path_is_demoted) {
18171817
continue;
18181818
}
1819-
if (cnx->path[i]->path_is_standby && path_backup < 0) {
1819+
if (cnx->path[i]->path_is_backup && path_backup < 0) {
18201820
path_backup = i;
18211821
}
18221822
else {
@@ -1825,8 +1825,8 @@ void picoquic_delete_abandoned_paths(picoquic_cnx_t* cnx, uint64_t current_time,
18251825
}
18261826
}
18271827
if (path_left < 0 && path_backup >= 0) {
1828-
cnx->path[path_backup]->path_is_standby = 0;
1829-
(void)picoquic_queue_path_available_or_standby_frame(cnx, cnx->path[path_backup], picoquic_path_status_available);
1828+
cnx->path[path_backup]->path_is_backup = 0;
1829+
(void)picoquic_queue_path_available_or_backup_frame(cnx, cnx->path[path_backup], picoquic_path_status_available);
18301830
}
18311831
}
18321832
}
@@ -2546,8 +2546,8 @@ int picoquic_set_path_status(picoquic_cnx_t* cnx, uint64_t unique_path_id, picoq
25462546
int ret = 0;
25472547
int path_id = picoquic_get_path_id_from_unique(cnx, unique_path_id);
25482548
if (path_id >= 0) {
2549-
cnx->path[path_id]->path_is_standby = (status != picoquic_path_status_available);
2550-
ret = picoquic_queue_path_available_or_standby_frame(cnx, cnx->path[path_id], status);
2549+
cnx->path[path_id]->path_is_backup = (status != picoquic_path_status_available);
2550+
ret = picoquic_queue_path_available_or_backup_frame(cnx, cnx->path[path_id], status);
25512551
}
25522552
return ret;
25532553
}

picoquic/sender.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3954,7 +3954,7 @@ int picoquic_prepare_segment(picoquic_cnx_t* cnx, picoquic_path_t* path_x, picoq
39543954
* criteria evolves over time:
39553955
* - as long as continuity is not verified, a path is not available.
39563956
* - if continuity is verified but the path is not "validated", the path
3957-
* is marked as standby.
3957+
* is marked as backup.
39583958
* - if the path is validated and no other path has a higher priority,
39593959
* the path is available.
39603960
* If several paths are available at the same priority level, the code
@@ -3964,14 +3964,14 @@ int picoquic_prepare_segment(picoquic_cnx_t* cnx, picoquic_path_t* path_x, picoq
39643964
*
39653965
* There are potential corner cases. If a challenge or a response is required
39663966
* on a path, that takes priority over sending data. A challenge may be required
3967-
* on a "standby" path to test continuity if no data has been received for
3967+
* on a "backup" path to test continuity if no data has been received for
39683968
* a long time, or maybe following a packet loss episode.
39693969
*
39703970
* If all available paths are blocked by congestion control and acknowledgements
39713971
* need to be sent, the lowest RTT path not blocked by pacing is selected.
39723972
*
39733973
* Need to consider special code for dealing with packet losses. If a path
3974-
* exhibits persistent packet loss, it loses its priority and moves to "standby"
3974+
* exhibits persistent packet loss, it loses its priority and moves to "backup"
39753975
* state. At that point, the "challenge needed" flag is set, triggering a
39763976
* continuity test.
39773977
*
@@ -4006,8 +4006,8 @@ int picoquic_prepare_segment(picoquic_cnx_t* cnx, picoquic_path_t* path_x, picoq
40064006
* Instead, these various interactions may need to be selective, mark some
40074007
* paths as ready based on conditions.
40084008
*
4009-
* The handling of "standby" should be integrated in the sending process,
4010-
* so congestion controlled data is not sent on standby path, and delay
4009+
* The handling of "backup" should be integrated in the sending process,
4010+
* so congestion controlled data is not sent on backup path, and delay
40114011
* sensitive data is not sent on suspect paths.
40124012
*/
40134013

@@ -4069,7 +4069,7 @@ static int picoquic_select_next_path_mp(picoquic_cnx_t* cnx, uint64_t current_ti
40694069
}
40704070

40714071
for (i = 0; i < cnx->nb_paths; i++) {
4072-
int path_priority = (cnx->path[i]->path_is_standby) ? 0 : 1;
4072+
int path_priority = (cnx->path[i]->path_is_backup) ? 0 : 1;
40734073
cnx->path[i]->is_probing_nat = 0;
40744074
if (cnx->path[i]->nb_retransmit > 0) {
40754075
path_priority = 0;
@@ -4226,8 +4226,8 @@ static int picoquic_select_next_path_mp(picoquic_cnx_t* cnx, uint64_t current_ti
42264226
}
42274227
path_id = 0;
42284228
}
4229-
if (cnx->path[path_id]->path_is_standby && challenge_path != path_id) {
4230-
/* Set the selected path to available if it was standby. Selecting a standby
4229+
if (cnx->path[path_id]->path_is_backup && challenge_path != path_id) {
4230+
/* Set the selected path to available if it was backup. Selecting a backup
42314231
* path means that the available path was of lower quality, the only exception
42324232
* being if the selection was due to a pending challenge. */
42334233
(void)picoquic_set_path_status(cnx, cnx->path[path_id]->unique_path_id, picoquic_path_status_available);

picoquic_t/picoquic_t.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ static const picoquic_test_def_t test_table[] = {
491491
{ "multipath_stream_af", multipath_stream_af_test },
492492
{ "multipath_datagram", multipath_datagram_test },
493493
{ "multipath_dg_af", multipath_dg_af_test },
494-
{ "multipath_standby", multipath_standby_test },
494+
{ "multipath_backup", multipath_backup_test },
495495
{ "multipath_standup", multipath_standup_test },
496496
{ "multipath_discovery", multipath_discovery_test },
497497
{ "multipath_qlog", multipath_qlog_test },

picoquictest/multipath_test.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ typedef enum {
446446
multipath_test_abandon,
447447
multipath_test_datagram,
448448
multipath_test_dg_af,
449-
multipath_test_standby,
449+
multipath_test_backup,
450450
multipath_test_standup,
451451
multipath_test_tunnel,
452452
multipath_test_fail,
@@ -901,9 +901,9 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
901901
DBG_PRINTF("Cannot set stream affinity, ret = %d", ret);
902902
}
903903
}
904-
else if (test_id == multipath_test_standby ||
904+
else if (test_id == multipath_test_backup ||
905905
test_id == multipath_test_standup) {
906-
ret = picoquic_set_path_status(test_ctx->cnx_client, 1, picoquic_path_status_standby);
906+
ret = picoquic_set_path_status(test_ctx->cnx_client, 1, picoquic_path_status_backup);
907907
}
908908
}
909909

@@ -1134,13 +1134,13 @@ int multipath_test_one(uint64_t max_completion_microsec, multipath_test_enum_t t
11341134
ret = multipath_verify_datagram_sent(&dg_ctx, test_id);
11351135
}
11361136

1137-
/* In the standby scenario, verify that the flag is set
1137+
/* In the backup scenario, verify that the flag is set
11381138
* correctly at the server, and that not too much data is
1139-
* sent on standby path.
1139+
* sent on backup path.
11401140
*/
1141-
if (ret == 0 && (test_id == multipath_test_standby)) {
1142-
if (!test_ctx->cnx_server->path[1]->path_is_standby) {
1143-
DBG_PRINTF("Standby not set on server path 1 (%d).\n", test_ctx->cnx_server->path[1]->path_is_standby);
1141+
if (ret == 0 && (test_id == multipath_test_backup)) {
1142+
if (!test_ctx->cnx_server->path[1]->path_is_backup) {
1143+
DBG_PRINTF("Backup not set on server path 1 (%d).\n", test_ctx->cnx_server->path[1]->path_is_backup);
11441144
ret = -1;
11451145
}
11461146
else if (test_ctx->cnx_server->path[1]->delivered > 50000) {
@@ -1378,11 +1378,11 @@ int multipath_dg_af_test()
13781378
return multipath_test_one(max_completion_microsec, multipath_test_dg_af);
13791379
}
13801380

1381-
int multipath_standby_test()
1381+
int multipath_backup_test()
13821382
{
13831383
uint64_t max_completion_microsec = 2000000;
13841384

1385-
return multipath_test_one(max_completion_microsec, multipath_test_standby);
1385+
return multipath_test_one(max_completion_microsec, multipath_test_backup);
13861386
}
13871387

13881388
int multipath_standup_test()

0 commit comments

Comments
 (0)