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
[](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)
@@ -37,25 +55,9 @@ The NBN domain models a fictional NBN Ethernet access circuit and its constituen
37
55
38
56
## Installing Neo4j and Configuring Bolty
39
57
40
-
Update the configuration below to match your Neo4j installation and evaluate.
58
+
Bolty is configured in the `Mix.install` block above — update the Neo4j credentials there if needed before evaluating.
41
59
42
-
```elixir
43
-
config = [
44
-
uri:"bolt://localhost:7687",
45
-
auth: [username:"neo4j", password:"password"],
46
-
user_agent:"diffoExampleLivebook/1",
47
-
pool_size:15,
48
-
max_overflow:3,
49
-
prefix::default,
50
-
name:Bolt,
51
-
log:false,
52
-
log_hex:false
53
-
]
54
-
```
55
-
56
-
```elixir
57
-
AshNeo4j.BoltyHelper.start(config)
58
-
```
60
+
You need [Neo4j](https://neo4j.com/deployment-center/) installed and running. Verify the connection:
59
61
60
62
```elixir
61
63
AshNeo4j.BoltyHelper.is_connected()
@@ -69,42 +71,28 @@ It is helpful to have a Neo4j browser open locally, typically at http://localhos
69
71
AshNeo4j.Neo4jHelper.delete_all()
70
72
```
71
73
72
-
## Setup Aliases
73
-
74
-
```elixir
75
-
requireAsh.Query
76
-
aliasDiffoExample.Nbn
77
-
aliasDiffoExample.Nbn.NbnEthernet
78
-
aliasDiffoExample.Nbn.Uni
79
-
aliasDiffoExample.Nbn.Avc
80
-
aliasDiffoExample.Nbn.Ntd
81
-
aliasDiffoExample.Nbn.Cvc
82
-
aliasDiffoExample.Nbn.NniGroup
83
-
aliasDiffoExample.Nbn.Nni
84
-
aliasDiffoExample.Nbn.Technology
85
-
aliasDiffoExample.Nbn.Speeds
86
-
importJason, only: [encode:2]
87
-
```
88
-
89
-
## About NBN
74
+
## About NBN Co
90
75
91
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.
92
77
78
+
For the purpose of this example we are going to refer to a simplified, and re-imagined NBN Co as NBN.
79
+
93
80
An RSP typically combines:
94
81
95
82
* An **NBN Ethernet** access circuit (UNI + AVC) at the customer premises — the access and aggregation layer modelled in this domain
96
83
* A **home gateway** device installed at the UNI, which provides the customer's LAN, Wi-Fi, and sometimes voice
97
84
* Transport, aggregation, and edge infrastructure connecting the NNI to the RSP's network and on to the internet
98
85
99
-
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.
100
87
101
-
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.
102
89
103
-
## Technology and Speeds
90
+
## NBN Ethernet Technology and Speeds
104
91
105
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.
131
148
132
-
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.
133
150
134
-
Build an NNI — the physical interconnect between the RSP and NBN Co:
151
+
Build an NNI — the physical interconnect between the RSP and NBN:
135
152
136
153
```elixir
137
-
nni =Nbn.build_nni!(%{})
154
+
aliasDiffoExample.Nbn.{Nni, NniGroup, CVC}
155
+
nni =Nbn.build_nni!(%{}, actor: actor)
138
156
nni |>Jason.encode!(pretty:true) |>IO.puts
139
157
```
140
158
141
159
Build an NNI Group — a logical grouping of NNIs at a point of interconnect:
With the hinterland in place we can provision a customer-facing NBN Ethernet access.
190
+
For each customer site we want to provide service to, we need an NBN Ethernet composite resource, involving an NTD, UNI, AVC and CVC.
191
+
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.
173
193
174
194
Build an NTD — the device installed at the customer premises:
You've provisioned a complete NBN Ethernet access — NTD, UNI, AVC, CVC, NNI Group, and NNI — and seen how the `mine` actions propagate technology, speeds, CVLAN and port assignments up the resource hierarchy automatically.
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