blob: e6a253dae21523e5f4ef3c2219d32f819a4be07b [file] [log] [blame]
Matteo Scandolo84f7d482019-08-08 19:00:47 -07001// Copyright (c) 2018 Open Networking Foundation
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at:
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16package bbsim;
17
Pragya Arya8bdb4532020-03-02 17:08:09 +053018import "voltha_protos/openolt.proto";
Anand S Katti09541352020-01-29 15:54:01 +053019import "voltha_protos/tech_profile.proto";
Matteo Scandolo10f965c2019-09-24 10:40:46 -070020// Models
21
Matteo Scandolo84f7d482019-08-08 19:00:47 -070022message PONPort {
23 int32 ID = 1;
24 string OperState = 2;
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080025 string InternalState = 3;
26 uint64 PacketCount = 4;
27 // ONU ID are reported by VOLTHA in the ActivateOnu call
28 repeated PonAllocatedResources AllocatedOnuIds = 5;
29 // these are the stored resource IDs as reported via OMCI
30 repeated PonAllocatedResources AllocatedGemPorts = 6;
31 repeated PonAllocatedResources AllocatedAllocIds = 7;
32}
33
34message PonAllocatedResources {
35 string SerialNumber = 1;
36 int32 Id = 2;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070037}
38
39message NNIPort {
40 int32 ID = 1;
41 string OperState = 2;
42}
43
44message Olt {
45 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070046 string SerialNumber = 2;
47 string OperState = 3;
48 string InternalState = 4;
rajeshf921f882020-03-06 18:24:28 +053049 string IP = 7;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070050 repeated NNIPort NNIPorts = 5;
51 repeated PONPort PONPorts = 6;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070052}
53
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080054message OltAllocatedResourceType {
55 enum Type {
56 UNKNOWN = 0;
57 ALLOC_ID = 1;
58 GEM_PORT = 2;
59 }
60 Type type = 1;
61}
62
63message OltAllocatedResource {
64 string Type = 1;
65 uint32 PonPortId = 2;
66 uint32 OnuId = 3;
67 uint32 PortNo = 4;
68 int32 ResourceId = 5;
69 uint64 FlowId = 6;
70}
71
72message OltAllocatedResources {
73 repeated OltAllocatedResource resources = 1;
74}
75
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070076message ONU {
77 int32 ID = 1;
78 string SerialNumber = 2;
79 string OperState = 3;
80 string InternalState = 4;
81 int32 PonPortID = 5;
Matteo Scandolo4b3fc7e2019-09-17 16:49:54 -070082 string HwAddress = 8;
Matteo Scandolo27428702019-10-11 16:21:16 -070083 int32 PortNo = 9;
Matteo Scandolo4a036262020-08-17 15:56:13 -070084 repeated Service services = 10;
Matteo Scandolocedde462021-03-09 17:37:16 -080085 int32 ImageSoftwareExpectedSections = 11;
86 int32 ImageSoftwareReceivedSections = 12;
87 int32 ActiveImageEntityId = 13;
88 int32 CommittedImageEntityId = 14;
Matteo Scandolo4a036262020-08-17 15:56:13 -070089}
90
91message Service {
92 string Name = 1;
93 string HwAddress = 2;
94 string OnuSn = 3;
95 int32 STag = 4;
96 int32 CTag = 5;
97 bool NeedsEapol = 6;
98 bool NeedsDhcp = 7;
99 bool NeedsIgmp = 8;
100 int32 GemPort = 9;
101 string EapolState = 10;
102 string DhcpState = 11;
Matteo Scandolo75ed5b92020-09-03 09:03:16 -0700103 string InternalState = 12;
Matteo Scandolo618a6582020-09-09 12:21:29 -0700104 string IGMPState = 13;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700105}
106
Anand S Katti09541352020-01-29 15:54:01 +0530107message ONUTrafficSchedulers {
108 tech_profile.TrafficSchedulers traffSchedulers = 1;
109}
110
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700111message ONUs {
112 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700113}
114
Matteo Scandolo4a036262020-08-17 15:56:13 -0700115message Services {
116 repeated Service items = 1;
117}
118
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700119// Inputs
120
121message ONURequest {
122 string SerialNumber = 1;
123}
124
Pragya Aryabd731ec2020-02-11 16:38:17 +0530125message PONRequest {
126 uint32 PonPortId = 1;
127}
128
Scott Baker41724b82020-01-21 19:54:53 -0800129// Alarms
130
131message AlarmType {
132 // These types correspond to the messages permitted in the oneof
133 // in AlarmIndication in the openolt protos
134 enum Types {
135 LOS = 0; // LOS is an OLT alarm for an entire PON
136 DYING_GASP = 1;
137 ONU_ALARM = 2;
138 ONU_STARTUP_FAILURE = 3;
139 ONU_SIGNAL_DEGRADE = 4;
140 ONU_DRIFT_OF_WINDOW = 5;
141 ONU_LOSS_OF_OMCI_CHANNEL = 6;
142 ONU_SIGNALS_FAILURE = 7;
143 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
144 ONU_ACTIVATION_FAILURE = 9;
145 ONU_PROCESSING_ERROR = 10;
146 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
147 ONU_ITU_PON_STATS = 12;
148
149 // These break out ONU_ALARM, which is a single message, but
150 // includes statuses for these six alarms.
151 ONU_ALARM_LOS = 13;
152 ONU_ALARM_LOB = 14;
153 ONU_ALARM_LOPC_MISS = 15;
154 ONU_ALARM_LOPC_MIC_ERROR = 16;
155 ONU_ALARM_LOFI = 17;
156 ONU_ALARM_LOAMI = 18;
157 }
158}
159
160message AlarmParameter {
161 string Key = 1;
162 string Value = 2;
163}
164
Anand S Katti86552f92020-03-03 21:56:32 +0530165// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530166// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800167// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530168message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700169 string AlarmType = 1; // name of alarm to raise
170 string SerialNumber = 2; // serial number of ONU
171 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800172 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
173}
174
Anand S Katti86552f92020-03-03 21:56:32 +0530175// OLT alarm request
176message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700177 uint32 InterfaceID = 1; // Switch Interface Id
178 string InterfaceType = 2; // PON or NNI Type
179 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530180}
181
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700182// Utils
183
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700184message VersionNumber {
185 string version = 1;
186 string buildTime = 2;
187 string commitHash = 3;
188 string gitStatus = 4;
189}
190
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700191message LogLevel {
192 string level = 1;
193 bool caller = 2;
194}
195
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700196message Response {
197 int32 status_code = 1;
198 string message = 2;
199}
200
Arjun E K57a7fcb2020-01-30 06:44:45 +0000201enum SubActionTypes {
202 JOIN = 0;
203 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000204 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000205}
206
207message IgmpRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700208 ONURequest OnuReq = 1;
209 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000210 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000211}
212
Pragya Arya8bdb4532020-03-02 17:08:09 +0530213message Flows {
214 uint32 flow_count = 1;
215 repeated openolt.Flow flows = 2;
216}
217
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800218message Timeout {
219 uint32 delay = 1;
220}
221
Matteo Scandolo4a036262020-08-17 15:56:13 -0700222message Empty {
223}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700224
225service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530226 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700227 rpc Version (Empty) returns (VersionNumber) {
228 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530229 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700230 rpc SetLogLevel (LogLevel) returns (LogLevel) {
231 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530232
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530233 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700234 rpc GetOlt (Empty) returns (Olt) {
235 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800236
237 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
238 }
239
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530240 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700241 rpc PoweronOlt (Empty) returns (Response) {
242 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530243 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700244 rpc ShutdownOlt (Empty) returns (Response) {
245 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530246 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700247 rpc RebootOlt (Empty) returns (Response) {
248 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800249 // Closes the Openolt gRPC server
250 rpc StopgRPCServer (Empty) returns (Response) {
251 }
252 // Start the Openolt gRPC server
253 rpc StartgRPCServer (Empty) returns (Response) {
254 }
255 // Restart the Openolt gRPC server after the given timeout
256 rpc RestartgRPCServer (Timeout) returns (Response) {
257 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530258
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530259 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700260 rpc GetONU (ONURequest) returns (ONU) {
261 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530262 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700263 rpc GetONUs (Empty) returns (ONUs) {
264 }
265
266 // Get all the Services
267 rpc GetServices (Empty) returns (Services) {
268 }
269
270 // Get all the Services of an ONU by serial number
271 rpc GetOnuServices (ONURequest) returns (Services) {
272 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530273
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530274 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700275 rpc ShutdownONU (ONURequest) returns (Response) {
276 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530277 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700278 rpc ShutdownAllONUs (Empty) returns (Response) {
279 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530280 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700281 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
282 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530283
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530284 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700285 rpc PoweronONU (ONURequest) returns (Response) {
286 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530287 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700288 rpc PoweronAllONUs (Empty) returns (Response) {
289 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530290 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700291 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
292 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530293
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530294 // Restart EAPOL for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700295 rpc RestartEapol (ONURequest) returns (Response) {
296 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000297 // Restart DHCP for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700298 rpc RestartDhcp (ONURequest) returns (Response) {
299 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530300 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700301 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
302 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530303 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700304 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
305 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530306 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700307 rpc GetFlows (ONURequest) returns (Flows) {
308 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000309 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700310 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
311 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530312 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700313 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
314 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000315}