aboutsummaryrefslogtreecommitdiff
path: root/src/trunnel/conflux.trunnel
blob: 4f1855faf3c4cda2793d9041c582df9a18d0c448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
 * This file contains the definition for the Conflux related cells. See
 * proposal 329.
 */

/* No Opinion means the endpoint can choose whatever it thinks is best. */
const CONFLUX_UX_NO_OPINION = 0x00;
/* Min latency always only uses the lowest RTT */
const CONFLUX_UX_MIN_LATENCY = 0x01;
/* Min latency always only uses the lowest RTT */
const CONFLUX_UX_LOW_MEM_LATENCY = 0x02;
/* Use a high-throughput algorithm that maximizes throughput
 * by using the full congestion window of all circuits, at the expense
 * of more reordering queue at the receiver */
const CONFLUX_UX_HIGH_THROUGHPUT  = 0x03;
/* THRPT_LO uses a high-throughput algorithm that tries to minimize
 * out-of-order queues at the receiver */
const CONFLUX_UX_LOW_MEM_THROUGHPUT  = 0x04;

/* The RELAY_CONFLUX_LINK definition. */
struct trn_cell_conflux_link {
  /* Version field. */
  u8 version IN [0x01];

  /* Payload */
  u8 payload[];
};

/* The RELAY_CIRCUIT_LINKED definition. */
struct trn_cell_conflux_linked {
  /* Version field. */
  u8 version IN [0x01];

  /* Payload of the cell. */
  u8 payload[];
};

/* The RELAY_CONFLUX_LINKED_ACK definition. */
struct trn_cell_conflux_linked_ack {
  /* Payload. At the moment, empty. */
  u8 payload[];
};

/* The RELAY_CONFLUX_SWITCH definition. */
struct trn_cell_conflux_switch {
  /* Relative sequence number. */
  u32 seqnum;
};

/* The payload version 1 of RELAY_CONFLUX_LINK and RELAY_CIRCUIT_LINKED cells.
 * */
struct trn_cell_conflux_link_payload_v1 {
  /* Used to identify the other conflux to link with. */
  u8 nonce[32];

  /* Last sequence number sent and received. */
  u64 last_seqno_sent;
  u64 last_seqno_recv;

  /* Desired user experience behavior */
  u8 desired_ux IN [CONFLUX_UX_NO_OPINION,
                   CONFLUX_UX_MIN_LATENCY,
                   CONFLUX_UX_LOW_MEM_LATENCY,
                   CONFLUX_UX_LOW_MEM_THROUGHPUT,
                   CONFLUX_UX_HIGH_THROUGHPUT];
};