summaryrefslogtreecommitdiffstats
path: root/3rdparty/openpgm-svn-r1135/pgm/fec-block.txt
blob: 8278fb6ca7670fbca4133c8e699106734212a7b1 (plain) (blame)
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
from rfc5052
------------


step one:

   Input:

   B  -- Maximum Source Block Length, i.e., the maximum number of source
         symbols per source block

   L  -- Transfer Length in octets

   E  -- Encoding Symbol Length in octets

   Output:

   T  -- the number of source symbols in the object.

   N  -- the number of source blocks into which the object shall be
         partitioned.

   Algorithm:

   1.  The number of source symbols in the transport object is computed
       as T = ceil[L/E].

   2.  The transport object shall be partitioned into N = ceil[T/B]
       source blocks.


B = maximum TPDU - IP header ( - UDP header ) - PGM header
L = APDU length (pgm_transport_send length parameter).
E = 1 (fixed).

T = ceil( L / E ) = ceil( L / 1 ) = L
N = ceil( T / B ) = ceil( L / B )

step two:

   Input:

   T  -- the number of source symbols in the object.

   N  -- the number of source blocks into which the object is
      partitioned.

   Output:

   I  -- the number of larger source blocks.

   A_large  -- the length of each of the larger source blocks in
      symbols.

   A_small  -- the length of each of the smaller source blocks in
      symbols.

   Algorithm:

   1.  A_large = ceil[T/N]

   2.  A_small = floor[T/N]

   3.  I = T - A_small * N