You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add RSP multi-tenancy, JSON API, and NBN domain documentation for v0.2.0
- RSP resource with AshStateMachine lifecycle (inactive/active/suspended)
- Ash Policy multi-tenancy: SetRspId change, OwnedByActor and NoActor checks, RspOwnership macro shared across 5 RSP-owned resources
- NTD and UNI are NBN-owned infrastructure: readable by any RSP, mutable only by nil actor
- JSON API via AshJsonApi and Plug.Cowboy on port 4000
- RSP list action with epid sort; field_policy restricts state visibility to record owner
- Livebook moved to documentation/domains/diffo_example_nbn.livemd with Kino RSP selector and actor-scoped provisioning flow
- documentation/domains/nbn.md: Perentie ecosystem narrative and RSP spirit animals
- README updated to describe both NBN and Access domains
[](https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2Fdiffo-dev%2Fdiffo_example%2Fblob%2Fmain%2Fdiffo_example.livemd)
[Diffo](https://github.com/diffo-dev/diffo) is a Telecommunications Management Forum (TMF) Service and Resource Manager, built for autonomous networks.
18
15
16
+
This repo contains two independent example domains, each modelling a different slice of a telco network.
17
+
18
+
## NBN Domain
19
+
20
+
A declarative model of a fictional NBN Ethernet access hierarchy — NbnEthernet, UNI, AVC, NTD, CVC, NNI Group, and NNI — built entirely with the Diffo Provider Instance DSL. Includes multi-tenancy via Ash Policy: each RSP can only see and manage the resources they own.
21
+
22
+
[](https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2Fdiffo-dev%2Fdiffo_example%2Fblob%2Fdev%2Fdocumentation%2Fdomains%2Fdiffo_example_nbn.livemd)
23
+
24
+
The livebook walks through provisioning a complete NBN Ethernet access circuit, selecting an RSP to operate as, and demonstrating how the `mine` actions propagate technology, speeds, CVLAN, and port assignments up the resource hierarchy.
25
+
26
+
## Access Domain
27
+
28
+
A copper-network equivalent covering DSL access services — Cable, Card, Path, and Shelf. Explore `lib/access/` for the domain model.
19
29
20
30
## Installation
21
31
@@ -32,13 +42,6 @@ end
32
42
33
43
You need [Neo4j](https://github.com/neo4j/neo4j) available. We recommend the Neo4j Community 5 latest, available at [Neo4j Deploymnent Centre](https://neo4j.com/deployment-center/) which can be installed locally. You can also configure connection to a cloud based database service such as [Neo4j AuraDB](https://neo4j.com/product/auradb/).
34
44
35
-
## Tutorial
36
-
37
-
Click the **Run in Livebook** badge above to open the interactive tutorial, or find it at [diffo_example.livemd](diffo_example.livemd).
38
-
39
-
The diffo_example livebook walks through provisioning a complete NBN Ethernet access circuit — NTD, UNI, AVC, CVC, NNI Group, and NNI — showing how the `mine` actions propagate technology, speeds, CVLAN, and port assignments up the resource hierarchy.
40
-
41
-
42
45
## Contributions
43
46
44
47
Contributions are welcome, please start with an [issue](https://github.com/diffo-dev/diffo_example/issues)
Copy file name to clipboardExpand all lines: documentation/domains/diffo_example_nbn.livemd
+77-54Lines changed: 77 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,20 +10,24 @@ SPDX-License-Identifier: MIT
10
10
Mix.install(
11
11
[
12
12
{:diffo_example, "~> 0.2.0"},
13
+
{:kino, "~> 0.14"},
13
14
{:req, "~> 0.5"}
14
15
],
15
-
config: [
16
-
bolty: [{Bolt, [
17
-
uri:"bolt://localhost:7687",
18
-
auth: [username:"neo4j", password:"password"],
19
-
user_agent:"diffoExampleLivebook/1",
20
-
pool_size:15,
21
-
max_overflow:3,
22
-
prefix::default,
23
-
name:Bolt,
24
-
log:false,
25
-
log_hex:false
26
-
]}]
16
+
config: [
17
+
bolty: [
18
+
{Bolt,
19
+
[
20
+
uri:"bolt://localhost:7687",
21
+
auth: [username:"neo4j", password:"password"],
22
+
user_agent:"diffoExampleLivebook/1",
23
+
pool_size:15,
24
+
max_overflow:3,
25
+
prefix::default,
26
+
name:Bolt,
27
+
log:false,
28
+
log_hex:false
29
+
]}
30
+
]
27
31
],
28
32
consolidate_protocols:false
29
33
)
@@ -67,42 +71,28 @@ It is helpful to have a Neo4j browser open locally, typically at http://localhos
67
71
AshNeo4j.Neo4jHelper.delete_all()
68
72
```
69
73
70
-
## Setup Aliases
71
-
72
-
```elixir
73
-
requireAsh.Query
74
-
aliasDiffoExample.Nbn
75
-
aliasDiffoExample.Nbn.NbnEthernet
76
-
aliasDiffoExample.Nbn.Uni
77
-
aliasDiffoExample.Nbn.Avc
78
-
aliasDiffoExample.Nbn.Ntd
79
-
aliasDiffoExample.Nbn.Cvc
80
-
aliasDiffoExample.Nbn.NniGroup
81
-
aliasDiffoExample.Nbn.Nni
82
-
aliasDiffoExample.Nbn.Technology
83
-
aliasDiffoExample.Nbn.Speeds
84
-
importJason, only: [encode:2]
85
-
```
86
-
87
-
## About NBN
74
+
## About NBN Co
88
75
89
76
NBN (National Broadband Network) is Australia's wholesale fixed-line access network, operated by NBN Co. It provides standardised access products to Retail Service Providers (RSPs), who in turn deliver internet and other services to end customers.
90
77
78
+
For the purpose of this example we are going to refer to a simplified, and re-imagined NBN Co as NBN.
79
+
91
80
An RSP typically combines:
92
81
93
82
* An **NBN Ethernet** access circuit (UNI + AVC) at the customer premises — the access and aggregation layer modelled in this domain
94
83
* A **home gateway** device installed at the UNI, which provides the customer's LAN, Wi-Fi, and sometimes voice
95
84
* Transport, aggregation, and edge infrastructure connecting the NNI to the RSP's network and on to the internet
96
85
97
-
NBN Co connects the customer premises to the RSP's network via a Point of Interconnect (POI). The NNI sits at the POI, grouped into NNI Groups. AVCs carrying customer traffic are aggregated onto a CVC, which terminates at the NNI Group. The RSP purchases CVC capacity to carry the aggregate traffic of its customers at that POI.
86
+
NBN connects the customer premises to the RSP's network via a Point of Interconnect (POI). The NNI sits at the POI, grouped into NNI Groups. AVCs carrying customer traffic are aggregated onto a CVC, which terminates at the NNI Group. The RSP purchases CVC capacity to carry the aggregate traffic of its customers at that POI.
98
87
99
-
NBN is delivered over several access technologies — FTTP, FTTN, FTTB, FTTC, HFC, Fixed Wireless, and Satellite — which determine which bandwidth profiles and speeds are available to a given premises.
88
+
NBN delivers over several access technologies — FTTP, FTTN, FTTB, FTTC, HFC, Fixed Wireless, and Satellite — which determine which bandwidth profiles and speeds are available to a given premises.
100
89
101
-
## Technology and Speeds
90
+
## NBN Ethernet Technology and Speeds
102
91
103
92
The NBN domain defines Technology as an Ash Enum covering all NBN access types:
Each RSP operates in isolation — they can only see and manage the resources they own. This multi-tenancy is enforced at the Ash policy layer: every NBN resource is stamped with the owning RSP's id at creation, and subsequent reads, updates, and destroys are scoped to the record owner.
121
+
122
+
Select the RSP you want to operate as for the rest of this livebook. All resources you build will be owned by that RSP and isolated from resources owned by others.
actor =Enum.find(rsps, fn rsp -> rsp.name ==Kino.Input.read(rsp_input) end)
142
+
actor
143
+
```
144
+
145
+
## Maintaining Shareable Resources
146
+
147
+
As an RSP we need maintain some shareable network resources: NNI, NNI Group, and CVC.
129
148
130
-
Before we can provision an NBN Ethernet access we need the shared network resources: NNI, NNI Group, and CVC.
149
+
We'll need these everywhere we operate, in advance of and sufficient for all the NBN Ethernet Accesses we have. We'll just build one of each right now.
131
150
132
-
Build an NNI — the physical interconnect between the RSP and NBN Co:
151
+
Build an NNI — the physical interconnect between the RSP and NBN:
133
152
134
153
```elixir
135
-
nni =Nbn.build_nni!(%{})
154
+
aliasDiffoExample.Nbn.{Nni, NniGroup, CVC}
155
+
nni =Nbn.build_nni!(%{}, actor: actor)
136
156
nni |>Jason.encode!(pretty:true) |>IO.puts
137
157
```
138
158
139
159
Build an NNI Group — a logical grouping of NNIs at a point of interconnect:
For each customer site we want to provide service to, we need an NBN Ethernet composite resource, involving an NTD, UNI, AVC and CVC.
169
191
170
-
With the hinterland in place we can provision a customer-facing NBN Ethernet access.
192
+
The NTD is NBN infrastructure — built and managed by NBN, visible to any RSP. It may not exist at a new or existing customer site, so may be built on demand by NBN.
171
193
172
194
Build an NTD — the device installed at the customer premises:
NBN Co operates as **Perentie** — Australia's largest monitor lizard, ancient and continent-wide. Perentie owns the territory. It does not compete with the animals moving through its country; it simply defines the ground they all walk on.
12
+
13
+
The RSPs are the spirit animals of the ecosystem, each finding their niche in Perentie's range:
0 commit comments