aboutsummaryrefslogtreecommitdiff
path: root/draft-summermatter-set-union.xml
diff options
context:
space:
mode:
Diffstat (limited to 'draft-summermatter-set-union.xml')
-rw-r--r--draft-summermatter-set-union.xml50
1 files changed, 26 insertions, 24 deletions
diff --git a/draft-summermatter-set-union.xml b/draft-summermatter-set-union.xml
index 3548fa9..98b2a3b 100644
--- a/draft-summermatter-set-union.xml
+++ b/draft-summermatter-set-union.xml
@@ -2044,10 +2044,12 @@ hashSum | 0x0101 | 0x5151 | 0x5050 | 0x0000 |
2044 <figure anchor="performance_formulas_operationmode_code"> 2044 <figure anchor="performance_formulas_operationmode_code">
2045 <artwork name="" type="" align="left" alt=""><![CDATA[ 2045 <artwork name="" type="" align="left" alt=""><![CDATA[
2046# CONSTANTS: 2046# CONSTANTS:
2047# IBF_BUCKET_NUMBER_FACTOR = 2: The amount the IBF gets increased if decoding fails 2047# IBF_BUCKET_NUMBER_FACTOR = 2: The amount the IBF gets increased if
2048# RTT_MIN_FULL = 2: Minimal round trips used for full syncronisation (always 2 or 2.5) 2048# decoding fails
2049# RTT_MIN_FULL = 2: Minimal round trips used for full Synchronisation
2049# IBF_MIN_SIZE = 37: The minimal size of an IBF 2050# IBF_MIN_SIZE = 37: The minimal size of an IBF
2050# MAX_BUCKETS_PER_MESSAGE: Custom value depending on the underlying protocol 2051# MAX_BUCKETS_PER_MESSAGE: Custom value depending on the underlying
2052# protocol
2051# INPUTS: 2053# INPUTS:
2052# avg_es: The average element size 2054# avg_es: The average element size
2053# lss: The initial local set size 2055# lss: The initial local set size
@@ -2056,7 +2058,8 @@ hashSum | 0x0101 | 0x5151 | 0x5050 | 0x0000 |
2056# rsd: the estimated remote set difference calculated by the SE 2058# rsd: the estimated remote set difference calculated by the SE
2057# rtt: the tradeoff between round trips and bandwidth 2059# rtt: the tradeoff between round trips and bandwidth
2058# OUTPUT: 2060# OUTPUT:
2059# FULL_SYNC_REMOTE_SENDING_FIRST, FULL_SYNC_LOCAL_SENDING_FIRST or DIFFERENTIAL_SYNC 2061# FULL_SYNC_REMOTE_SENDING_FIRST, FULL_SYNC_LOCAL_SENDING_FIRST or
2062# DIFFERENTIAL_SYNC
2060 2063
2061FUNCTION decide_operation_mode(avg_es, 2064FUNCTION decide_operation_mode(avg_es,
2062 lss, 2065 lss,
@@ -2066,11 +2069,6 @@ FUNCTION decide_operation_mode(avg_es,
2066 rtt) 2069 rtt)
2067 2070
2068 # If a set size is zero always do full sync 2071 # If a set size is zero always do full sync
2069 # TODO: check if these two conditions are
2070 # actually meaningful, I suspect even without
2071 # this check at the beginning the logic below
2072 # should always yield the same result for these
2073 # extreme cases, allowing us to omit this code.
2074 IF 0 == rss THEN 2072 IF 0 == rss THEN
2075 RETURN FULL_SYNC_LOCAL_SENDING_FIRST 2073 RETURN FULL_SYNC_LOCAL_SENDING_FIRST
2076 END IF 2074 END IF
@@ -2078,25 +2076,27 @@ FUNCTION decide_operation_mode(avg_es,
2078 RETURN FULL_SYNC_REMOTE_SENDING_FIRST 2076 RETURN FULL_SYNC_REMOTE_SENDING_FIRST
2079 END IF 2077 END IF
2080 2078
2081 # Estimate required transferred bytes when doing a full synchronisation 2079 # Estimate required transferred bytes when doing a full
2082 # and transmitting local set first. 2080 # synchronisation and transmitting local set first.
2081 semh = sizeof(ELEMENT_MSG_HEADER)
2083 estimated_total_diff = rsd + lsd 2082 estimated_total_diff = rsd + lsd
2084 total_elements_local_send = rsd + lss 2083 total_elements_local_send = rsd + lss
2085 cost_local_full_sync = avg_es * total_elements_local_send 2084 cost_local_full_sync = avg_es * total_elements_local_send
2086 + total_elements_local_send * sizeof(ELEMENT_MSG_HEADER) 2085 + total_elements_local_send * semh
2087 + sizeof(FULL_DONE_MSG_HEADER) * 2 2086 + sizeof(FULL_DONE_MSG_HEADER) * 2
2088 + RTT_MIN_FULL * rtt 2087 + RTT_MIN_FULL * rtt
2089 2088
2090 # Estimate required transferred bytes when doing a full synchronisation 2089 # Estimate required transferred bytes when doing a full
2091 # and transmitting remote set first. 2090 # synchronisation and transmitting remote set first.
2092 total_elements_remote_send = lsd + rss 2091 total_elements_remote_send = lsd + rss
2093 cost_remote_full_sync = avg_es * total_elements_remote_send 2092 cost_remote_full_sync = avg_es * total_elements_remote_send
2094 + total_elements_remote_send * sizeof(ELEMENT_MSG_HEADER) 2093 + total_elements_remote_send * semh
2095 + sizeof(FULL_DONE_MSG_HEADER) * 2 2094 + sizeof(FULL_DONE_MSG_HEADER) * 2
2096 + (RTT_MIN_FULL + 0.5) * rtt 2095 + (RTT_MIN_FULL + 0.5) * rtt
2097 + sizeof(REQUEST_FULL_MSG) 2096 + sizeof(REQUEST_FULL_MSG)
2098 2097
2099 # Estimate required transferred bytes when doing a differential synchronisation 2098 # Estimate required transferred bytes when doing a differential
2099 # synchronisation
2100 2100
2101 # Estimate messages required to transfer IBF 2101 # Estimate messages required to transfer IBF
2102 ibf_bucket_count = estimated_total_diff * IBF_BUCKET_NUMBER_FACTOR 2102 ibf_bucket_count = estimated_total_diff * IBF_BUCKET_NUMBER_FACTOR
@@ -2167,7 +2167,8 @@ END FUNCTION
2167 <figure anchor="performance_formula_ibf_parameters_code"> 2167 <figure anchor="performance_formula_ibf_parameters_code">
2168 <artwork name="" type="" align="left" alt=""><![CDATA[ 2168 <artwork name="" type="" align="left" alt=""><![CDATA[
2169# CONSTANTS: 2169# CONSTANTS:
2170# IBF_BUCKET_NUMBER_FACTOR = 2: The amount the IBF gets increased if decoding fails 2170# IBF_BUCKET_NUMBER_FACTOR = 2: The amount the IBF gets increased
2171 if decoding fails
2171# Inputs: 2172# Inputs:
2172# sd: Estimated set difference 2173# sd: Estimated set difference
2173# Output: 2174# Output:
@@ -2319,14 +2320,15 @@ FUNCTION END
2319# INPUTS: 2320# INPUTS:
2320# ibf: The IBF 2321# ibf: The IBF
2321# offset: The offset which defines the starting point from which bucket 2322# offset: The offset which defines the starting point from which bucket
2322 the packed operation starts 2323 the packed operation starts
2323# count: The number of buckets in the array that will be packed 2324# count: The number of buckets in the array that will be packed
2324# cbl: The bit length of the counter can be found in the 2325# cbl: The bit length of the counter can be found in the
2325 ibf message in the ibf_counter_bit_length field 2326 ibf message in the ibf_counter_bit_length field
2326# pd: A byte array which contains the data packed with the pack_counter 2327# pd: A byte array which contains the data packed with the pack_counter
2327 function 2328 function
2328# OUTPUTS: 2329# OUTPUTS:
2329# returns: Nothing because the unpacked counter is saved directly into the IBF 2330# returns: Nothing because the unpacked counter is saved directly
2331 into the IBF
2330 2332
2331FUNCTION unpack_counter(ibf, offset, count, cbl, pd) 2333FUNCTION unpack_counter(ibf, offset, count, cbl, pd)
2332 ibf_bucket_ctr = 0 2334 ibf_bucket_ctr = 0
@@ -3096,9 +3098,9 @@ Type | Name | References | Description
3096 full set to the other 3098 full set to the other
3097 peer. 3099 peer.
3098 560 | SETU_P2P_DEMAND | [This.I-D] | Demand the whole 3100 560 | SETU_P2P_DEMAND | [This.I-D] | Demand the whole
3099 element from the other 3101 element from the
3100 peer, given only the 3102 otherpeer, given
3101 hash code. 3103 only the hash code.
3102 561 | SETU_P2P_INQUIRY | [This.I-D] | Tell the other peer 3104 561 | SETU_P2P_INQUIRY | [This.I-D] | Tell the other peer
3103 to send a list of 3105 to send a list of
3104 hashes that match 3106 hashes that match