blob: 705b1b1c7fa5b7af84a48847accfc99269cb4114 [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";
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 {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700248 ONURequest OnuReq = 1;
249 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000250 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000251}
252
Pragya Arya8bdb4532020-03-02 17:08:09 +0530253message Flows {
254 uint32 flow_count = 1;
255 repeated openolt.Flow flows = 2;
256}
257
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800258message Timeout {
259 uint32 delay = 1;
260}
261
Matteo Scandolo4a036262020-08-17 15:56:13 -0700262message Empty {
263}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700264
265service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530266 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700267 rpc Version (Empty) returns (VersionNumber) {
268 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530269 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700270 rpc SetLogLevel (LogLevel) returns (LogLevel) {
271 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530272
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530273 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700274 rpc GetOlt (Empty) returns (Olt) {
275 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800276
277 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
278 }
279
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530280 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700281 rpc PoweronOlt (Empty) returns (Response) {
282 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530283 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700284 rpc ShutdownOlt (Empty) returns (Response) {
285 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530286 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700287 rpc RebootOlt (Empty) returns (Response) {
288 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800289 // Closes the Openolt gRPC server
290 rpc StopgRPCServer (Empty) returns (Response) {
291 }
292 // Start the Openolt gRPC server
293 rpc StartgRPCServer (Empty) returns (Response) {
294 }
295 // Restart the Openolt gRPC server after the given timeout
296 rpc RestartgRPCServer (Timeout) returns (Response) {
297 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530298
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530299 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700300 rpc GetONU (ONURequest) returns (ONU) {
301 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530302 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700303 rpc GetONUs (Empty) returns (ONUs) {
304 }
305
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700306 // Get all the Services by Uni ID
307 rpc GetServices (UNIRequest) returns (Services) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700308 }
309
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700310 // Get all the UNIs of an ONU by serial number
311 rpc GetOnuUnis (ONURequest) returns (UNIs) {
312 }
313
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530314 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700315 rpc ShutdownONU (ONURequest) returns (Response) {
316 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530317 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700318 rpc ShutdownAllONUs (Empty) returns (Response) {
319 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530320 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700321 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
322 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530323
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530324 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700325 rpc PoweronONU (ONURequest) returns (Response) {
326 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530327 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700328 rpc PoweronAllONUs (Empty) returns (Response) {
329 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530330 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700331 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
332 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530333
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530334 // Restart EAPOL for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700335 rpc RestartEapol (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700336 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000337 // Restart DHCP for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700338 rpc RestartDhcp (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700339 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530340 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700341 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
342 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530343 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700344 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
345 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530346 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700347 rpc GetFlows (ONURequest) returns (Flows) {
348 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000349 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700350 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
351 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530352 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700353 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
354 }
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700355 //Return all the UNIs for all the ONUs
356 rpc GetUnis (Empty) returns (UNIs) {
357 }
Elia Battistonfe017662022-01-05 11:43:16 +0100358
359 //Invalidate the MDS counter for the ONU
360 rpc InvalidateMds (ONURequest) returns (Response) {
361 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000362}