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