RFC Errata
Found 1 record.
Status: Reported (1)
RFC 9426, "BATched Sparse (BATS) Coding Scheme for Multi-hop Data Transport", July 2023
Source of RFC: IRTF
Errata ID: 8477
Status: Reported
Type: Technical
Publication Format(s) : TEXT, HTML
Reported By: Marco Munizaga
Date Reported: 2025-06-23
Section 3.2 says:
function DegreeSampler(j, DD) Let CDF be an array CDF[0] = 0 for i = 1, ..., MAX_DEG do CDF[i] = CDF[i - 1] + DD[i] Rand_Init(j) r = Rand() % CDF[MAX_DEG] for d = 1, ..., MAX_DEG do if r >= CDF[d] do return min(d, K) return min(MAX_DEG, K) Figure 7: Degree Sampler Function
It should say:
function DegreeSampler(j, DD) Let CDF be an array CDF[0] = 0 for i = 1, ..., MAX_DEG do CDF[i] = CDF[i - 1] + DD[i] Rand_Init(j) r = Rand() % CDF[MAX_DEG] for d = 1, ..., MAX_DEG do if r < CDF[d] do return min(d, K) return min(MAX_DEG, K) Figure 7: Degree Sampler Function
Notes:
- if r >= CDF[d] do
+ if r < CDF[d] do
When sampling a degree from the degree distribution using the CDF, you should check that the random number is *less than* the CDF at that degree. As an example, assume the CDF is [0, 10, 100], and r is from [0,100). This means that d=1 should be chosen 10% of the time. The old code would choose d=1 90% of the time. It would also never choose any other value besides d=1, as later CDF values are guaranteed larger. If r was smaller than CDF[1] it is guaranteed to be smaller than CDF[2]