Plan
rpps.plan ¶
Burst time plans: when, and on which carrier, each burst of a TDMA / MF-TDMA return link is, and what it is
A plan is what a network's controller tells its terminals (DVB-RCS2's SCT, FCT2, BCT and TBTP2, ETSI EN 301 545-2 clause 6.2.2; DVB-RCS's SCT/FCT/TCT/TBTP, EN 301 790): RPPS holds it in that model, whatever it came from.
sequences superframe sequences: superframe `count` starts at `start` (clock ticks) and each lasts `duration`;
a centre frequency; frames at time and frequency offsets from the superframe's, each of a frame type.
Frames are numbered from 0 by ascending lowest burst frequency, then start time, then frame type
(EN 301 545-2 7.5.1.1)
frame_types a grid of bandwidth-time units (BTUs: `btu` duration in ticks, bandwidth, symbol rate) `time_units` long
on each carrier (`grid`: the carriers' offsets from the frame's centre); timeslot sections (tx type,
repeat) fill the grid in time on the lowest carrier, then the next (7.5.1.3): a slot is as many BTUs as
its tx type's `btus`, a tx type 0 one BTU (a slot an assignment gives a type to)
tx_types burst formats: `btus`, `offset` (ticks from the slot's start to the burst's), and the `fields` a profile
needs to receive it (its preamble word, modulation, code, length...): what controls drive per burst
assignments per (sequence, superframe count): per frame, from slot `offset` on, (assignment id, tx type or 0) in
slot order; a tx type given to a single-BTU slot takes as many BTUs as it needs (the TBTP2's rule)
Plan.windows(t0, t1) lists the bursts' places in a span of clock time; clock is ticks a second (27e6: the NCR; 1:
seconds). Where a plan comes from:
- over the air, from the tables a forward link carries:
rp.plan.builder("dvbrcs2/forward")takes their decoded messages and gives a Plan, updated as new versions and each superframe's assignments come, and the network clock (rpps.plan.air: a builder is a definition too, mapping the tables onto this model) - a definition,
config/plan/<family>/<name>.json, of the same model (a standard's fixed structure, a test, a planrp.analysis.burstlearned from detected bursts):rp.plan.load("demo/mftdma")
Hopping: a sequence's hop ({"channels": [Hz, ...], "carrier": "(k*hop + f) % 37", "params": {"hop": 7}}, or
"algorithm": "ble_csa1") moves each frame's centre to a channel, superframe by superframe; a train (bursts at a fixed
spacing for a while, then a long pause) is a superframe whose frames start where the train's bursts do: a frame's
"repeat": n and "every": ticks make n frames that far apart.
A receiver places its bursts in the plan (rpps.sync.Burst plan), and a transmitter its bursts on it
(rpps.sync.PlanTx). The plan's time is the network's: where its clock is in a capture (the origin) is the receiver's to
find (from the forward link's clock reference, or from the bursts' preambles).
{"clock": 27e6,
"tx_types": {"1": {"btus": 2, "offset": 270, "fields": {"word": "demo_uw1", "units": 1}}},
"frame_types": {"1": {"duration": 2700000, "btu": {"duration": 108000, "bw": 600e3, "symbol_rate": 500e3},
"time_units": 25, "grid": [-1e6, 0, 1e6], "sections": [[1, 36]]}},
"sequences": {"0": {"start": 0, "duration": 2700000, "centre": 0, "count": 0,
"frames": [{"type": 1, "start": 0, "offset": 0}]}}}
Modules:
| Name | Description |
|---|---|
air |
Plans from what a forward link says: a definition ( |
Classes:
| Name | Description |
|---|---|
TxType |
|
Slot |
|
FrameType |
|
Frame |
|
Sequence |
|
Hop |
Frequency hopping: each frame's centre moved to one of |
Window |
Where one burst may be: its superframe sequence and count, frame number, slot number, carrier [Hz, absolute: the |
Plan |
A burst time plan (see the module). clock: ticks a second |
Functions:
| Name | Description |
|---|---|
hop_algorithm |
Register a hopping algorithm: fn(k, f, n_channels, **params) -> channel index |
load |
A plan definition by name: |
init |
A plan from a definition object |
ls |
The plans there are, and the builders: {family: [names]} |
builder |
A new builder of plans from a forward link's tables and clock references (rpps.plan.air): |
FrameType
dataclass
¶
FrameType(id: int, duration: int, btu_duration: int, btu_bw: float, symbol_rate: float, time_units: int, grid: list, sections: list, _slots: list = None)
Methods:
| Name | Description |
|---|---|
slots |
The frame's timeslots, numbered from 0: in time on the lowest carrier, then the next (EN 301 545-2 7.5.1.4) |
slots ¶
The frame's timeslots, numbered from 0: in time on the lowest carrier, then the next (EN 301 545-2 7.5.1.4)
Source code in src/rpps/plan/__init__.py
Sequence
dataclass
¶
Sequence(id: int, start: int, duration: int, centre: float, count: int, frames: list, hop: object = None)
Hop ¶
Frequency hopping: each frame's centre moved to one of channels (Hz from the sequence's centre), the channel
an expression of the superframe's index k (superframes since the sequence's count) and the frame number f
("carrier": "(k*hop) % 37", the hop's params in scope), or a registered algorithm ("algorithm": "ble_csa1")
Source code in src/rpps/plan/__init__.py
Window
dataclass
¶
Window(sequence: int, superframe: int, frame: int, slot: int, freq: float, start: int, length: int, burst: int, symbol_rate: float, bw: float, tx_type: int, assignment: object = None)
Where one burst may be: its superframe sequence and count, frame number, slot number, carrier [Hz, absolute: the sequence's centre + frame + carrier offsets], its slot's start and length and the burst's start [ticks], symbol rate, tx type and the assignment (id, None when the plan has none)
Methods:
| Name | Description |
|---|---|
fields |
The burst's fields: where it is, and its tx type's own (what a profile's controls drive) |
fields ¶
The burst's fields: where it is, and its tx type's own (what a profile's controls drive)
Source code in src/rpps/plan/__init__.py
Plan ¶
A burst time plan (see the module). clock: ticks a second
Methods:
| Name | Description |
|---|---|
carriers |
Every carrier [Hz] a burst of the plan can be on (a hopping sequence's every channel), with its bandwidth and |
frames |
A sequence's frames in frame-number order: by lowest burst frequency, start, frame type (7.5.1.1) |
assign |
Assignments of one superframe's frame: [(assignment id, tx type or 0)] in slot order from slot |
windows |
The bursts' places that start in [t0, t1) ticks: every slot of every frame of every superframe there (the |
load |
From a definition (see the module) |
definition |
The plan as a definition (what |
Source code in src/rpps/plan/__init__.py
carriers ¶
Every carrier [Hz] a burst of the plan can be on (a hopping sequence's every channel), with its bandwidth and symbol rate: {freq: (bw, rate)}
Source code in src/rpps/plan/__init__.py
frames ¶
A sequence's frames in frame-number order: by lowest burst frequency, start, frame type (7.5.1.1)
Source code in src/rpps/plan/__init__.py
assign ¶
Assignments of one superframe's frame: [(assignment id, tx type or 0)] in slot order from slot offset
Source code in src/rpps/plan/__init__.py
windows ¶
The bursts' places that start in [t0, t1) ticks: every slot of every frame of every superframe there (the assignments, where the plan has them, merging single-BTU slots into a tx type's and naming whose slot it is). assigned: only the slots an assignment gives
Source code in src/rpps/plan/__init__.py
load
staticmethod
¶
From a definition (see the module)
Source code in src/rpps/plan/__init__.py
definition ¶
The plan as a definition (what load reads): to save one learned or built
Source code in src/rpps/plan/__init__.py
hop_algorithm ¶
Register a hopping algorithm: fn(k, f, n_channels, **params) -> channel index
load ¶
A plan definition by name: rp.plan.load("demo/mftdma") (config/plan/
Source code in src/rpps/plan/__init__.py
init ¶
ls ¶
builder ¶
A new builder of plans from a forward link's tables and clock references (rpps.plan.air):
rp.plan.builder("dvbrcs2/forward") (config/plan/builder/
Source code in src/rpps/plan/__init__.py
air ¶
Plans from what a forward link says: a definition ("base": "builder", config/plan/
b = rp.plan.builder("dvbrcs2/forward")
for m in forward.take_messages(): # the forward profile's messages: tables, clock reference packets, frame starts
b.feed(m)
b.plan # rp.plan.Plan, its assignments those of the tables seen
b.clock(t) # the network clock at sample t of the forward capture (the packets, fitted)
b.tables(plan, superframes=[...]) # transmit: [(protocol, PDU)] of a plan's tables
b.reference(ncr) # transmit: (protocol, PDU) of one clock reference
The definition:
"clock": 27e6 the plan's ticks a second
"tables": {"header": "rcs2_table", the header (config/header/link) that reads each table PDU; its messages' `kind`,
"kind": "table", the field naming the table and each table's value of it, the protocol the PDUs
"id": "table_id", go in on transmit, and the head fields on transmit (expressions over
"ids": {"sct": 160, ...},network_id and version)
"protocol": 130,
"tx": {"interactive_network_id": "network_id", ...}}
"sections": {"tx_types": {...}, "frame_types": {...}, "sequences": {...}, "assignments": {...}}
"reference": {...} the clock (below)
A section maps a table onto the plan definition's key of the same name (rpps.plan's model, as rp.plan.load reads it):
{"table": "bct", "each": "tx_types", the table, and the list in it whose items are the section's entries (none:
"if": "tx_format_class == 1", the whole table is one); only the items the expression holds for
"rx": {"id": "tx_type", "btus": "tx_block_size", "fields": {"bits": "payload_size*8"}},
"tx": {"tx_type": "id", "tx_block_size": "btus", "payload_size": "bits//8"},
"defaults": {"bits": 0}}
rx is the entry as a template: a string is an expression over the item's fields (its groups' fields too, by name: a
sized group's, a nested group's; the enclosing items' as well), a number itself, a list each of its own, and
{"each": "", "rx": template} a list of that list's items. tx_types, frame_types and sequences are
keyed by the entry's "id"; an assignments entry is {sequence, superframe, frame, offset, slots: [[id, tx type]]}, and
"count_bits" says how many of the superframe count's bits the table carries (counted on from the sequence's count).
tx is the reverse: table fields from expressions over the entry (nested keys dotted: btu.duration; a list's
element it when not an object), with {"each": "", "tx": {...}} making a list. An enum field is
set by name ("modulation_scheme.name": "constellation") and a field the header's tx computes (a loop count) is left
out. defaults fill names an entry or item lacks, both ways. On transmit a tx type's word (a sequence name) is there
as its bits ([] when it has none).
The clock reference: packets of the network clock, each the clock at a frame start (an event) lag events before the
one whose frame carries it:
"reference": {"kind": "gse", "if": "protocol == 129", "protocol": 129, "header": "rcs2_ncr",
"rx": "base*300 + ext", "tx": {"base": "(value//300) % (1 << 33)", "ext": "value % 300"},
"wrap": "(1 << 33)*300", "events": "pls", "lag": 2}
The builder pairs each packet (a message of kind the if holds for; its payload read by header, rx its value)
with the event (messages of kind events) lag before the last one at or before it, and fits clock = a + b * sample by
least squares, the wrap undone.
Classes:
| Name | Description |
|---|---|
Builder |
A plan and a clock from a forward link's messages (see the module). |
Builder ¶
A plan and a clock from a forward link's messages (see the module). plan is None until every keyed section's
table is in
Methods:
| Name | Description |
|---|---|
feed |
Take one message of the forward link's: a table, a clock reference packet or an event |
value |
The clock value of one reference packet's payload |
pairs |
(sample of the event, clock value) of each reference packet: the event |
fit |
(a, b): clock = a + b * forward sample, least squares over the pairs (the clock's wrap undone); None with |
clock |
The clock at a forward capture sample (a time the return capture shares: its first sample's clock is the plan's |
definition |
The plan definition (rpps.plan's model) of the tables in, without assignments |
tables |
[(protocol, PDU bytes)] of a plan's tables: each keyed section's, then the assignments' of each (sequence, |
reference |
(protocol, PDU bytes) of the clock reference packet of a clock value |
Source code in src/rpps/plan/air.py
feed ¶
Take one message of the forward link's: a table, a clock reference packet or an event
Source code in src/rpps/plan/air.py
value ¶
The clock value of one reference packet's payload
Source code in src/rpps/plan/air.py
pairs ¶
(sample of the event, clock value) of each reference packet: the event lag before the one carrying it
Source code in src/rpps/plan/air.py
fit ¶
(a, b): clock = a + b * forward sample, least squares over the pairs (the clock's wrap undone); None with fewer than two
Source code in src/rpps/plan/air.py
clock ¶
The clock at a forward capture sample (a time the return capture shares: its first sample's clock is the plan's origin there)
definition ¶
The plan definition (rpps.plan's model) of the tables in, without assignments
Source code in src/rpps/plan/air.py
tables ¶
[(protocol, PDU bytes)] of a plan's tables: each keyed section's, then the assignments' of each (sequence,
superframe count) in superframes that the plan has assignments for
Source code in src/rpps/plan/air.py
reference ¶
(protocol, PDU bytes) of the clock reference packet of a clock value