blob: c84cd770a76b689717418d6e22b713b8c213e0ab [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;
35}
36
37message PonAllocatedResources {
38 string SerialNumber = 1;
39 int32 Id = 2;
Matteo Scandolo84f7d482019-08-08 19:00:47 -070040}
41
42message NNIPort {
43 int32 ID = 1;
44 string OperState = 2;
45}
46
47message Olt {
48 int32 ID = 1;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070049 string SerialNumber = 2;
50 string OperState = 3;
51 string InternalState = 4;
rajeshf921f882020-03-06 18:24:28 +053052 string IP = 7;
Matteo Scandolo8df63df2019-09-12 10:34:32 -070053 repeated NNIPort NNIPorts = 5;
54 repeated PONPort PONPorts = 6;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070055}
56
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080057message OltAllocatedResourceType {
58 enum Type {
59 UNKNOWN = 0;
60 ALLOC_ID = 1;
61 GEM_PORT = 2;
62 }
63 Type type = 1;
64}
65
66message OltAllocatedResource {
67 string Type = 1;
68 uint32 PonPortId = 2;
69 uint32 OnuId = 3;
70 uint32 PortNo = 4;
71 int32 ResourceId = 5;
72 uint64 FlowId = 6;
73}
74
75message OltAllocatedResources {
76 repeated OltAllocatedResource resources = 1;
77}
78
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070079message ONU {
80 int32 ID = 1;
81 string SerialNumber = 2;
82 string OperState = 3;
83 string InternalState = 4;
84 int32 PonPortID = 5;
Matteo Scandolo8a574812021-05-20 15:18:53 -070085 string HwAddress = 8 [deprecated = true];
86 int32 PortNo = 9 [deprecated = true];
87 repeated Service services = 10 [deprecated = true];
Matteo Scandolocedde462021-03-09 17:37:16 -080088 int32 ImageSoftwareExpectedSections = 11;
89 int32 ImageSoftwareReceivedSections = 12;
90 int32 ActiveImageEntityId = 13;
91 int32 CommittedImageEntityId = 14;
Matteo Scandoloef4e8f82021-05-17 11:20:49 -070092 repeated UNI unis = 15;
93}
94
95message UNI {
96 int32 ID = 1;
97 int32 OnuID = 2;
98 string OnuSn = 3;
99 uint32 MeID = 4;
100 string OperState = 5;
Matteo Scandolo8a574812021-05-20 15:18:53 -0700101 int32 PortNo = 6;
102 repeated Service services = 7;
Matteo Scandolo4a036262020-08-17 15:56:13 -0700103}
104
105message Service {
106 string Name = 1;
107 string HwAddress = 2;
108 string OnuSn = 3;
109 int32 STag = 4;
110 int32 CTag = 5;
111 bool NeedsEapol = 6;
112 bool NeedsDhcp = 7;
113 bool NeedsIgmp = 8;
114 int32 GemPort = 9;
115 string EapolState = 10;
116 string DhcpState = 11;
Matteo Scandolo75ed5b92020-09-03 09:03:16 -0700117 string InternalState = 12;
Matteo Scandolo618a6582020-09-09 12:21:29 -0700118 string IGMPState = 13;
Matteo Scandolo8a574812021-05-20 15:18:53 -0700119 uint32 UniId = 14;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700120}
121
Anand S Katti09541352020-01-29 15:54:01 +0530122message ONUTrafficSchedulers {
123 tech_profile.TrafficSchedulers traffSchedulers = 1;
124}
125
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700126message ONUs {
127 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700128}
129
Matteo Scandolo4a036262020-08-17 15:56:13 -0700130message Services {
131 repeated Service items = 1;
132}
133
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700134message UNIs {
135 repeated UNI items = 1;
136}
137
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700138// Inputs
139
140message ONURequest {
141 string SerialNumber = 1;
142}
143
Pragya Aryabd731ec2020-02-11 16:38:17 +0530144message PONRequest {
145 uint32 PonPortId = 1;
146}
147
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700148message UNIRequest {
149 string OnuSerialNumber = 1;
150 string UniID = 2;
151}
152
Scott Baker41724b82020-01-21 19:54:53 -0800153// Alarms
154
155message AlarmType {
156 // These types correspond to the messages permitted in the oneof
157 // in AlarmIndication in the openolt protos
158 enum Types {
159 LOS = 0; // LOS is an OLT alarm for an entire PON
160 DYING_GASP = 1;
161 ONU_ALARM = 2;
162 ONU_STARTUP_FAILURE = 3;
163 ONU_SIGNAL_DEGRADE = 4;
164 ONU_DRIFT_OF_WINDOW = 5;
165 ONU_LOSS_OF_OMCI_CHANNEL = 6;
166 ONU_SIGNALS_FAILURE = 7;
167 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
168 ONU_ACTIVATION_FAILURE = 9;
169 ONU_PROCESSING_ERROR = 10;
170 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
171 ONU_ITU_PON_STATS = 12;
172
173 // These break out ONU_ALARM, which is a single message, but
174 // includes statuses for these six alarms.
175 ONU_ALARM_LOS = 13;
176 ONU_ALARM_LOB = 14;
177 ONU_ALARM_LOPC_MISS = 15;
178 ONU_ALARM_LOPC_MIC_ERROR = 16;
179 ONU_ALARM_LOFI = 17;
180 ONU_ALARM_LOAMI = 18;
181 }
182}
183
184message AlarmParameter {
185 string Key = 1;
186 string Value = 2;
187}
188
Anand S Katti86552f92020-03-03 21:56:32 +0530189// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530190// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800191// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530192message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700193 string AlarmType = 1; // name of alarm to raise
194 string SerialNumber = 2; // serial number of ONU
195 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800196 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
197}
198
Anand S Katti86552f92020-03-03 21:56:32 +0530199// OLT alarm request
200message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700201 uint32 InterfaceID = 1; // Switch Interface Id
202 string InterfaceType = 2; // PON or NNI Type
203 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530204}
205
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700206// Utils
207
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700208message VersionNumber {
209 string version = 1;
210 string buildTime = 2;
211 string commitHash = 3;
212 string gitStatus = 4;
213}
214
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700215message LogLevel {
216 string level = 1;
217 bool caller = 2;
218}
219
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700220message Response {
221 int32 status_code = 1;
222 string message = 2;
223}
224
Arjun E K57a7fcb2020-01-30 06:44:45 +0000225enum SubActionTypes {
226 JOIN = 0;
227 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000228 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000229}
230
231message IgmpRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700232 ONURequest OnuReq = 1;
233 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000234 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000235}
236
Pragya Arya8bdb4532020-03-02 17:08:09 +0530237message Flows {
238 uint32 flow_count = 1;
239 repeated openolt.Flow flows = 2;
240}
241
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800242message Timeout {
243 uint32 delay = 1;
244}
245
Matteo Scandolo4a036262020-08-17 15:56:13 -0700246message Empty {
247}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700248
249service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530250 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700251 rpc Version (Empty) returns (VersionNumber) {
252 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530253 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700254 rpc SetLogLevel (LogLevel) returns (LogLevel) {
255 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530256
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530257 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700258 rpc GetOlt (Empty) returns (Olt) {
259 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800260
261 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
262 }
263
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530264 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700265 rpc PoweronOlt (Empty) returns (Response) {
266 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530267 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700268 rpc ShutdownOlt (Empty) returns (Response) {
269 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530270 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700271 rpc RebootOlt (Empty) returns (Response) {
272 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800273 // Closes the Openolt gRPC server
274 rpc StopgRPCServer (Empty) returns (Response) {
275 }
276 // Start the Openolt gRPC server
277 rpc StartgRPCServer (Empty) returns (Response) {
278 }
279 // Restart the Openolt gRPC server after the given timeout
280 rpc RestartgRPCServer (Timeout) returns (Response) {
281 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530282
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530283 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700284 rpc GetONU (ONURequest) returns (ONU) {
285 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530286 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700287 rpc GetONUs (Empty) returns (ONUs) {
288 }
289
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700290 // Get all the Services by Uni ID
291 rpc GetServices (UNIRequest) returns (Services) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700292 }
293
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700294 // Get all the UNIs of an ONU by serial number
295 rpc GetOnuUnis (ONURequest) returns (UNIs) {
296 }
297
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530298 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700299 rpc ShutdownONU (ONURequest) returns (Response) {
300 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530301 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700302 rpc ShutdownAllONUs (Empty) returns (Response) {
303 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530304 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700305 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
306 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530307
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530308 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700309 rpc PoweronONU (ONURequest) returns (Response) {
310 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530311 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700312 rpc PoweronAllONUs (Empty) returns (Response) {
313 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530314 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700315 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
316 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530317
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530318 // Restart EAPOL for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700319 rpc RestartEapol (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700320 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000321 // Restart DHCP for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700322 rpc RestartDhcp (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700323 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530324 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700325 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
326 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530327 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700328 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
329 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530330 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700331 rpc GetFlows (ONURequest) returns (Flows) {
332 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000333 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700334 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
335 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530336 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700337 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
338 }
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700339 //Return all the UNIs for all the ONUs
340 rpc GetUnis (Empty) returns (UNIs) {
341 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000342}