blob: 8f0ce270c31b8519b878f3614d72c33fd03a4297 [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;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070056}
57
Matteo Scandolo4b077aa2021-02-16 17:33:37 -080058message OltAllocatedResourceType {
59 enum Type {
60 UNKNOWN = 0;
61 ALLOC_ID = 1;
62 GEM_PORT = 2;
63 }
64 Type type = 1;
65}
66
67message OltAllocatedResource {
68 string Type = 1;
69 uint32 PonPortId = 2;
70 uint32 OnuId = 3;
71 uint32 PortNo = 4;
72 int32 ResourceId = 5;
73 uint64 FlowId = 6;
74}
75
76message OltAllocatedResources {
77 repeated OltAllocatedResource resources = 1;
78}
79
Matteo Scandolo9a3518c2019-08-13 14:36:01 -070080message ONU {
81 int32 ID = 1;
82 string SerialNumber = 2;
83 string OperState = 3;
84 string InternalState = 4;
85 int32 PonPortID = 5;
Matteo Scandolo8a574812021-05-20 15:18:53 -070086 string HwAddress = 8 [deprecated = true];
87 int32 PortNo = 9 [deprecated = true];
88 repeated Service services = 10 [deprecated = true];
Matteo Scandolocedde462021-03-09 17:37:16 -080089 int32 ImageSoftwareExpectedSections = 11;
90 int32 ImageSoftwareReceivedSections = 12;
91 int32 ActiveImageEntityId = 13;
92 int32 CommittedImageEntityId = 14;
Matteo Scandoloef4e8f82021-05-17 11:20:49 -070093 repeated UNI unis = 15;
94}
95
Elia Battistonac63b112022-01-12 18:40:49 +010096enum UniType{
97 ETH = 0;
98 POTS = 1;
99}
100
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700101message UNI {
102 int32 ID = 1;
103 int32 OnuID = 2;
104 string OnuSn = 3;
105 uint32 MeID = 4;
106 string OperState = 5;
Matteo Scandolo8a574812021-05-20 15:18:53 -0700107 int32 PortNo = 6;
108 repeated Service services = 7;
Elia Battistonac63b112022-01-12 18:40:49 +0100109 UniType Type = 8;
Matteo Scandolo4a036262020-08-17 15:56:13 -0700110}
111
112message Service {
113 string Name = 1;
114 string HwAddress = 2;
115 string OnuSn = 3;
116 int32 STag = 4;
117 int32 CTag = 5;
118 bool NeedsEapol = 6;
119 bool NeedsDhcp = 7;
120 bool NeedsIgmp = 8;
121 int32 GemPort = 9;
122 string EapolState = 10;
123 string DhcpState = 11;
Matteo Scandolo75ed5b92020-09-03 09:03:16 -0700124 string InternalState = 12;
Matteo Scandolo618a6582020-09-09 12:21:29 -0700125 string IGMPState = 13;
Matteo Scandolo8a574812021-05-20 15:18:53 -0700126 uint32 UniId = 14;
Elia Battiston9a1da622022-02-09 14:43:52 +0100127 int32 UniTagMatch = 15;
128 uint32 UsCTagPriority = 16; //Upstream
129 uint32 UsSTagPriority = 17; //Upstream
130 uint32 DsCTagPriority = 18; //Downstream
131 uint32 DsSTagPriority = 19; //Downstream
132 bool NeedsPPPoE = 20;
133 bool ConfigureMacAddress = 21;
134 bool EnableMacLearning = 22;
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700135}
136
Anand S Katti09541352020-01-29 15:54:01 +0530137message ONUTrafficSchedulers {
138 tech_profile.TrafficSchedulers traffSchedulers = 1;
139}
140
Matteo Scandolo9a3518c2019-08-13 14:36:01 -0700141message ONUs {
142 repeated ONU items = 1;
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700143}
144
Matteo Scandolo4a036262020-08-17 15:56:13 -0700145message Services {
146 repeated Service items = 1;
147}
148
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700149message UNIs {
150 repeated UNI items = 1;
151}
152
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700153// Inputs
154
155message ONURequest {
156 string SerialNumber = 1;
157}
158
Pragya Aryabd731ec2020-02-11 16:38:17 +0530159message PONRequest {
160 uint32 PonPortId = 1;
161}
162
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700163message UNIRequest {
164 string OnuSerialNumber = 1;
165 string UniID = 2;
166}
167
Scott Baker41724b82020-01-21 19:54:53 -0800168// Alarms
169
170message AlarmType {
171 // These types correspond to the messages permitted in the oneof
172 // in AlarmIndication in the openolt protos
173 enum Types {
174 LOS = 0; // LOS is an OLT alarm for an entire PON
175 DYING_GASP = 1;
176 ONU_ALARM = 2;
177 ONU_STARTUP_FAILURE = 3;
178 ONU_SIGNAL_DEGRADE = 4;
179 ONU_DRIFT_OF_WINDOW = 5;
180 ONU_LOSS_OF_OMCI_CHANNEL = 6;
181 ONU_SIGNALS_FAILURE = 7;
182 ONU_TRANSMISSION_INTERFERENCE_WARNING = 8;
183 ONU_ACTIVATION_FAILURE = 9;
184 ONU_PROCESSING_ERROR = 10;
185 ONU_LOSS_OF_KEY_SYNC_FAILURE = 11;
186 ONU_ITU_PON_STATS = 12;
187
188 // These break out ONU_ALARM, which is a single message, but
189 // includes statuses for these six alarms.
190 ONU_ALARM_LOS = 13;
191 ONU_ALARM_LOB = 14;
192 ONU_ALARM_LOPC_MISS = 15;
193 ONU_ALARM_LOPC_MIC_ERROR = 16;
194 ONU_ALARM_LOFI = 17;
195 ONU_ALARM_LOAMI = 18;
196 }
197}
198
199message AlarmParameter {
200 string Key = 1;
201 string Value = 2;
202}
203
Anand S Katti86552f92020-03-03 21:56:32 +0530204// ONUAlarmRequest includes fields common to every Onu alarm,
Anand S Katti09541352020-01-29 15:54:01 +0530205// plus an optional list of AlarmParameter list that can be used
Scott Baker41724b82020-01-21 19:54:53 -0800206// to set additional fields in alarms that support them.
Anand S Katti86552f92020-03-03 21:56:32 +0530207message ONUAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700208 string AlarmType = 1; // name of alarm to raise
209 string SerialNumber = 2; // serial number of ONU
210 string Status = 3; // status of Alarm
Scott Baker41724b82020-01-21 19:54:53 -0800211 repeated AlarmParameter Parameters = 4; // optional list of additional parameters
212}
213
Anand S Katti86552f92020-03-03 21:56:32 +0530214// OLT alarm request
215message OLTAlarmRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700216 uint32 InterfaceID = 1; // Switch Interface Id
217 string InterfaceType = 2; // PON or NNI Type
218 string Status = 3; // Interface Operstatus
Anand S Katti86552f92020-03-03 21:56:32 +0530219}
220
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700221// Utils
222
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700223message VersionNumber {
224 string version = 1;
225 string buildTime = 2;
226 string commitHash = 3;
227 string gitStatus = 4;
228}
229
Matteo Scandolo2bf742a2019-10-01 11:33:34 -0700230message LogLevel {
231 string level = 1;
232 bool caller = 2;
233}
234
Matteo Scandolo10f965c2019-09-24 10:40:46 -0700235message Response {
236 int32 status_code = 1;
237 string message = 2;
238}
239
Arjun E K57a7fcb2020-01-30 06:44:45 +0000240enum SubActionTypes {
241 JOIN = 0;
242 LEAVE = 1;
Arjun E Kdd443f02020-02-07 15:24:01 +0000243 JOINV3 = 2;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000244}
245
246message IgmpRequest {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700247 ONURequest OnuReq = 1;
248 SubActionTypes SubActionVal = 2;
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000249 string GroupAddress = 3;
Arjun E K57a7fcb2020-01-30 06:44:45 +0000250}
251
Pragya Arya8bdb4532020-03-02 17:08:09 +0530252message Flows {
253 uint32 flow_count = 1;
254 repeated openolt.Flow flows = 2;
255}
256
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800257message Timeout {
258 uint32 delay = 1;
259}
260
Matteo Scandolo4a036262020-08-17 15:56:13 -0700261message Empty {
262}
Matteo Scandolo84f7d482019-08-08 19:00:47 -0700263
264service BBSim {
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530265 // Get BBSim version
Matteo Scandolo4a036262020-08-17 15:56:13 -0700266 rpc Version (Empty) returns (VersionNumber) {
267 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530268 // Set BBSim log level
Matteo Scandolo4a036262020-08-17 15:56:13 -0700269 rpc SetLogLevel (LogLevel) returns (LogLevel) {
270 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530271
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530272 // Get current status of OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700273 rpc GetOlt (Empty) returns (Olt) {
274 }
Matteo Scandolo4b077aa2021-02-16 17:33:37 -0800275
276 rpc GetOltAllocatedResources (OltAllocatedResourceType) returns (OltAllocatedResources) {
277 }
278
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530279 // Poweron OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700280 rpc PoweronOlt (Empty) returns (Response) {
281 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530282 // Shutdown OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700283 rpc ShutdownOlt (Empty) returns (Response) {
284 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530285 // Reboot OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700286 rpc RebootOlt (Empty) returns (Response) {
287 }
Matteo Scandolo88c204a2020-11-03 10:34:24 -0800288 // Closes the Openolt gRPC server
289 rpc StopgRPCServer (Empty) returns (Response) {
290 }
291 // Start the Openolt gRPC server
292 rpc StartgRPCServer (Empty) returns (Response) {
293 }
294 // Restart the Openolt gRPC server after the given timeout
295 rpc RestartgRPCServer (Timeout) returns (Response) {
296 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530297
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530298 // Get status of an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700299 rpc GetONU (ONURequest) returns (ONU) {
300 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530301 // Get status of all ONUs
Matteo Scandolo4a036262020-08-17 15:56:13 -0700302 rpc GetONUs (Empty) returns (ONUs) {
303 }
304
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700305 // Get all the Services by Uni ID
306 rpc GetServices (UNIRequest) returns (Services) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700307 }
308
Matteo Scandoloef4e8f82021-05-17 11:20:49 -0700309 // Get all the UNIs of an ONU by serial number
310 rpc GetOnuUnis (ONURequest) returns (UNIs) {
311 }
312
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530313 // Shutdown an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700314 rpc ShutdownONU (ONURequest) returns (Response) {
315 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530316 // Shutdown all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700317 rpc ShutdownAllONUs (Empty) returns (Response) {
318 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530319 // Shutdown all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700320 rpc ShutdownONUsOnPON (PONRequest) returns (Response) {
321 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530322
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530323 // Poweron an ONU by serial number
Matteo Scandolo4a036262020-08-17 15:56:13 -0700324 rpc PoweronONU (ONURequest) returns (Response) {
325 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530326 // Poweron all ONUs in OLT
Matteo Scandolo4a036262020-08-17 15:56:13 -0700327 rpc PoweronAllONUs (Empty) returns (Response) {
328 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530329 // Poweron all ONUs under a PON by pon-port-ID
Matteo Scandolo4a036262020-08-17 15:56:13 -0700330 rpc PoweronONUsOnPON (PONRequest) returns (Response) {
331 }
Pragya Aryabd731ec2020-02-11 16:38:17 +0530332
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530333 // Restart EAPOL for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700334 rpc RestartEapol (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700335 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000336 // Restart DHCP for ONU
Nitin Subramanian150f1bb2021-08-02 12:04:05 -0700337 rpc RestartDhcp (UNIRequest) returns (Response) {
Matteo Scandolo4a036262020-08-17 15:56:13 -0700338 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530339 // Send ONU alarm indication
Matteo Scandolo4a036262020-08-17 15:56:13 -0700340 rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) {
341 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530342 // Send OLT alarm indication for Interface type NNI or PON
Matteo Scandolo4a036262020-08-17 15:56:13 -0700343 rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) {
344 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530345 // Get all flows or ONU specific flows
Matteo Scandolo4a036262020-08-17 15:56:13 -0700346 rpc GetFlows (ONURequest) returns (Flows) {
347 }
Onur Kalinagac9f9faca2021-01-21 14:04:34 +0000348 // Change IGMP state
Matteo Scandolo4a036262020-08-17 15:56:13 -0700349 rpc ChangeIgmpState (IgmpRequest) returns (Response) {
350 }
Pragya Arya3f8fdc62020-03-16 11:12:27 +0530351 // Get Traffic scheduler information for ONU
Matteo Scandolo4a036262020-08-17 15:56:13 -0700352 rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) {
353 }
Nitin Subramanianb0a333a2021-07-08 15:01:41 -0700354 //Return all the UNIs for all the ONUs
355 rpc GetUnis (Empty) returns (UNIs) {
356 }
Elia Battistonfe017662022-01-05 11:43:16 +0100357
358 //Invalidate the MDS counter for the ONU
359 rpc InvalidateMds (ONURequest) returns (Response) {
360 }
Arjun E K57a7fcb2020-01-30 06:44:45 +0000361}