blob: 086057fa21abf9139803c36458914450e77c1081 [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
Scott Baker41724b82020-01-21 19:54:53 -0800148// Alarms
149
150message AlarmType {
151 // These types correspond to the messages permitted in the oneof
152 // in AlarmIndication in the openolt protos
153 enum Types {
154 LOS = 0; // LOS is an OLT alarm for an entire PON
155 DYING_GASP = 1;
156 ONU_ALARM = 2;
157 ONU_STARTUP_FAILURE = 3;
158 ONU_SIGNAL_DEGRADE = 4;
159 ONU_DRIFT_OF_WINDOW = 5;
160 ONU_LOSS_OF_OMCI_CHANNEL = 6;
161 ONU_SIGNALS_FAILURE = 7;
162 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
163 ONU_ACTIVATION_FAILURE = 9;
164 ONU_PROCESSING_ERROR = 10;
165 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
166 ONU_ITU_PON_STATS = 12;
167
168 // These break out ONU_ALARM, which is a single message, but
169 // includes statuses for these six alarms.
170 ONU_ALARM_LOS = 13;
171 ONU_ALARM_LOB = 14;
172 ONU_ALARM_LOPC_MISS = 15;
173 ONU_ALARM_LOPC_MIC_ERROR = 16;
174 ONU_ALARM_LOFI = 17;
175 ONU_ALARM_LOAMI = 18;
176 }
177}
178
179message AlarmParameter {
180 string Key = 1;
181 string Value = 2;
182}
183
Anand S Katti86552f92020-03-03 21:56:32 +0530184// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530185// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800186// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530187message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700188 string AlarmType = 1; // name of alarm to raise
189 string SerialNumber = 2; // serial number of ONU
190 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800191 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
192}
193
Anand S Katti86552f92020-03-03 21:56:32 +0530194// OLT alarm request
195message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700196 uint32 InterfaceID = 1; // Switch Interface Id
197 string InterfaceType = 2; // PON or NNI Type
198 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530199}
200
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700201// Utils
202
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700203message VersionNumber {
204 string version = 1;
205 string buildTime = 2;
206 string commitHash = 3;
207 string gitStatus = 4;
208}
209
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700210message LogLevel {
211 string level = 1;
212 bool caller = 2;
213}
214
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700215message Response {
216 int32 status_code = 1;
217 string message = 2;
218}
219
Arjun E K57a7fcb2020-01-30 06:44:45 +0000220enum SubActionTypes {
221 JOIN = 0;
222 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000223 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000224}
225
226message IgmpRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700227 ONURequest OnuReq = 1;
228 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000229 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000230}
231
Pragya Arya8bdb4532020-03-02 17:08:09 +0530232message Flows {
233 uint32 flow_count = 1;
234 repeated openolt.Flow flows = 2;
235}
236
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800237message Timeout {
238 uint32 delay = 1;
239}
240
Matteo Scandolo4a036262020-08-17 15:56:13 -0700241message Empty {
242}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700243
244service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530245 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700246 rpc Version (Empty) returns (VersionNumber) {
247 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530248 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700249 rpc SetLogLevel (LogLevel) returns (LogLevel) {
250 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530251
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530252 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700253 rpc GetOlt (Empty) returns (Olt) {
254 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800255
256 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
257 }
258
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530259 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700260 rpc PoweronOlt (Empty) returns (Response) {
261 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530262 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700263 rpc ShutdownOlt (Empty) returns (Response) {
264 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530265 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700266 rpc RebootOlt (Empty) returns (Response) {
267 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800268 // Closes the Openolt gRPC server
269 rpc StopgRPCServer (Empty) returns (Response) {
270 }
271 // Start the Openolt gRPC server
272 rpc StartgRPCServer (Empty) returns (Response) {
273 }
274 // Restart the Openolt gRPC server after the given timeout
275 rpc RestartgRPCServer (Timeout) returns (Response) {
276 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530277
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530278 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700279 rpc GetONU (ONURequest) returns (ONU) {
280 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530281 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700282 rpc GetONUs (Empty) returns (ONUs) {
283 }
284
285 // Get all the Services
286 rpc GetServices (Empty) returns (Services) {
287 }
288
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700289 // Get all the UNIs of an ONU by serial number
290 rpc GetOnuUnis (ONURequest) returns (UNIs) {
291 }
292
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530293 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700294 rpc ShutdownONU (ONURequest) returns (Response) {
295 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530296 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700297 rpc ShutdownAllONUs (Empty) returns (Response) {
298 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530299 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700300 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
301 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530302
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530303 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700304 rpc PoweronONU (ONURequest) returns (Response) {
305 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530306 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700307 rpc PoweronAllONUs (Empty) returns (Response) {
308 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530309 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700310 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
311 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530312
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530313 // Restart EAPOL for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700314 rpc RestartEapol (ONURequest) returns (Response) {
315 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000316 // Restart DHCP for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700317 rpc RestartDhcp (ONURequest) returns (Response) {
318 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530319 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700320 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
321 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530322 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700323 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
324 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530325 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700326 rpc GetFlows (ONURequest) returns (Flows) {
327 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000328 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700329 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
330 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530331 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700332 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
333 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000334}