blob: deaab3ea016026aa07879710c3f7ac48daea71c6 [file] [log] [blame]
Joey Armstrong2c039362024-02-04 18:51:52 -05001// Copyright 2018-2024 Open Networking Foundation (ONF) and the ONF Contributors
Matteo Scandolo84f7d482019-08-08 19:00:47 -07002//
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";
amit.ghoshee17c002021-06-10 12:14:38 +020016
17option go_package = "github.com/opencord/bbsim/api/bbsim";
18
Matteo Scandolo84f7d482019-08-08 19:00:47 -070019package bbsim;
20
Pragya Arya8bdb4532020-03-02 17:08:09 +053021import "voltha_protos/openolt.proto";
Anand S Katti09541352020-01-29 15:54:01 +053022import "voltha_protos/tech_profile.proto";
Matteo Scandolo10f965c2019-09-24 10:40:46 -070023// Models
24
Matteo Scandolo84f7d482019-08-08 19:00:47 -070025message PONPort {
26 int32 ID = 1;
27 string OperState = 2;
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080028 string InternalState = 3;
29 uint64 PacketCount = 4;
30 // ONU ID are reported by VOLTHA in the ActivateOnu call
31 repeated PonAllocatedResources AllocatedOnuIds = 5;
32 // these are the stored resource IDs as reported via OMCI
33 repeated PonAllocatedResources AllocatedGemPorts = 6;
34 repeated PonAllocatedResources AllocatedAllocIds = 7;
Elia Battistonb7bea222022-02-18 16:25:00 +010035 string Technology = 8;
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080036}
37
38message PonAllocatedResources {
39 string SerialNumber = 1;
40 int32 Id = 2;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070041}
42
43message NNIPort {
44 int32 ID = 1;
45 string OperState = 2;
46}
47
48message Olt {
49 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070050 string SerialNumber = 2;
51 string OperState = 3;
52 string InternalState = 4;
rajeshf921f882020-03-06 18:24:28 +053053 string IP = 7;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070054 repeated NNIPort NNIPorts = 5;
55 repeated PONPort PONPorts = 6;
Andrea Campanella6f5f3552022-03-10 17:14:25 +010056 int32 NniDhcpTrapVid = 8;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070057}
58
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080059message OltAllocatedResourceType {
60 enum Type {
61 UNKNOWN = 0;
62 ALLOC_ID = 1;
63 GEM_PORT = 2;
64 }
65 Type type = 1;
66}
67
68message OltAllocatedResource {
69 string Type = 1;
70 uint32 PonPortId = 2;
71 uint32 OnuId = 3;
72 uint32 PortNo = 4;
73 int32 ResourceId = 5;
74 uint64 FlowId = 6;
75}
76
77message OltAllocatedResources {
78 repeated OltAllocatedResource resources = 1;
79}
80
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070081message ONU {
82 int32 ID = 1;
83 string SerialNumber = 2;
84 string OperState = 3;
85 string InternalState = 4;
86 int32 PonPortID = 5;
Matteo Scandolo8a574812021-05-20 15:18:53 -070087 string HwAddress = 8 [deprecated = true];
88 int32 PortNo = 9 [deprecated = true];
89 repeated Service services = 10 [deprecated = true];
Matteo Scandolocedde462021-03-09 17:37:16 -080090 int32 ImageSoftwareExpectedSections = 11;
91 int32 ImageSoftwareReceivedSections = 12;
92 int32 ActiveImageEntityId = 13;
93 int32 CommittedImageEntityId = 14;
Matteo Scandoloef4e8f82021-05-17 11:20:49 -070094 repeated UNI unis = 15;
95}
96
Elia Battistonac63b112022-01-12 18:40:49 +010097enum UniType{
98 ETH = 0;
99 POTS = 1;
100}
101
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700102message UNI {
103 int32 ID = 1;
104 int32 OnuID = 2;
105 string OnuSn = 3;
106 uint32 MeID = 4;
107 string OperState = 5;
Matteo Scandolo8a574812021-05-20 15:18:53 -0700108 int32 PortNo = 6;
109 repeated Service services = 7;
Elia Battistonac63b112022-01-12 18:40:49 +0100110 UniType Type = 8;
Matteo Scandolo4a036262020-08-17 15:56:13 -0700111}
112
113message Service {
114 string Name = 1;
115 string HwAddress = 2;
116 string OnuSn = 3;
117 int32 STag = 4;
118 int32 CTag = 5;
119 bool NeedsEapol = 6;
120 bool NeedsDhcp = 7;
121 bool NeedsIgmp = 8;
122 int32 GemPort = 9;
123 string EapolState = 10;
124 string DhcpState = 11;
Matteo Scandolo75ed5b92020-09-03 09:03:16 -0700125 string InternalState = 12;
Matteo Scandolo618a6582020-09-09 12:21:29 -0700126 string IGMPState = 13;
Matteo Scandolo8a574812021-05-20 15:18:53 -0700127 uint32 UniId = 14;
Elia Battiston9a1da622022-02-09 14:43:52 +0100128 int32 UniTagMatch = 15;
129 uint32 UsCTagPriority = 16; //Upstream
130 uint32 UsSTagPriority = 17; //Upstream
131 uint32 DsCTagPriority = 18; //Downstream
132 uint32 DsSTagPriority = 19; //Downstream
133 bool NeedsPPPoE = 20;
134 bool ConfigureMacAddress = 21;
135 bool EnableMacLearning = 22;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700136}
137
Anand S Katti09541352020-01-29 15:54:01 +0530138message ONUTrafficSchedulers {
139 tech_profile.TrafficSchedulers traffSchedulers = 1;
140}
141
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700142message ONUs {
143 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700144}
145
Matteo Scandolo4a036262020-08-17 15:56:13 -0700146message Services {
147 repeated Service items = 1;
148}
149
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700150message UNIs {
151 repeated UNI items = 1;
152}
153
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700154// Inputs
155
156message ONURequest {
157 string SerialNumber = 1;
158}
159
Pragya Aryabd731ec2020-02-11 16:38:17 +0530160message PONRequest {
161 uint32 PonPortId = 1;
162}
163
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700164message UNIRequest {
165 string OnuSerialNumber = 1;
166 string UniID = 2;
167}
168
Scott Baker41724b82020-01-21 19:54:53 -0800169// Alarms
170
171message AlarmType {
172 // These types correspond to the messages permitted in the oneof
173 // in AlarmIndication in the openolt protos
174 enum Types {
175 LOS = 0; // LOS is an OLT alarm for an entire PON
176 DYING_GASP = 1;
177 ONU_ALARM = 2;
178 ONU_STARTUP_FAILURE = 3;
179 ONU_SIGNAL_DEGRADE = 4;
180 ONU_DRIFT_OF_WINDOW = 5;
181 ONU_LOSS_OF_OMCI_CHANNEL = 6;
182 ONU_SIGNALS_FAILURE = 7;
183 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
184 ONU_ACTIVATION_FAILURE = 9;
185 ONU_PROCESSING_ERROR = 10;
186 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
187 ONU_ITU_PON_STATS = 12;
188
189 // These break out ONU_ALARM, which is a single message, but
190 // includes statuses for these six alarms.
191 ONU_ALARM_LOS = 13;
192 ONU_ALARM_LOB = 14;
193 ONU_ALARM_LOPC_MISS = 15;
194 ONU_ALARM_LOPC_MIC_ERROR = 16;
195 ONU_ALARM_LOFI = 17;
196 ONU_ALARM_LOAMI = 18;
197 }
198}
199
200message AlarmParameter {
201 string Key = 1;
202 string Value = 2;
203}
204
Anand S Katti86552f92020-03-03 21:56:32 +0530205// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530206// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800207// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530208message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700209 string AlarmType = 1; // name of alarm to raise
210 string SerialNumber = 2; // serial number of ONU
211 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800212 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
213}
214
Anand S Katti86552f92020-03-03 21:56:32 +0530215// OLT alarm request
216message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700217 uint32 InterfaceID = 1; // Switch Interface Id
218 string InterfaceType = 2; // PON or NNI Type
219 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530220}
221
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700222// Utils
223
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700224message VersionNumber {
225 string version = 1;
226 string buildTime = 2;
227 string commitHash = 3;
228 string gitStatus = 4;
229}
230
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700231message LogLevel {
232 string level = 1;
233 bool caller = 2;
234}
235
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700236message Response {
237 int32 status_code = 1;
238 string message = 2;
239}
240
Arjun E K57a7fcb2020-01-30 06:44:45 +0000241enum SubActionTypes {
242 JOIN = 0;
243 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000244 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000245}
246
247message IgmpRequest {
Baris Ertas0ce2f7c2023-04-11 11:44:24 +0300248 string OnuSerialNumber = 1;
249 int32 UniID = 2;
250 SubActionTypes SubActionVal = 3;
251 string GroupAddress = 4;
252 int32 VLAN = 5;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000253}
254
Pragya Arya8bdb4532020-03-02 17:08:09 +0530255message Flows {
256 uint32 flow_count = 1;
257 repeated openolt.Flow flows = 2;
258}
259
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800260message Timeout {
261 uint32 delay = 1;
262}
263
Matteo Scandolo4a036262020-08-17 15:56:13 -0700264message Empty {
265}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700266
267service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530268 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700269 rpc Version (Empty) returns (VersionNumber) {
270 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530271 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700272 rpc SetLogLevel (LogLevel) returns (LogLevel) {
273 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530274
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530275 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700276 rpc GetOlt (Empty) returns (Olt) {
277 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800278
279 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
280 }
281
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530282 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700283 rpc PoweronOlt (Empty) returns (Response) {
284 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530285 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700286 rpc ShutdownOlt (Empty) returns (Response) {
287 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530288 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700289 rpc RebootOlt (Empty) returns (Response) {
290 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800291 // Closes the Openolt gRPC server
292 rpc StopgRPCServer (Empty) returns (Response) {
293 }
294 // Start the Openolt gRPC server
295 rpc StartgRPCServer (Empty) returns (Response) {
296 }
297 // Restart the Openolt gRPC server after the given timeout
298 rpc RestartgRPCServer (Timeout) returns (Response) {
299 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530300
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530301 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700302 rpc GetONU (ONURequest) returns (ONU) {
303 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530304 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700305 rpc GetONUs (Empty) returns (ONUs) {
306 }
307
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700308 // Get all the Services by Uni ID
309 rpc GetServices (UNIRequest) returns (Services) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700310 }
311
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700312 // Get all the UNIs of an ONU by serial number
313 rpc GetOnuUnis (ONURequest) returns (UNIs) {
314 }
315
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530316 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700317 rpc ShutdownONU (ONURequest) returns (Response) {
318 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530319 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700320 rpc ShutdownAllONUs (Empty) returns (Response) {
321 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530322 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700323 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
324 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530325
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530326 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700327 rpc PoweronONU (ONURequest) returns (Response) {
328 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530329 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700330 rpc PoweronAllONUs (Empty) returns (Response) {
331 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530332 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700333 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
334 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530335
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530336 // Restart EAPOL for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700337 rpc RestartEapol (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700338 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000339 // Restart DHCP for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700340 rpc RestartDhcp (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700341 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530342 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700343 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
344 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530345 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700346 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
347 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530348 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700349 rpc GetFlows (ONURequest) returns (Flows) {
350 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000351 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700352 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
353 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530354 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700355 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
356 }
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700357 //Return all the UNIs for all the ONUs
358 rpc GetUnis (Empty) returns (UNIs) {
359 }
Elia Battistonfe017662022-01-05 11:43:16 +0100360
361 //Invalidate the MDS counter for the ONU
362 rpc InvalidateMds (ONURequest) returns (Response) {
363 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000364}