Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 1 | // 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 | |
| 15 | syntax = "proto3"; |
| 16 | package bbsim; |
| 17 | |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 18 | import "voltha_protos/openolt.proto"; |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 19 | import "voltha_protos/tech_profile.proto"; |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 20 | // Models |
| 21 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 22 | message PONPort { |
| 23 | int32 ID = 1; |
| 24 | string OperState = 2; |
| 25 | } |
| 26 | |
| 27 | message NNIPort { |
| 28 | int32 ID = 1; |
| 29 | string OperState = 2; |
| 30 | } |
| 31 | |
| 32 | message Olt { |
| 33 | int32 ID = 1; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 34 | string SerialNumber = 2; |
| 35 | string OperState = 3; |
| 36 | string InternalState = 4; |
rajesh | f921f88 | 2020-03-06 18:24:28 +0530 | [diff] [blame] | 37 | string IP = 7; |
Matteo Scandolo | 8df63df | 2019-09-12 10:34:32 -0700 | [diff] [blame] | 38 | repeated NNIPort NNIPorts = 5; |
| 39 | repeated PONPort PONPorts = 6; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | message ONU { |
| 43 | int32 ID = 1; |
| 44 | string SerialNumber = 2; |
| 45 | string OperState = 3; |
| 46 | string InternalState = 4; |
| 47 | int32 PonPortID = 5; |
Matteo Scandolo | 4b3fc7e | 2019-09-17 16:49:54 -0700 | [diff] [blame] | 48 | string HwAddress = 8; |
Matteo Scandolo | 2742870 | 2019-10-11 16:21:16 -0700 | [diff] [blame] | 49 | int32 PortNo = 9; |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 50 | repeated Service services = 10; |
Matteo Scandolo | cedde46 | 2021-03-09 17:37:16 -0800 | [diff] [blame^] | 51 | int32 ImageSoftwareExpectedSections = 11; |
| 52 | int32 ImageSoftwareReceivedSections = 12; |
| 53 | int32 ActiveImageEntityId = 13; |
| 54 | int32 CommittedImageEntityId = 14; |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | message Service { |
| 58 | string Name = 1; |
| 59 | string HwAddress = 2; |
| 60 | string OnuSn = 3; |
| 61 | int32 STag = 4; |
| 62 | int32 CTag = 5; |
| 63 | bool NeedsEapol = 6; |
| 64 | bool NeedsDhcp = 7; |
| 65 | bool NeedsIgmp = 8; |
| 66 | int32 GemPort = 9; |
| 67 | string EapolState = 10; |
| 68 | string DhcpState = 11; |
Matteo Scandolo | 75ed5b9 | 2020-09-03 09:03:16 -0700 | [diff] [blame] | 69 | string InternalState = 12; |
Matteo Scandolo | 618a658 | 2020-09-09 12:21:29 -0700 | [diff] [blame] | 70 | string IGMPState = 13; |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 71 | } |
| 72 | |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 73 | message ONUTrafficSchedulers { |
| 74 | tech_profile.TrafficSchedulers traffSchedulers = 1; |
| 75 | } |
| 76 | |
Matteo Scandolo | 9a3518c | 2019-08-13 14:36:01 -0700 | [diff] [blame] | 77 | message ONUs { |
| 78 | repeated ONU items = 1; |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 79 | } |
| 80 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 81 | message Services { |
| 82 | repeated Service items = 1; |
| 83 | } |
| 84 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 85 | // Inputs |
| 86 | |
| 87 | message ONURequest { |
| 88 | string SerialNumber = 1; |
| 89 | } |
| 90 | |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 91 | message PONRequest { |
| 92 | uint32 PonPortId = 1; |
| 93 | } |
| 94 | |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 95 | // Alarms |
| 96 | |
| 97 | message AlarmType { |
| 98 | // These types correspond to the messages permitted in the oneof |
| 99 | // in AlarmIndication in the openolt protos |
| 100 | enum Types { |
| 101 | LOS = 0; // LOS is an OLT alarm for an entire PON |
| 102 | DYING_GASP = 1; |
| 103 | ONU_ALARM = 2; |
| 104 | ONU_STARTUP_FAILURE = 3; |
| 105 | ONU_SIGNAL_DEGRADE = 4; |
| 106 | ONU_DRIFT_OF_WINDOW = 5; |
| 107 | ONU_LOSS_OF_OMCI_CHANNEL = 6; |
| 108 | ONU_SIGNALS_FAILURE = 7; |
| 109 | ONU_TRANSMISSION_INTERFERENCE_WARNING = 8; |
| 110 | ONU_ACTIVATION_FAILURE = 9; |
| 111 | ONU_PROCESSING_ERROR = 10; |
| 112 | ONU_LOSS_OF_KEY_SYNC_FAILURE = 11; |
| 113 | ONU_ITU_PON_STATS = 12; |
| 114 | |
| 115 | // These break out ONU_ALARM, which is a single message, but |
| 116 | // includes statuses for these six alarms. |
| 117 | ONU_ALARM_LOS = 13; |
| 118 | ONU_ALARM_LOB = 14; |
| 119 | ONU_ALARM_LOPC_MISS = 15; |
| 120 | ONU_ALARM_LOPC_MIC_ERROR = 16; |
| 121 | ONU_ALARM_LOFI = 17; |
| 122 | ONU_ALARM_LOAMI = 18; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | message AlarmParameter { |
| 127 | string Key = 1; |
| 128 | string Value = 2; |
| 129 | } |
| 130 | |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 131 | // ONUAlarmRequest includes fields common to every Onu alarm, |
Anand S Katti | 0954135 | 2020-01-29 15:54:01 +0530 | [diff] [blame] | 132 | // plus an optional list of AlarmParameter list that can be used |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 133 | // to set additional fields in alarms that support them. |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 134 | message ONUAlarmRequest { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 135 | string AlarmType = 1; // name of alarm to raise |
| 136 | string SerialNumber = 2; // serial number of ONU |
| 137 | string Status = 3; // status of Alarm |
Scott Baker | 41724b8 | 2020-01-21 19:54:53 -0800 | [diff] [blame] | 138 | repeated AlarmParameter Parameters = 4; // optional list of additional parameters |
| 139 | } |
| 140 | |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 141 | // OLT alarm request |
| 142 | message OLTAlarmRequest { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 143 | uint32 InterfaceID = 1; // Switch Interface Id |
| 144 | string InterfaceType = 2; // PON or NNI Type |
| 145 | string Status = 3; // Interface Operstatus |
Anand S Katti | 86552f9 | 2020-03-03 21:56:32 +0530 | [diff] [blame] | 146 | } |
| 147 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 148 | // Utils |
| 149 | |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 150 | message VersionNumber { |
| 151 | string version = 1; |
| 152 | string buildTime = 2; |
| 153 | string commitHash = 3; |
| 154 | string gitStatus = 4; |
| 155 | } |
| 156 | |
Matteo Scandolo | 2bf742a | 2019-10-01 11:33:34 -0700 | [diff] [blame] | 157 | message LogLevel { |
| 158 | string level = 1; |
| 159 | bool caller = 2; |
| 160 | } |
| 161 | |
Matteo Scandolo | 10f965c | 2019-09-24 10:40:46 -0700 | [diff] [blame] | 162 | message Response { |
| 163 | int32 status_code = 1; |
| 164 | string message = 2; |
| 165 | } |
| 166 | |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 167 | enum SubActionTypes { |
| 168 | JOIN = 0; |
| 169 | LEAVE = 1; |
Arjun E K | dd443f0 | 2020-02-07 15:24:01 +0000 | [diff] [blame] | 170 | JOINV3 = 2; |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 171 | } |
| 172 | |
| 173 | message IgmpRequest { |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 174 | ONURequest OnuReq = 1; |
| 175 | SubActionTypes SubActionVal = 2; |
Onur Kalinagac | 9f9faca | 2021-01-21 14:04:34 +0000 | [diff] [blame] | 176 | string GroupAddress = 3; |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 177 | } |
| 178 | |
Pragya Arya | 8bdb453 | 2020-03-02 17:08:09 +0530 | [diff] [blame] | 179 | message Flows { |
| 180 | uint32 flow_count = 1; |
| 181 | repeated openolt.Flow flows = 2; |
| 182 | } |
| 183 | |
Matteo Scandolo | 88c204a | 2020-11-03 10:34:24 -0800 | [diff] [blame] | 184 | message Timeout { |
| 185 | uint32 delay = 1; |
| 186 | } |
| 187 | |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 188 | message Empty { |
| 189 | } |
Matteo Scandolo | 84f7d48 | 2019-08-08 19:00:47 -0700 | [diff] [blame] | 190 | |
| 191 | service BBSim { |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 192 | // Get BBSim version |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 193 | rpc Version (Empty) returns (VersionNumber) { |
| 194 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 195 | // Set BBSim log level |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 196 | rpc SetLogLevel (LogLevel) returns (LogLevel) { |
| 197 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 198 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 199 | // Get current status of OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 200 | rpc GetOlt (Empty) returns (Olt) { |
| 201 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 202 | // Poweron OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 203 | rpc PoweronOlt (Empty) returns (Response) { |
| 204 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 205 | // Shutdown OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 206 | rpc ShutdownOlt (Empty) returns (Response) { |
| 207 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 208 | // Reboot OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 209 | rpc RebootOlt (Empty) returns (Response) { |
| 210 | } |
Matteo Scandolo | 88c204a | 2020-11-03 10:34:24 -0800 | [diff] [blame] | 211 | // Closes the Openolt gRPC server |
| 212 | rpc StopgRPCServer (Empty) returns (Response) { |
| 213 | } |
| 214 | // Start the Openolt gRPC server |
| 215 | rpc StartgRPCServer (Empty) returns (Response) { |
| 216 | } |
| 217 | // Restart the Openolt gRPC server after the given timeout |
| 218 | rpc RestartgRPCServer (Timeout) returns (Response) { |
| 219 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 220 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 221 | // Get status of an ONU by serial number |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 222 | rpc GetONU (ONURequest) returns (ONU) { |
| 223 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 224 | // Get status of all ONUs |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 225 | rpc GetONUs (Empty) returns (ONUs) { |
| 226 | } |
| 227 | |
| 228 | // Get all the Services |
| 229 | rpc GetServices (Empty) returns (Services) { |
| 230 | } |
| 231 | |
| 232 | // Get all the Services of an ONU by serial number |
| 233 | rpc GetOnuServices (ONURequest) returns (Services) { |
| 234 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 235 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 236 | // Shutdown an ONU by serial number |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 237 | rpc ShutdownONU (ONURequest) returns (Response) { |
| 238 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 239 | // Shutdown all ONUs in OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 240 | rpc ShutdownAllONUs (Empty) returns (Response) { |
| 241 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 242 | // Shutdown all ONUs under a PON by pon-port-ID |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 243 | rpc ShutdownONUsOnPON (PONRequest) returns (Response) { |
| 244 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 245 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 246 | // Poweron an ONU by serial number |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 247 | rpc PoweronONU (ONURequest) returns (Response) { |
| 248 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 249 | // Poweron all ONUs in OLT |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 250 | rpc PoweronAllONUs (Empty) returns (Response) { |
| 251 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 252 | // Poweron all ONUs under a PON by pon-port-ID |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 253 | rpc PoweronONUsOnPON (PONRequest) returns (Response) { |
| 254 | } |
Pragya Arya | bd731ec | 2020-02-11 16:38:17 +0530 | [diff] [blame] | 255 | |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 256 | // Restart EAPOL for ONU |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 257 | rpc RestartEapol (ONURequest) returns (Response) { |
| 258 | } |
Onur Kalinagac | 9f9faca | 2021-01-21 14:04:34 +0000 | [diff] [blame] | 259 | // Restart DHCP for ONU |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 260 | rpc RestartDhcp (ONURequest) returns (Response) { |
| 261 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 262 | // Send ONU alarm indication |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 263 | rpc SetOnuAlarmIndication (ONUAlarmRequest) returns (Response) { |
| 264 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 265 | // Send OLT alarm indication for Interface type NNI or PON |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 266 | rpc SetOltAlarmIndication (OLTAlarmRequest) returns (Response) { |
| 267 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 268 | // Get all flows or ONU specific flows |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 269 | rpc GetFlows (ONURequest) returns (Flows) { |
| 270 | } |
Onur Kalinagac | 9f9faca | 2021-01-21 14:04:34 +0000 | [diff] [blame] | 271 | // Change IGMP state |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 272 | rpc ChangeIgmpState (IgmpRequest) returns (Response) { |
| 273 | } |
Pragya Arya | 3f8fdc6 | 2020-03-16 11:12:27 +0530 | [diff] [blame] | 274 | // Get Traffic scheduler information for ONU |
Matteo Scandolo | 4a03626 | 2020-08-17 15:56:13 -0700 | [diff] [blame] | 275 | rpc GetOnuTrafficSchedulers (ONURequest) returns (ONUTrafficSchedulers) { |
| 276 | } |
Arjun E K | 57a7fcb | 2020-01-30 06:44:45 +0000 | [diff] [blame] | 277 | } |