aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/apps/cpman
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/onos/apps/cpman')
-rw-r--r--framework/src/onos/apps/cpman/pom.xml39
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMessageType.java43
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMetricType.java34
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneLoad.java42
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneManager.java47
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneMetric.java41
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneStatsService.java59
-rw-r--r--framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/package-info.java20
8 files changed, 325 insertions, 0 deletions
diff --git a/framework/src/onos/apps/cpman/pom.xml b/framework/src/onos/apps/cpman/pom.xml
new file mode 100644
index 00000000..c01af6d8
--- /dev/null
+++ b/framework/src/onos/apps/cpman/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright 2014 Open Networking Laboratory
+ ~
+ ~ Licensed under the Apache License, Version 2.0 (the "License");
+ ~ you may not use this file except in compliance with the License.
+ ~ You may obtain a copy of the License at
+ ~
+ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing, software
+ ~ distributed under the License is distributed on an "AS IS" BASIS,
+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ ~ See the License for the specific language governing permissions and
+ ~ limitations under the License.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-apps</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>onos-app-cpman</artifactId>
+ <packaging>bundle</packaging>
+
+ <description>Control Plane Management Application</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onosproject</groupId>
+ <artifactId>onos-api</artifactId>
+ <version>1.4.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMessageType.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMessageType.java
new file mode 100644
index 00000000..82e414d9
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMessageType.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cpman;
+
+/**
+ * Abstracted Control Message Type.
+ */
+public enum ControlMessageType {
+
+ /** Mapped to PACKET-IN message of OpenFlow. */
+ INBOUND_PACKET,
+
+ /** Mapped to PACKET-OUT message of OpenFlow. */
+ OUTBOUND_PACKET,
+
+ /** Mapped to FLOW-MOD message of OpenFlow. */
+ FLOW_MOD_PACKET,
+
+ /** Mapped to FLOW-REMOVED message of OpenFlow. */
+ FLOW_REMOVED_PACKET,
+
+ /** Mapped to STATS-REQUEST message of OpenFlow. */
+ REQUEST_PACKET,
+
+ /** Mapped to STATS-REPLY message of OpenFlow. */
+ REPLY_PACKET,
+
+ /** All message types. */
+ ALL
+}
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMetricType.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMetricType.java
new file mode 100644
index 00000000..b5e82811
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlMetricType.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cpman;
+
+/**
+ * A set of metric type used in control plane.
+ */
+public enum ControlMetricType {
+
+ /** Racket Rate of Control Message. */
+ PacketRate,
+
+ /** Byte Rate of Control Message. */
+ ByteRate,
+
+ /** Cpu Utilization. */
+ CpuInfo,
+
+ /** Memory Utilization. */
+ MemoryInfo
+}
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneLoad.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneLoad.java
new file mode 100644
index 00000000..f55945fd
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneLoad.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cpman;
+
+import org.onosproject.net.statistic.Load;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Data repository for control plane load information.
+ */
+public interface ControlPlaneLoad extends Load {
+
+ /**
+ * Obtain the average of the specified time duration.
+ *
+ * @param duration time duration
+ * @param unit time unit
+ * @return average control plane metric value
+ */
+ long average(int duration, TimeUnit unit);
+
+ /**
+ * Obtain the average of all time duration.
+ *
+ * @return average control plane metric value
+ */
+ long average();
+}
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneManager.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneManager.java
new file mode 100644
index 00000000..5f3dee73
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneManager.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cpman;
+
+import com.sun.jndi.toolkit.ctx.ComponentContext;
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Modified;
+import org.slf4j.Logger;
+
+import static org.slf4j.LoggerFactory.getLogger;
+
+/**
+ * Control plane management application.
+ */
+public class ControlPlaneManager {
+
+ private final Logger log = getLogger(getClass());
+
+ @Activate
+ public void activate(ComponentContext context) {
+
+ }
+
+ @Deactivate
+ public void deactivate() {
+
+ }
+
+ @Modified
+ public void modified(ComponentContext context) {
+
+ }
+} \ No newline at end of file
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneMetric.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneMetric.java
new file mode 100644
index 00000000..19f4153a
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneMetric.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cpman;
+
+/**
+ * Include various control plane metrics.
+ */
+public class ControlPlaneMetric {
+
+ private ControlMetricType metricType;
+ private long metricValue;
+
+ ControlMetricType metricType() {
+ return metricType;
+ }
+
+ void setMetricType(ControlMetricType metricType) {
+ this.metricType = metricType;
+ }
+
+ long metricValue() {
+ return metricValue;
+ }
+
+ void setMetricValue(long metricValue) {
+ this.metricValue = metricValue;
+ }
+}
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneStatsService.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneStatsService.java
new file mode 100644
index 00000000..9fc2d7a9
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/ControlPlaneStatsService.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.cpman;
+
+import org.onosproject.cluster.NodeId;
+import org.onosproject.net.DeviceId;
+
+import java.util.Optional;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Control Plane Statistics Service Interface.
+ */
+public interface ControlPlaneStatsService {
+
+ /**
+ * Add a new control plane metric value with a certain update interval.
+ *
+ * @param cpm control plane metric (e.g., control message rate, cpu, memory, etc.)
+ * @param updateInterval value update interval (time unit will be in minute)
+ */
+ void updateMetric(ControlPlaneMetric cpm, int updateInterval);
+
+ /**
+ * Obtain the control plane load of a specific device.
+ *
+ * @param nodeId node id {@link org.onosproject.cluster.NodeId}
+ * @param type control metric type
+ * @param deviceId device id {@link org.onosproject.net.DeviceId}
+ * @return control plane load
+ */
+ ControlPlaneLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId);
+
+ /**
+ * Obtain the control plane load of a specific device with a specific time duration.
+ *
+ * @param nodeId node id {@link org.onosproject.cluster.NodeId}
+ * @param type control metric type
+ * @param duration time duration
+ * @param unit time unit
+ * @param deviceId device id {@link org.onosproject.net.Device}
+ * @return control plane load
+ */
+ ControlPlaneLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId,
+ int duration, TimeUnit unit);
+} \ No newline at end of file
diff --git a/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/package-info.java b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/package-info.java
new file mode 100644
index 00000000..e2c1dc85
--- /dev/null
+++ b/framework/src/onos/apps/cpman/src/main/java/org/onosproject/cpman/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Application for control plane management.
+ */
+package org.onosproject.cpman; \ No newline at end of file