Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • camara-integration
  • cnit-optical-band-expansion
  • cnit_related_activity_premerge
  • cnit_tapi
  • cnit_transponders
  • develop
  • feat/108-extend-sbi-with-auto-discovery-of-endpoints-and-channels
  • feat/110-cttc-incorrect-endpoint-lookup-in-nbi-etsi-bwm-plugin
  • feat/113-cttc-implement-nbi-connector-to-manage-network-access-control-lists-acls
  • feat/116-ubi-updates-in-telemetry-backend-to-support-p4-in-band-network-telemetry
  • feat/116-ubi-updates-in-telemetry-backend-to-support-p4-in-band-network-telemetry-2
  • feat/128-cttc-add-ids-support
  • feat/138-ubi-error-handling-in-ztp-component
  • feat/138-ubi-error-handling-in-ztp-component-2
  • feat/139-ubi-p4-driver-does-not-correctly-retrieve-resources
  • feat/161-tid-creation-of-ip-link-with-supporting-coherent-pluggable-to-pluggable-connection
  • feat/163-implement-camara-based-nbi-connector-old-to-be-removed
  • feat/167-ansible-for-configuring-a-tfs-compatible-microk8s-cluster
  • feat/169-cttc-implement-vnt-manager-component
  • feat/183-create-qosprofile-component
  • feat/190-cttc-generalize-service-database-management
  • feat/192-cttc-implement-telemetry-backend-collector-gnmi-openconfig
  • feat/236-integration-with-multiband-amplifier-with-ocm
  • feat/253-tid-tapi-support
  • feat/264-tid-nbi-fot-sap-topology
  • feat/265-tid-new-service-type-for-pon-controller
  • feat/270-job-failed-131879
  • feat/278-cnit-basic-flexgrid-lightpath-deployment
  • feat/280-cttc-enhance-bgp-support-in-netconf-openconfig-sbi-driver
  • feat/281-optical-bandwidth-expansion
  • feat/292-cttc-implement-integration-test-for-ryu-openflow
  • feat/294-cttc-correct-ci-cd-descriptors
  • feat/296-cttc-camara-end-to-end-ci-cd-tests-fail
  • feat/301-cttc-dscm-pluggables
  • feat/303-add-test-to-feature-develop-during-234-related-to-osm-integration-2
  • feat/303-add-test-to-feature-develop-during-234-related-to-osm-integration-3
  • feat/304-cttc-netconf-based-openconfig-telemetry-collector
  • feat/305-cttc-enhanced-netconf-openconfig-sbi-driver-for-dscm-pluggables
  • feat/306-cttc-enhanced-restconf-based-openconfig-nbi-for-dscm-pluggables
  • feat/307-update-python-version
  • feat/308-code-formatting
  • feat/310-cttc-implement-nbi-connector-to-interface-with-osm-client
  • feat/312-tid-new-service-to-configure-interfaces-via-openconfig
  • feat/313-tid-new-tapi-service-for-lsp-configuration
  • feat/313-tid-new-tapi-service-for-lsp-configuration-2
  • feat/314-tid-new-service-for-ipowdm-configuration-fron-orchestrator-to-ipowdm-controller
  • feat/316-cnit-basic-point-multiploint-optical-connections
  • feat/320-cttc-ietf-simap-basic-support-with-kafka-yang-push
  • feat/321-add-support-for-gnmi-configuration-via-proto
  • feat/322-add-read-support-for-ipinfusion-devices-via-netconf
  • feat/323-add-support-for-restconf-protocol-in-devices
  • feat/46-cttc-rename-sbi-component
  • feat/62-tid-add-support-to-nbi-to-export-the-device-inventory-items-2
  • feat/92-cttc-implement-sbi-driver-for-nokia-sr-linux-l2-vpns-through-gnmi
  • feat/94-cttc-nbi-unitary-tests-not-running-and-or-not-working
  • feat/automation-revisited
  • feat/automation-workflow-plugin
  • feat/cttc-nbi-post-service
  • feat/cttc-service-concurrent-task-executor
  • feat/energy-monitoring
  • feat/hackfest
  • feat/hackfest-r2
  • feat/hackfest-r2.1
  • feat/hackfest3
  • feat/hackfest4
  • feat/hackfest5
  • feat/policy-refactor
  • feat/refactor-upgrade-policy
  • feat/siae-mw-driver-enhancement
  • feat/telemetry-collector-int
  • feat/telemetry-int-collector-support-p4
  • feat/tid-bgp
  • feat/tid-logical-resources-component
  • feat/tid-new-pcep-component
  • feat/tid-newer-pcep-component
  • feat/tid-openconfig-refactoring
  • feat/tid-p4
  • feat/tid-pcep
  • feat/tid-pcep-component
  • feat/tid-sap-topology
  • feat/ztp-error-handling
  • fix/58-adapt-interdomain-and-dlt-components-for-release-3-0-to-automate-nfv-sdn-22-experiment
  • fix/remove_automation_subscribe
  • master
  • openroadm-flex-grid
  • release/1.0.0
  • release/2.0.0
  • release/2.0.1
  • release/2.1.0
  • release/3.0.0
  • release/3.0.1
  • release/4.0.0
  • release/5.0.0
  • temp-pr-p4-int
  • test/formatting
  • test/version
  • tmp-integration
  • demo-dpiab-eucnc2024
  • v1.0.0
  • v2.0.0
  • v2.1.0
  • v3.0.0
  • v4.0.0
  • v5.0.0
104 results

Target

Select target project
  • tfs/controller
1 result
Select Git revision
  • camara-integration
  • cnit-optical-band-expansion
  • cnit_related_activity_premerge
  • cnit_tapi
  • cnit_transponders
  • develop
  • feat/108-extend-sbi-with-auto-discovery-of-endpoints-and-channels
  • feat/110-cttc-incorrect-endpoint-lookup-in-nbi-etsi-bwm-plugin
  • feat/113-cttc-implement-nbi-connector-to-manage-network-access-control-lists-acls
  • feat/116-ubi-updates-in-telemetry-backend-to-support-p4-in-band-network-telemetry
  • feat/116-ubi-updates-in-telemetry-backend-to-support-p4-in-band-network-telemetry-2
  • feat/128-cttc-add-ids-support
  • feat/138-ubi-error-handling-in-ztp-component
  • feat/138-ubi-error-handling-in-ztp-component-2
  • feat/139-ubi-p4-driver-does-not-correctly-retrieve-resources
  • feat/161-tid-creation-of-ip-link-with-supporting-coherent-pluggable-to-pluggable-connection
  • feat/163-implement-camara-based-nbi-connector-old-to-be-removed
  • feat/167-ansible-for-configuring-a-tfs-compatible-microk8s-cluster
  • feat/169-cttc-implement-vnt-manager-component
  • feat/183-create-qosprofile-component
  • feat/190-cttc-generalize-service-database-management
  • feat/192-cttc-implement-telemetry-backend-collector-gnmi-openconfig
  • feat/236-integration-with-multiband-amplifier-with-ocm
  • feat/253-tid-tapi-support
  • feat/264-tid-nbi-fot-sap-topology
  • feat/265-tid-new-service-type-for-pon-controller
  • feat/270-job-failed-131879
  • feat/278-cnit-basic-flexgrid-lightpath-deployment
  • feat/280-cttc-enhance-bgp-support-in-netconf-openconfig-sbi-driver
  • feat/281-optical-bandwidth-expansion
  • feat/292-cttc-implement-integration-test-for-ryu-openflow
  • feat/294-cttc-correct-ci-cd-descriptors
  • feat/296-cttc-camara-end-to-end-ci-cd-tests-fail
  • feat/301-cttc-dscm-pluggables
  • feat/303-add-test-to-feature-develop-during-234-related-to-osm-integration-2
  • feat/303-add-test-to-feature-develop-during-234-related-to-osm-integration-3
  • feat/304-cttc-netconf-based-openconfig-telemetry-collector
  • feat/305-cttc-enhanced-netconf-openconfig-sbi-driver-for-dscm-pluggables
  • feat/306-cttc-enhanced-restconf-based-openconfig-nbi-for-dscm-pluggables
  • feat/307-update-python-version
  • feat/308-code-formatting
  • feat/310-cttc-implement-nbi-connector-to-interface-with-osm-client
  • feat/312-tid-new-service-to-configure-interfaces-via-openconfig
  • feat/313-tid-new-tapi-service-for-lsp-configuration
  • feat/313-tid-new-tapi-service-for-lsp-configuration-2
  • feat/314-tid-new-service-for-ipowdm-configuration-fron-orchestrator-to-ipowdm-controller
  • feat/316-cnit-basic-point-multiploint-optical-connections
  • feat/320-cttc-ietf-simap-basic-support-with-kafka-yang-push
  • feat/321-add-support-for-gnmi-configuration-via-proto
  • feat/322-add-read-support-for-ipinfusion-devices-via-netconf
  • feat/323-add-support-for-restconf-protocol-in-devices
  • feat/46-cttc-rename-sbi-component
  • feat/62-tid-add-support-to-nbi-to-export-the-device-inventory-items-2
  • feat/92-cttc-implement-sbi-driver-for-nokia-sr-linux-l2-vpns-through-gnmi
  • feat/94-cttc-nbi-unitary-tests-not-running-and-or-not-working
  • feat/automation-revisited
  • feat/automation-workflow-plugin
  • feat/cttc-nbi-post-service
  • feat/cttc-service-concurrent-task-executor
  • feat/energy-monitoring
  • feat/hackfest
  • feat/hackfest-r2
  • feat/hackfest-r2.1
  • feat/hackfest3
  • feat/hackfest4
  • feat/hackfest5
  • feat/policy-refactor
  • feat/refactor-upgrade-policy
  • feat/siae-mw-driver-enhancement
  • feat/telemetry-collector-int
  • feat/telemetry-int-collector-support-p4
  • feat/tid-bgp
  • feat/tid-logical-resources-component
  • feat/tid-new-pcep-component
  • feat/tid-newer-pcep-component
  • feat/tid-openconfig-refactoring
  • feat/tid-p4
  • feat/tid-pcep
  • feat/tid-pcep-component
  • feat/tid-sap-topology
  • feat/ztp-error-handling
  • fix/58-adapt-interdomain-and-dlt-components-for-release-3-0-to-automate-nfv-sdn-22-experiment
  • fix/remove_automation_subscribe
  • master
  • openroadm-flex-grid
  • release/1.0.0
  • release/2.0.0
  • release/2.0.1
  • release/2.1.0
  • release/3.0.0
  • release/3.0.1
  • release/4.0.0
  • release/5.0.0
  • temp-pr-p4-int
  • test/formatting
  • test/version
  • tmp-integration
  • demo-dpiab-eucnc2024
  • v1.0.0
  • v2.0.0
  • v2.1.0
  • v3.0.0
  • v4.0.0
  • v5.0.0
104 results
Show changes
Showing
with 2523 additions and 0 deletions
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.controllers;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.concurrent.locks.Lock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import eu.teraflow.tid.tedb.DomainTEDB;
import eu.teraflow.tid.tedb.IntraDomainEdge;
import eu.teraflow.tid.tedb.SimpleTEDB;
import eu.teraflow.tid.tedb.TE_Information;
import eu.teraflow.tid.tedb.elements.RouterInfoPM;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
/**
* Thread that reads topology from Openflow controller and from XML if there are intradomain links
* @author jaume
*
*/
public class TEDUpdaterRYU extends TEDUpdaterController
{
public static String controllerName = "RYU";
private Hashtable<Integer,MyEdge> interDomainLinks = new Hashtable<Integer,MyEdge>();
//Overwritten father variables and fixing the topology urls in code
private String topologyPathNodes = "/v1.0/topology/switches";
private String topologyPathLinks = "/v1.0/topology/links";
public TEDUpdaterRYU(String ip, String port, String topologyPathLinks, String topologyPathNodes,DomainTEDB ted, Logger log)
{
super( ip, port, topologyPathLinks, topologyPathNodes, ted, log);
}
public TEDUpdaterRYU(String ip, String port, String topologyPathLinks, String topologyPathNodes,DomainTEDB ted, Logger log, Lock lock)
{
super( ip, port, topologyPathLinks, topologyPathNodes, ted, log, lock);
}
public TEDUpdaterRYU(ArrayList<String> ips, ArrayList<String>ports , String topologyPathLinks, String topologyPathNodes,DomainTEDB ted, Logger log)
{
super(ips, ports , topologyPathLinks, topologyPathNodes, ted, log);
}
@Override
public void run()
{
if(interDomainFile != null)
{
interDomainLinks = TEDUpdaterController.readInterDomainFile(interDomainFile);
}
String responseLinks = "";
String responseNodes = "";
try
{
Hashtable<String,RouterInfoPM> nodes = new Hashtable<String,RouterInfoPM>();
for (int i = 0; i < ips.size(); i++)
{
responseNodes = queryForNodes(ips.get(i), ports.get(i));
parseNodes(responseNodes, nodes, ips.get(i), ports.get(i));
log.info("responseNodes:::"+responseNodes);
}
for (int i = 0; i < ips.size(); i++)
{
responseLinks = queryForLinks(ips.get(i), ports.get(i));
log.info("responseLinks:::"+responseLinks);
lock();
parseLinks(responseLinks, nodes);
unlock();
}
//parseJSON("[{\"src-switch\":\"00:14:2c:59:e5:5e:2b:00\",\"src-port\":20,\"src-port-state\":0,\"dst-switch\":\"00:14:2c:59:e5:64:21:00\",\"dst-port\":19,\"dst-port-state\":0,\"type\":\"internal\"},{\"src-switch\":\"00:14:2c:59:e5:64:21:00\",\"src-port\":19,\"src-port-state\":0,\"dst-switch\":\"00:14:2c:59:e5:5e:2b:00\",\"dst-port\":20,\"dst-port-state\":0,\"type\":\"internal\"},{\"src-switch\":\"00:14:2c:59:e5:66:ed:00\",\"src-port\":9,\"src-port-state\":0,\"dst-switch\":\"00:14:2c:59:e5:64:21:00\",\"dst-port\":20,\"dst-port-state\":0,\"type\":\"internal\"},{\"src-switch\":\"00:14:2c:59:e5:64:21:00\",\"src-port\":20,\"src-port-state\":0,\"dst-switch\":\"00:14:2c:59:e5:66:ed:00\",\"dst-port\":9,\"dst-port-state\":0,\"type\":\"internal\"}]");
//System.out.println(response);
}
catch (Exception e)
{
log.info(e.toString());
}
}
private String RYUtoFloodlight(String RYUFormat)
{
String floodFormat = new String(RYUFormat);
//Por algo se me conoce como el hacker
for (int i = 2; i < floodFormat.length(); i += 3)
{
floodFormat = floodFormat.substring(0, i) + ":" + floodFormat.substring(i, floodFormat.length());
}
log.info("RYUFormat--> " + RYUFormat + ", floodFormat-->" + floodFormat);
return floodFormat;
}
private void parseNodes(String response, Hashtable<String,RouterInfoPM> routerInfoList, String ip, String port)
{
try
{
JSONParser parser = new JSONParser();
Object obj = parser.parse(response);
JSONArray msg = (JSONArray) obj;
Iterator<JSONObject> iterator = msg.iterator();
while (iterator.hasNext())
{
JSONObject jsonObject = (JSONObject) iterator.next();
log.info("(String)jsonObject.get(dpid)::"+(String)jsonObject.get("dpid"));
RouterInfoPM rInfo = new RouterInfoPM();
rInfo.setRouterID(RYUtoFloodlight((String)jsonObject.get("dpid")));
rInfo.setConfigurationMode("Openflow");
rInfo.setControllerType(TEDUpdaterRYU.controllerName);
rInfo.setControllerIdentifier(ip, port);
rInfo.setControllerIP(ip);
rInfo.setControllerPort(port);
routerInfoList.put(rInfo.getRouterID(),rInfo);
((SimpleTEDB)TEDB).getNetworkGraph().addVertex(rInfo);
}
}
catch (Exception e)
{
log.info(e.toString());
}
}
private void parseLinks(String links,Hashtable<String,RouterInfoPM> nodes)
{
try {
//log.info("Inside parseJSON");
JSONParser parser = new JSONParser();
Object obj = parser.parse(links);
JSONArray msg = (JSONArray) obj;
Iterator<JSONObject> iterator = msg.iterator();
while (iterator.hasNext())
{
JSONObject jsonObject = (JSONObject) iterator.next();
//System.out.println(jsonObject.get("src-switch"));
IntraDomainEdge edge= new IntraDomainEdge();
JSONObject jsonObject_src = (JSONObject) jsonObject.get("src");
JSONObject jsonObject_dst = (JSONObject) jsonObject.get("dst");
RouterInfoPM source = nodes.get(RYUtoFloodlight((String)jsonObject_src.get("dpid")));
RouterInfoPM dest = nodes.get(RYUtoFloodlight((String)jsonObject_dst.get("dpid")));
//((SimpleTEDB)TEDB).getNetworkGraph().addVertex(source);
//((SimpleTEDB)TEDB).getNetworkGraph().addVertex(dest);
log.info("Adding Vertex->"+source+" hashcode:"+source.hashCode());
log.info("Adding Vertex->"+dest+" hashcode:"+dest.hashCode());
edge.setSrc_if_id(Long.parseLong((String) jsonObject_src.get("port_no")));
edge.setDst_if_id(Long.parseLong((String) jsonObject_dst.get("port_no")));
// This is a big problem because info is not initialized from file
// and the controller doesn't give information about how many wlans
// the are
TE_Information tE_info = new TE_Information();
tE_info.setNumberWLANs(15);
tE_info.initWLANs();
if (interDomainFile != null)
{
completeTE_Information(tE_info, source.getRouterID(), dest.getRouterID());
}
edge.setTE_info(tE_info);
String isBidirectional = (String)jsonObject.get("direction");
// En RYU los enlaces son unidirecctionales, pero asumimos que hay uno en una direccion
// esta el otro
isBidirectional = "bidirectional";
//log.info("isBidirectional::"+isBidirectional);
if ((1==1)||(isBidirectional != null) && (isBidirectional.equals("bidirectional")))
{
//((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
TE_Information tE_infoOtherWay = new TE_Information();
tE_infoOtherWay.setNumberWLANs(15);
tE_infoOtherWay.initWLANs();
IntraDomainEdge edgeOtherWay= new IntraDomainEdge();
edgeOtherWay.setSrc_if_id(Long.parseLong((String) jsonObject_src.get("port_no")));
edgeOtherWay.setDst_if_id(Long.parseLong((String) jsonObject_dst.get("port_no")));
edgeOtherWay.setTE_info(tE_infoOtherWay);
((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
((SimpleTEDB)TEDB).getNetworkGraph().addEdge(dest, source, edgeOtherWay);
completeTE_Information(tE_info, dest.getRouterID(), source.getRouterID());
log.info("source::"+source);
log.info("dest::"+dest);
log.info("edgeOtherWay::"+edgeOtherWay);
log.info("edge::"+edge);
}
else
{
((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
}
//log.info("Edge added:"+edge);
//log.info(((SimpleTEDB)TEDB).getIntraDomainLinks().toString());
}
//parseRemainingLinksFromXML(nodes);
}
catch (Exception e)
{
log.info(e.toString());
}
}
private void completeTE_Information(TE_Information tE_info, String source, String dest)
{
MyEdge auxEdge = new MyEdge(source, dest);
MyEdge completEdge = interDomainLinks.get(auxEdge.hashCode());
if ((completEdge != null)&&(completEdge.vlan != null))
{
tE_info.setVlanLink(true);
tE_info.setVlan(completEdge.vlan);
//If it has been found it will be removed so the rest can be proccessed later
interDomainLinks.remove(completEdge.vlan);
}
else
{
tE_info.setVlanLink(false);
}
}
private String queryForLinks(String ip, String port)
{
String response = "";
try
{
URL topoplogyURL = new URL("http://"+ip+":"+port+topologyPathLinks);
log.info("URL::"+"http://"+ip+":"+port+topologyPathLinks);
URLConnection yc = topoplogyURL.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
response = response + inputLine;
}
}
catch (Exception e)
{
log.info(e.toString());
}
return response;
}
private String queryForNodes(String ip, String port)
{
String response = "";
try
{
URL topoplogyURL = new URL("http://"+ip+":"+port+topologyPathNodes);
log.info("http://+port+topologyPathNodes:::"+"http://"+ip+":"+port+topologyPathNodes);
URLConnection yc = topoplogyURL.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
response = response + inputLine;
}
in.close();
}
catch (Exception e)
{
log.info(e.toString());
}
return response;
}
public String getInterDomainFile()
{
return interDomainFile;
}
public void setInterDomainFile(String interDomainFile)
{
this.interDomainFile = interDomainFile;
}
private void lock()
{
if (lock != null)
{
lock.lock();
}
}
private void unlock()
{
if (lock != null)
{
lock.unlock();
}
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.controllers;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.concurrent.locks.Lock;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import com.metaparadigm.jsonrpc.JSONSerializer;
import eu.teraflow.tid.tedb.DomainTEDB;
import eu.teraflow.tid.tedb.IntraDomainEdge;
import eu.teraflow.tid.tedb.SimpleTEDB;
import eu.teraflow.tid.tedb.TE_Information;
import eu.teraflow.tid.tedb.controllers.TEDUpdaterController.MyEdge;
import eu.teraflow.tid.tedb.elements.RouterInfoPM;
public class TEDUpdaterTREMA extends TEDUpdaterController
{
public static String controllerName = "TREMA";
private Hashtable<Integer,MyEdge> interDomainLinks = new Hashtable<Integer,MyEdge>();
//Overwritten father variables and fixing the topology urls in code
private String topologyPathNodes = "/get_topology/";
private String topologyPathLinks = "/get_graph/";//??
public TEDUpdaterTREMA(String ip, String port, String topologyPathLinks, String topologyPathNodes,DomainTEDB ted, Logger log)
{
super( ip, port, topologyPathLinks, topologyPathNodes, ted, log);
}
public TEDUpdaterTREMA(String ip, String port, String topologyPathLinks, String topologyPathNodes,DomainTEDB ted, Logger log, Lock lock)
{
super( ip, port, topologyPathLinks, topologyPathNodes, ted, log, lock);
}
public TEDUpdaterTREMA(ArrayList<String> ips, ArrayList<String>ports , String topologyPathLinks, String topologyPathNodes,DomainTEDB ted, Logger log)
{
super(ips, ports , topologyPathLinks, topologyPathNodes, ted, log);
}
@Override
public void run()
{
if(interDomainFile != null)
{
interDomainLinks = TEDUpdaterController.readInterDomainFile(interDomainFile);
}
String responseLinks = "";
String responseNodes = "";
try
{
Hashtable<String,RouterInfoPM> nodes = new Hashtable<String,RouterInfoPM>();
for (int i = 0; i < ips.size(); i++)
{
responseNodes = queryForNodes(ips.get(i), ports.get(i));//query for topology
parseNodes(responseNodes, nodes, ips.get(i), ports.get(i));
log.info("responseNodes:::"+responseNodes);
}
}
catch (Exception e)
{
log.info(e.toString());
}
}
private String KDDItoFloodlight(String BristolFormat)
{
String floodFormat = new String(BristolFormat);
//Por algo se me conoce como el hacker
for (int i = 2; i < floodFormat.length(); i += 3)
{
floodFormat = floodFormat.substring(0, i) + ":" + floodFormat.substring(i, floodFormat.length());
}
log.info("BristolFormat--> " + BristolFormat + ", floodFormat-->" + floodFormat);
return floodFormat;
}
private void parseNodes(String response, Hashtable<String,RouterInfoPM> routerInfoList, String ip, String port)
{
try
{
JSONParser parser = new JSONParser();
Object obj = parser.parse(response);
JSONObject jsonaux=(JSONObject) obj;
String host=(String)jsonaux.get("hostConfig").toString();
obj=parser.parse(host);
JSONObject jsonhost=(JSONObject) obj;
//FIXME: This info has been taken from TREMA controller but is not used. Take a look if it's necessary
String OPS_Label=(String)jsonhost.get("OPS label");
String Port_id=(String)jsonhost.get("Port_id");
String reach_nodes=(String)jsonhost.get("Reachable nodes");
String node_type=(String)jsonhost.get("nodeType");//Used for RouterType
RouterInfoPM rInfo = new RouterInfoPM();
String dpid=((String)jsonhost.get("Virtual_node_id")).replace("-", ":");
rInfo.setRouterID(dpid);//Bristol to floodlight?
rInfo.setConfigurationMode("Openflow");
rInfo.setControllerType(TEDUpdaterNOX.controllerName);
rInfo.setRouterType(node_type);
rInfo.setReachable_nodes(parseReachability(reach_nodes));
rInfo.setControllerIdentifier(ip, port);
rInfo.setControllerIP(ip);
rInfo.setControllerPort(port);
routerInfoList.put(rInfo.getRouterID(),rInfo);
((SimpleTEDB)TEDB).getNetworkGraph().addVertex(rInfo);
//Getting Links
//parseLinks(???);
//parseLinks(dpid, jsonarray)
}
catch (Exception e)
{
log.info(e.toString());
}
}
private LinkedList<String> parseReachability(String reach_nodes) {
boolean end=false;
int beginIndex=0;
LinkedList<String> nodes= new LinkedList<String>();
reach_nodes=reach_nodes.replace(" ", "");
System.out.println("Reachable Nodes:"+reach_nodes);
while (!end){
int pointer=reach_nodes.indexOf(",");
if (pointer==-1)
end=true;
else {
String node=reach_nodes.substring(beginIndex, pointer);
System.out.println("Reachable Node:"+node);
reach_nodes=reach_nodes.substring(pointer+1);
nodes.add(node);
}
}
if (reach_nodes.length()>0){
System.out.println("Reachable Node:"+reach_nodes);
nodes.add(reach_nodes);
}
return nodes;
}
private void parseLinks(String dpid,String links, Hashtable<String,RouterInfoPM> nodes) //NOX Parse Links. it's not used in TREMA
{
try {
//log.info("Inside parseJSON");
JSONParser parser = new JSONParser();
Object obj = parser.parse(links);
JSONArray msg = (JSONArray) obj;
Iterator<JSONObject> iterator = msg.iterator();
while (iterator.hasNext())
{
JSONObject jsonObject = (JSONObject) iterator.next();
//System.out.println(jsonObject.get("src-switch"));
IntraDomainEdge edge= new IntraDomainEdge();
String labels = (String) jsonObject.get("labels");//??
String destnode = ((String) jsonObject.get("peer_node")).replace("-", ":");
String type = (String) jsonObject.get("port_type");
RouterInfoPM source = nodes.get(dpid);
RouterInfoPM dest = nodes.get(destnode);
//((SimpleTEDB)TEDB).getNetworkGraph().addVertex(source);
//((SimpleTEDB)TEDB).getNetworkGraph().addVertex(dest);
System.out.println("Srcnode: "+dpid);
System.out.println("Dstnode: "+destnode);
System.out.println("Srcport: "+jsonObject.get("port_id"));
System.out.println("Dstport: "+jsonObject.get("peer_port"));
if ((dest!= null)&&(source!=null)){
edge.setSrc_if_id(Long.parseLong((String)jsonObject.get("port_id")));
edge.setDst_if_id(Long.parseLong((String)jsonObject.get("peer_port")));
edge.setType(type);
// This is a big problem because info is not initialized from file
// and the controller doesn't give information about how many wlans
// the are
TE_Information tE_info = new TE_Information();
System.out.println("Labels: Original ("+labels+") and Parsed ("+labels.substring(labels.indexOf(",")+1,labels.indexOf("]"))+")");
tE_info.setNumberWLANs(Integer.parseInt(labels.substring(labels.indexOf(",")+1,labels.indexOf("]"))));
tE_info.initWLANs();
if (interDomainFile != null)
{
completeTE_Information(tE_info, source.getRouterID(), dest.getRouterID());
}
edge.setTE_info(tE_info);
edge.setDirectional(true);
//Bidirectional case? See other TEDUpdaters.
((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
} else {
System.out.println("Link with an unknown node. Ingnoring...");
}
//log.info("Edge added:"+edge);
//log.info(((SimpleTEDB)TEDB).getIntraDomainLinks().toString());
}
//parseRemainingLinksFromXML(nodes);
}
catch (Exception e)
{
log.info(e.toString());
}
}
// private void parseLinks(String links,Hashtable<String,RouterInfoPM> nodes)
// {
// try {
// //log.info("Inside parseJSON");
// JSONParser parser = new JSONParser();
// Object obj = parser.parse(links);
//
// JSONArray msg = (JSONArray) obj;
// Iterator<JSONObject> iterator = msg.iterator();
// while (iterator.hasNext())
// {
// JSONObject jsonObject = (JSONObject) iterator.next();
// //System.out.println(jsonObject.get("src-switch"));
// IntraDomainEdge edge= new IntraDomainEdge();
//
// JSONObject jsonObject_src = (JSONObject) jsonObject.get("src");
// JSONObject jsonObject_dst = (JSONObject) jsonObject.get("dst");
//
// RouterInfoPM source = nodes.get(BristoltoFloodlight((String)jsonObject_src.get("dpid")));
// RouterInfoPM dest = nodes.get(BristoltoFloodlight((String)jsonObject_dst.get("dpid")));
//
// //((SimpleTEDB)TEDB).getNetworkGraph().addVertex(source);
// //((SimpleTEDB)TEDB).getNetworkGraph().addVertex(dest);
//
// log.info("Adding Vertex->"+source+" hashcode:"+source.hashCode());
// log.info("Adding Vertex->"+dest+" hashcode:"+dest.hashCode());
//
// edge.setSrc_if_id((Long)jsonObject_src.get("port_no"));
// edge.setDst_if_id((Long)jsonObject_dst.get("port_no"));
//
//
// // This is a big problem because info is not initialized from file
// // and the controller doesn't give information about how many wlans
// // the are
//
// TE_Information tE_info = new TE_Information();
// tE_info.setNumberWLANs(15);
// tE_info.initWLANs();
//
// if (interDomainFile != null)
// {
// completeTE_Information(tE_info, source.getRouterID(), dest.getRouterID());
// }
//
// edge.setTE_info(tE_info);
//
// String isBidirectional = (String)jsonObject.get("direction");
//
//
// // En Bristol los enlaces son unidirecctionales, pero asumimos que hay uno en una direccion
// // esta el otro
// isBidirectional = "bidirectional";
//
// //log.info("isBidirectional::"+isBidirectional);
//
// if ((1==1)||(isBidirectional != null) && (isBidirectional.equals("bidirectional")))
// {
// //((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
//
// TE_Information tE_infoOtherWay = new TE_Information();
// tE_infoOtherWay.setNumberWLANs(15);
// tE_infoOtherWay.initWLANs();
// IntraDomainEdge edgeOtherWay= new IntraDomainEdge();
//
// edgeOtherWay.setSrc_if_id((Long)jsonObject_src.get("port_no"));
// edgeOtherWay.setDst_if_id((Long)jsonObject_dst.get("port_no"));
// edgeOtherWay.setTE_info(tE_infoOtherWay);
//
// ((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
// ((SimpleTEDB)TEDB).getNetworkGraph().addEdge(dest, source, edgeOtherWay);
//
// completeTE_Information(tE_info, dest.getRouterID(), source.getRouterID());
//
// log.info("source::"+source);
// log.info("dest::"+dest);
// log.info("edgeOtherWay::"+edgeOtherWay);
// log.info("edge::"+edge);
// //log.info("Adding two!");
// }
// else
// {
// ((SimpleTEDB)TEDB).getNetworkGraph().addEdge(source, dest, edge);
// }
//
// //log.info("Edge added:"+edge);
// //log.info(((SimpleTEDB)TEDB).getIntraDomainLinks().toString());
// }
// //parseRemainingLinksFromXML(nodes);
//
//
// }
// catch (Exception e)
// {
// log.info(UtilsFunctions.exceptionToString(e));
// }
// }
private void completeTE_Information(TE_Information tE_info, String source, String dest)
{
MyEdge auxEdge = new MyEdge(source, dest);
MyEdge completEdge = interDomainLinks.get(auxEdge.hashCode());
if ((completEdge != null)&&(completEdge.vlan != null))
{
tE_info.setVlanLink(true);
tE_info.setVlan(completEdge.vlan);
//If it has been found it will be removed so the rest can be proccessed later
interDomainLinks.remove(completEdge.vlan);
}
else
{
tE_info.setVlanLink(false);
}
}
private String queryForLinks(String ip, String port)
{
String response = "";
try
{
URL topoplogyURL = new URL("http://"+ip+":"+port+topologyPathLinks);
log.info("URL::"+"http://"+ip+":"+port+topologyPathLinks);
URLConnection yc = topoplogyURL.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
response = response + inputLine;
}
}
catch (Exception e)
{
log.info(e.toString());
}
return response;
}
private String queryForNodes(String ip, String port)
{
String response = "";
try
{
URL topoplogyURL = new URL("http://"+ip+":"+port+topologyPathNodes);
log.info("http://+port+topologyPathNodes:::"+"http://"+ip+":"+port+topologyPathNodes);
URLConnection yc = topoplogyURL.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null)
{
response = response + inputLine;
}
in.close();
}
catch (Exception e)
{
log.info(e.toString());
}
return response;
}
public String getInterDomainFile()
{
return interDomainFile;
}
public void setInterDomainFile(String interDomainFile)
{
this.interDomainFile = interDomainFile;
}
private void lock()
{
if (lock != null)
{
lock.lock();
}
}
private void unlock()
{
if (lock != null)
{
lock.unlock();
}
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class AuthInfo {
/**User ID to be used for authentication */
private String userID;
/**password assicoated with the user ID*/
private String passwd;
/**
* @return the userID
*/
public String getUserID() {
return userID;
}
/**
* @param userID the userID to set
*/
public void setUserID(String userID) {
this.userID = userID;
}
/**
* @return the passwd
*/
public String getPasswd() {
return passwd;
}
/**
* @param passwd the passwd to set
*/
public void setPasswd(String passwd) {
this.passwd = passwd;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class Bandwidth {
double maxBandwidth;
double unreservedBw;
public Bandwidth (double initBandwidth){
maxBandwidth = initBandwidth;
unreservedBw = initBandwidth;
}
public Bandwidth (double max, double unresv){
maxBandwidth = max;
unreservedBw = unresv;
}
public String toString(){
return "Unreserved Bw = " + unreservedBw + ", Max Bandwidth = " + maxBandwidth;
}
/**
* @return the maxBandwidth
*/
public double getMaxBandwidth() {
return maxBandwidth;
}
/**
* @param maxBandwidth the maxBandwidth to set
*/
public void setMaxBandwidth(double maxBandwidth) {
this.maxBandwidth = maxBandwidth;
}
/**
* @return the unreservedBw
*/
public double getUnreservedBw() {
return unreservedBw;
}
/**
* @param unreservedBw the unreservedBw to set
*/
public void setUnreservedBw(double unreservedBw) {
this.unreservedBw = unreservedBw;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class BgpParams {
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class EndPoint {
String node;
String intf;
public EndPoint(String node, String intf){
this.node = node;
this.intf = intf;
}
/**
* @return the node
*/
public String getNode() {
return node;
}
/**
* @param node the node to set
*/
public void setNode(String node) {
this.node = node;
}
/**
* @return the intf
*/
public String getIntf() {
return intf;
}
/**
* @param intf the intf to set
*/
public void setIntf(String intf) {
this.intf = intf;
}
public int compareTo(EndPoint arg0) {
if ((arg0.intf.compareTo(this.intf)==0) && (arg0.node.compareTo(this.node)==0))
return 0;
else
return 1;
}
@Override
public boolean equals(Object obj) {
if ((this.node.equals(((EndPoint)obj).getNode()))&&
(this.intf.equals(((EndPoint)obj).getIntf())))
return true;
return false;
}
@Override
public String toString() {
// TODO Auto-generated method stub
String temp="";
temp += "Node = " + node + " - ";
temp += "Interface = " + intf ;
return temp;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.util.ArrayList;
public class IPNodeParams {
ArrayList<StaticRoutingParams> staticRoutingParams;
ArrayList<BgpParams> bgpParams;
ArrayList<IsisParams> isisParams;
ArrayList<OspfParams> ospfParams;
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.util.ArrayList;
public class Intf {
String name;
//TODO should the address not be mapped to a layer ??
ArrayList<String> address;
//TODO should the list of layers in an interface be selected using an ENUM
ArrayList <String> layering;
//TODO should the list of supported Counters be an ENUM
ArrayList<String> supportedCounters;
Boolean isPhysical;
//TODO for a virtual interface, should there be an association with a parent interface
String parentInterfaceName;
Boolean intfUp;
int label;
public int getLabel() {
return label;
}
public void setLabel(int label) {
this.label = label;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @return the address
*/
public ArrayList<String> getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(ArrayList<String> address) {
this.address = address;
}
/**
* @return the layering
*/
public ArrayList<String> getLayering() {
return layering;
}
/**
* @param layering the layering to set
*/
public void setLayering(ArrayList<String> layering) {
this.layering = layering;
}
/**
* @return the supportedCounters
*/
public ArrayList<String> getSupportedCounters() {
return supportedCounters;
}
/**
* @param supportedCounters the supportedCounters to set
*/
public void setSupportedCounters(ArrayList<String> supportedCounters) {
this.supportedCounters = supportedCounters;
}
/**
* @return the isPhysical
*/
public Boolean isPhysical() {
return isPhysical;
}
/**
* @param isPhysical the isPhysical to set
*/
public void setPhysical(Boolean isPhysical) {
this.isPhysical = isPhysical;
}
/**
* @return the parentInterfaceName
*/
public String getParentInterfaceName() {
return parentInterfaceName;
}
/**
* @param parentInterfaceName the parentInterfaceName to set
*/
public void setParentInterfaceName(String parentInterfaceName) {
this.parentInterfaceName = parentInterfaceName;
}
public Boolean isIntfUp() {
return intfUp;
}
public void setIntfUp(Boolean intfUp) {
this.intfUp = intfUp;
}
@Override
public boolean equals(Object arg0) {
// TODO Auto-generated method stub
if (((Intf)arg0).getName().equals(this.name)
//&&((Intf)arg0).isPhysical() == (this.isPhysical)
//&&((Intf)arg0).getParentInterfaceName().equals(this.parentInterfaceName)
&&(this.address.size() == ((Intf)arg0).getAddress().size())){
for (int i =0; i< address.size();i++){
if (!((Intf)arg0).getAddress().get(i).equals(address.get(i))){
return false;
}
}
if((supportedCounters!= null)&&(((Intf)arg0).getSupportedCounters() != null)){
if (supportedCounters.size() == (((Intf)arg0).getSupportedCounters().size()))
for (int i =0; i< supportedCounters.size(); i++){
if (!((Intf)arg0).getSupportedCounters().get(i).equals(supportedCounters.get(i))){
return false;
}
}
else{
return false;
}
}
if (((Intf)arg0).getLayering() != null){
if (layering.size() == (((Intf)arg0).getLayering().size())){
for (int i =0; i< layering.size(); i++){
if (!((Intf)arg0).getLayering().get(i).equals(layering.get(i))){
return false;
}
}
}
else
return false;
}
}
else{
return false;
}
return true;
}
public String toString(){
String temp="";
temp += "Name = " + name + " ";
temp += "Address = (";
for (int i=0;i<address.size();i++){
temp += address.get(i) + ", ";
}
temp = temp.substring(0, temp.length()-2);
temp += ") ";
temp += "Layering = (";
for (int i=0;i<layering.size();i++){
temp += layering.get(i) + ", ";
}
temp = temp.substring(0, temp.length()-2);
temp += ") ";
if (supportedCounters!= null){
temp += "Supported Counters = (";
for (int i=0;i<supportedCounters.size();i++){
temp += supportedCounters.get(i) + ", ";
}
}
temp = temp.substring(0, temp.length()-2);
temp += ") ";
temp += "isPhysical = " + isPhysical;
temp +="intfUp = " +intfUp;
return temp;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class IsisParams {
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class Link {
String linkID;
Boolean isDirectional;
EndPoint source;
EndPoint dest;
//TODO change to enumeration physical or service;
String type;//interlayer, interdomain, intradomain
Service service;
PhyLinkParams phyLinkParams;
double teMetric;
Bandwidth bandwidth;
String sourceId=null;
String destID=null;
String sourceIntf=null;
String destIntf=null;
public String getSourceId() {
return sourceId;
}
public void setSourceId(String sourceId) {
this.sourceId = sourceId;
}
public String getDestID() {
return destID;
}
public void setDestID(String destID) {
this.destID = destID;
}
public String getSourceIntf() {
return sourceIntf;
}
public void setSourceIntf(String sourceIntf) {
this.sourceIntf = sourceIntf;
}
public String getDestIntf() {
return destIntf;
}
public void setDestIntf(String destIntf) {
this.destIntf = destIntf;
}
public Boolean getIsDirectional() {
return isDirectional;
}
public void setIsDirectional(Boolean isDirectional) {
this.isDirectional = isDirectional;
}
public Bandwidth getBandwidth() {
return bandwidth;
}
public void setBandwidth(Bandwidth bandwidth) {
this.bandwidth = bandwidth;
}
public String getLinkID() {
return linkID;
}
public void setLinkID(String linkID) {
this.linkID = linkID;
}
/**
* @return the isDirectional
*/
public Boolean isDirectional() {
return isDirectional;
}
/**
* @param isDirectional the isDirectional to set
*/
public void setDirectional(Boolean isDirectional) {
this.isDirectional = isDirectional;
}
/**
* @return the source
*/
public EndPoint getSource() {
return source;
}
/**
* @param source the source to set
*/
public void setSource(EndPoint source) {
this.source = source;
}
/**
* @return the dest
*/
public EndPoint getDest() {
return dest;
}
/**
* @param dest the dest to set
*/
public void setDest(EndPoint dest) {
this.dest = dest;
}
/**
* @return the type
*/
public String getType() {
return type;
}
/**
* @param type the type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* @return the service
*/
public Service getService() {
return service;
}
/**
* @param service the service to set
*/
public void setService(Service service) {
this.service = service;
}
/**
* @return the phyLinkParams
*/
public PhyLinkParams getPhyLinkParams() {
return phyLinkParams;
}
/**
* @param phyLinkParams the phyLinkParams to set
*/
public void setPhyLinkParams(PhyLinkParams phyLinkParams) {
this.phyLinkParams = phyLinkParams;
}
/**
* @return the teMetric
*/
public double getTeMetric() {
return teMetric;
}
/**
* @param teMetric the teMetric to set
*/
public void setTeMetric(double teMetric) {
this.teMetric = teMetric;
}
@Override
public boolean equals(Object arg0) {
// TODO Auto-generated method stub
if ((linkID.equals(((Link)arg0).linkID))
&&(this.isDirectional == ((Link)arg0).isDirectional)
&&(this.source.equals(((Link)arg0).getSource()))
&&(this.dest.equals(((Link)arg0).getDest()))
// &&(this.type.equals(((Link)arg0).getType()))
// &&(this.service.equals(((Link)arg0).getService()))
// &&(this.phyLinkParams.equals(((Link)arg0).getPhyLinkParams()))
// &&(this.teMetric == ((Link)arg0).getTeMetric())
)
return true;
return false;
}
public String toString(){
String temp = "";
temp += "Source = (" + source.getNode() + ", " + source.getIntf() + ") " ;
temp += "Dest = (" + dest.getNode() + ", " + dest.getIntf() + ") " ;
temp += "isDirectional = " + isDirectional + " ";
temp += "Type = " + type+ " ";
if (phyLinkParams !=null)
temp += "Phy Link Params (Delay = " + phyLinkParams.getTransmissionDelay() + " isActive = " + phyLinkParams.getTransmissionDelay() + ") " ;
temp += "TE Metric = " + teMetric;
return temp;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class Location {
double xCoord;
double yCoord;
/**Constructor to set the location
*
* @param x X coordinate of the location
* @param y Y coordinate of the location
*/
public Location (double x, double y){
xCoord=x;
yCoord=y;
}
/**
* @return the xCoord
*/
public double getxCoord() {
return xCoord;
}
/**
* @param xCoord the xCoord to set
*/
public void setxCoord(double xCoord) {
this.xCoord = xCoord;
}
/**
* @return the yCoord
*/
public double getyCoord() {
return yCoord;
}
/**
* @param yCoord the yCoord to set
*/
public void setyCoord(double yCoord) {
this.yCoord = yCoord;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.util.ArrayList;
public class Node {
String nodeID;
ArrayList<String> address;
boolean isPhysical;
ArrayList<Intf> intfList;
int domain;
Location location;
IPNodeParams ipParams;
String parentRouter;
String layer;
String configurationMode;
String dataPathID;
/**Router Vendor Type*/
String routerType;
String controllerIP;
String controllerPort;
/**IOS version*/
String rotuerModel;
ArrayList<String> unnumberedIntfList=null;
public ArrayList<String> getUnnumberedIntfList() {
return unnumberedIntfList;
}
public void setUnnumberedIntfList(ArrayList<String> unnumberedIntfList) {
this.unnumberedIntfList = unnumberedIntfList;
}
public String getDataPathID() {
return dataPathID;
}
public void setDataPathID(String dpid) {
this.dataPathID = dpid;
}
public String getConfigurationMode() {
return configurationMode;
}
public void setConfigurationMode(String configurationMode) {
this.configurationMode = configurationMode;
}
public String getRouterType() {
return routerType;
}
public void setRouterType(String routerType) {
this.routerType = routerType;
}
public Object getControllerIP() {
return controllerIP;
}
public void setControllerIP(String controllerIP) {
this.controllerIP = controllerIP;
}
public Object getControllerPort() {
return controllerPort;
}
public void setControllerPort(String controllerPort) {
this.controllerPort = controllerPort;
}
public String getRotuerModel() {
return rotuerModel;
}
public void setRotuerModel(String iosVersion) {
this.rotuerModel = iosVersion;
}
/**
* @return the nodeID
*/
public String getNodeID() {
return nodeID;
}
/**
* @param nodeID the nodeID to set
*/
public void setNodeID(String nodeID) {
this.nodeID = nodeID;
}
/**
* @return the address
*/
public ArrayList<String> getAddress() {
return address;
}
/**
* @param address the address to set
*/
public void setAddress(ArrayList<String> address) {
this.address = address;
}
/**
* @return the isPhysical
*/
public boolean isPhysical() {
return isPhysical;
}
/**
* @param isPhysical the isPhysical to set
*/
public void setPhysical(boolean isPhysical) {
this.isPhysical = isPhysical;
}
/**
* @return the intfList
*/
public ArrayList<Intf> getIntfList() {
return intfList;
}
/**
* @param intfList the intfList to set
*/
public void setIntfList(ArrayList<Intf> intfList) {
this.intfList = intfList;
}
/**
* @return the domain
*/
public int getDomain() {
return domain;
}
/**
* @param domain the domain to set
*/
public void setDomain(int domain) {
this.domain = domain;
}
/**
* @return the location
*/
public Location getLocation() {
return location;
}
/**
* @param location the location to set
*/
public void setLocation(Location location) {
this.location = location;
}
/**
* @return the ipParams
*/
public IPNodeParams getIpParams() {
return ipParams;
}
/**
* @param ipParams the ipParams to set
*/
public void setIpParams(IPNodeParams ipParams) {
this.ipParams = ipParams;
}
/**
* @return the parentRouter
*/
public String getParentRouter() {
return parentRouter;
}
/**
* @param parentRouter the parentRouter to set
*/
public void setParentRouter(String parentRouter) {
this.parentRouter = parentRouter;
}
public String getLayer() {
return layer;
}
public void setLayer(String layer) {
this.layer = layer;
}
public String toString(){
String temp = "";
temp += "NodeID = " + nodeID +" " ;
if (location!=null)
temp += "Location = (" + location.xCoord + ", " + location.yCoord + ")" + " " ;
temp+= "Addresses (";
for (int i=0;i<address.size();i++){
temp +=address.get(i) + ", ";
}
temp=temp.substring(0, temp.length()-2);
temp += ") ";
temp += "Domain = " + domain + " " ;
temp += "ParentRouter = " + parentRouter + " " ;
temp += "\nInterfaces = {";
for (int i=0;i<intfList.size();i++){
temp += "\n\t" + intfList.get(i).toString();
}
temp += "configurationMode = " + configurationMode + " " ;
temp += " }";
return temp;
}
public Node(){
intfList = new ArrayList<Intf> ();
address = new ArrayList<String> ();
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class OspfParams {
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.util.ArrayList;
public class Path {
//TODO change to enumeration with values working/protection
String pathType;
ArrayList<Link> links;
public String toString(){
String temp = "";
if (links!=null){
for (int i=0;i<links.size();i++)
temp += "\n\t\t" + links.get(i).getSource() + "-->" + links.get(i).getDest() ;
}
return temp;
}
public Path(ArrayList<Link> links){
this.links = links;
}
/**
* @return the pathType
*/
public String getPathType() {
return pathType;
}
/**
* @param pathType the pathType to set
*/
public void setPathType(String pathType) {
this.pathType = pathType;
}
/**
* @return the links
*/
public ArrayList<Link> getLinks() {
return links;
}
/**
* @param links the links to set
*/
public void setLinks(ArrayList<Link> links) {
this.links = links;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class PhyLinkParams {
//Create parameters for Physical Link
double transmissionDelay;
boolean isActive;
public PhyLinkParams(double delay, boolean active){
isActive = active;
transmissionDelay = delay;
}
/**
* @return the transmissionDelay
*/
public double getTransmissionDelay() {
return transmissionDelay;
}
/**
* @param transmissionDelay the transmissionDelay to set
*/
public void setTransmissionDelay(double transmissionDelay) {
this.transmissionDelay = transmissionDelay;
}
/**
* @return the isActive
*/
public boolean isActive() {
return isActive;
}
/**
* @param isActive the isActive to set
*/
public void setActive(boolean isActive) {
this.isActive = isActive;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.net.Inet4Address;
public class RouterDesc {
/**ID for the router*/
protected String routerID;
/**Description of the physical Location */
private String phyDesc;
/**Addres for the configuration of the router*/
private Inet4Address managementAddress;
private int configurationPort;
/**Authentication Info for configuring the router*/
private AuthInfo authInfo;
/**Router Vendor Type*/
private String routerType;
/**IOS version*/
private String iosVersion;
private String macAddress;
/**
* @return the routerID
*/
public String getRouterID() {
return routerID;
}
/**
* @param routerID the routerID to set
*/
public void setRouterID(String routerID) {
this.routerID = routerID;
}
/**
* @return the phyDesc
*/
public String getPhyDesc() {
return phyDesc;
}
/**
* @param phyDesc the phyDesc to set
*/
public void setPhyDesc(String phyDesc) {
this.phyDesc = phyDesc;
}
/* *//**
* @return the confAddress
*//*
public Address getConfAddress() {
return confAddress;
}
*//**
* @param confAddress the confAddress to set
*//*
public void setConfAddress(Address confAddress) {
this.confAddress = confAddress;
}*/
/**
* @return the authInfo
*/
public AuthInfo getAuthInfo() {
return authInfo;
}
/**
* @param authInfo the authInfo to set
*/
public void setAuthInfo(AuthInfo authInfo) {
this.authInfo = authInfo;
}
/**
* @return the routerType
*/
public String getRouterType() {
return routerType;
}
/**
* @param routerType the routerType to set
*/
public void setRouterType(String routerType) {
this.routerType = routerType;
}
/**
* @return the iosVersion
*/
public String getIosVersion() {
return iosVersion;
}
/**
* @param iosVersion the iosVersion to set
*/
public void setIosVersion(String iosVersion) {
this.iosVersion = iosVersion;
}
public Inet4Address getManagementAddress() {
return managementAddress;
}
public void setManagementAddress(Inet4Address managementAddress) {
this.managementAddress = managementAddress;
}
public int getConfigurationPort() {
return configurationPort;
}
public void setConfigurationPort(int configurationPort) {
this.configurationPort = configurationPort;
}
public String getMacAddress() {
return macAddress;
}
public void setMacAddress(String macAddress) {
this.macAddress = macAddress;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.net.Inet4Address;
import java.net.UnknownHostException;
import java.util.LinkedList;
/**
*
* @author Anonimo
*
*/
public class RouterInfoPM extends RouterDesc
{
private String configurationMode;
private Inet4Address oppositeInterface;
private String controllerId;
private String controllerIP;
private String controllerPort;
private String controllerType;
private String routerModel;
private String routerType_Son;
private String layer;
private Intf srcIntf;
private String hardware;
private LinkedList<String> reachable_nodes;
private Intf dstIntf;
public void logAllInfo(){
System.out.println("configurationMode: "+this.getConfigurationMode()+" Reachable_nodes: "+this.getReachable_nodes()+" SrcIntf: "+this.getSrcIntf()+" DstIntf: "+this.getDstIntf()+" OppositeInterface: "+this.getOppositeInterface()+" RouterModel: "+this.getRouterModel()+" Layer: "+this.getLayer()+" getControllerId: "+this.getControllerId()+" getControllerIP: "+this.getControllerIP()+" ControllerPort: "+this.getControllerPort()+" Hardware: "+this.getHardware()+" ControllerType: "+this.getControllerType());
}
public LinkedList<String> getReachable_nodes()
{
return this.reachable_nodes;
}
public void setReachable_nodes(LinkedList<String> reachable_nodes) {
this.reachable_nodes = reachable_nodes;
}
public Intf getSrcIntf() {
return this.srcIntf;
}
public void setSrcIntf(Intf srcIntf) {
this.srcIntf = srcIntf;
}
public Intf getDstIntf() {
return this.dstIntf;
}
public void setDstIntf(Intf dstIntf) {
this.dstIntf = dstIntf;
}
public RouterInfoPM()
{
}
public RouterInfoPM(String id)
{
this.routerID = id;
}
public String getConfigurationMode() {
return this.configurationMode;
}
public void setConfigurationMode(String configurationMode) {
this.configurationMode = configurationMode;
}
public Inet4Address getOppositeInterface() {
return this.oppositeInterface;
}
public void setOppositeInterface(Inet4Address oppositeInterface) {
this.oppositeInterface = oppositeInterface;
}
public void fromNode(Node node) {
this.configurationMode = node.getConfigurationMode();
this.routerType_Son = node.getRouterType();
this.routerModel = node.getRotuerModel();
this.layer = node.getLayer();
setConfigurationMode(node.getConfigurationMode());
setRouterID(node.getNodeID());
try
{
setManagementAddress((Inet4Address)Inet4Address.getByName((String)node.getAddress().get(0)));
}
catch (UnknownHostException e) {
e.printStackTrace();
}
}
public String getRouterModel() {
return this.routerModel;
}
public void setRouterModel(String routerModel) {
this.routerModel = routerModel;
}
public String getRouterType() {
return this.routerType_Son;
}
public void setRouterType(String routerType) {
this.routerType_Son = routerType;
}
public String getLayer() {
return this.layer;
}
public void setLayer(String layer) {
this.layer = layer;
}
public int hashCode()
{
int prime = 31;
int result = 1;
if (this.routerID == null)
{
return 0;
}
String idAux = this.routerID.substring(0, 17);
result = 31 * result + (idAux == null ? 0 : idAux.hashCode());
return result;
}
public boolean equals(Object obj)
{
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RouterInfoPM other = (RouterInfoPM)obj;
if ((this.routerID.contains(other.getRouterID())) || (other.getRouterID().contains(this.routerID)))
{
return true;
}
if (this.routerID == null)
{
if (other.routerID != null)
{
return false;
}
}
else if (!this.routerID.equals(other.routerID))
{
return false;
}
return true;
}
public String toString()
{
if (this.oppositeInterface != null)
return "[RouterInfoPM]->" + this.routerID + " [OppositeInterface]->" + this.oppositeInterface;
return "[RouterInfoPM]->" + this.routerID;
}
public void setControllerIdentifier(String ip, String port)
{
this.controllerId = getUniqueIdentifierForController(ip, port);
}
public void setControllerIP(String ip)
{
this.controllerIP = ip;
}
public void setControllerPort(String port)
{
this.controllerPort = port;
}
public String getControllerId()
{
return this.controllerId;
}
public String getControllerIP()
{
return this.controllerIP;
}
public String getControllerPort()
{
return this.controllerPort;
}
private String getUniqueIdentifierForController(String ip, String port)
{
return ip + ":" + port;
}
public String getHardware()
{
return this.hardware;
}
public void setHardware(String hardware)
{
this.hardware = hardware;
}
public String getControllerType()
{
return this.controllerType;
}
public void setControllerType(String controllerType)
{
this.controllerType = controllerType;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
import java.util.ArrayList;
public class Service {
//TODO change to enumeration with possible values active/potential
String status;
//TODO change to enumeration with possible services like Ethernet/OTN etc. (or based on the layering available in interfaces
String serviceType;
Bandwidth bw;
//Change to Enumeration based on protection types
String protection;
EndPoint source;
EndPoint dest;
Path servicePath;
ArrayList<Integer> srlg;
String baseEncapsulation;
/**
* @return the status
*/
public String getStatus() {
return status;
}
public String toString(){
String temp = "";
temp += "\n\t ServiceType = " + serviceType;
temp += "\n\t Status = " + status;
temp += "\n\t Protection = " + protection;
temp += "\n\t Path = " + servicePath;
temp += "\n\t Bandwidth = " + bw;
return temp;
}
/**
* @param status the status to set
*/
public void setStatus(String status) {
this.status = status;
}
/**
* @return the serviceType
*/
public String getServiceType() {
return serviceType;
}
/**
* @param serviceType the serviceType to set
*/
public void setServiceType(String serviceType) {
this.serviceType = serviceType;
}
/**
* @return the bw
*/
public Bandwidth getBw() {
return bw;
}
/**
* @param bw the bw to set
*/
public void setBw(Bandwidth bw) {
this.bw = bw;
}
/**
* @return the protection
*/
public String getProtection() {
return protection;
}
/**
* @param protection the protection to set
*/
public void setProtection(String protection) {
this.protection = protection;
}
/**
* @return the source
*/
public EndPoint getSource() {
return source;
}
/**
* @param source the source to set
*/
public void setSource(EndPoint source) {
this.source = source;
}
/**
* @return the dest
*/
public EndPoint getDest() {
return dest;
}
/**
* @param dest the dest to set
*/
public void setDest(EndPoint dest) {
this.dest = dest;
}
/**
* @return the servicePath
*/
public Path getServicePath() {
return servicePath;
}
/**
* @param servicePath the servicePath to set
*/
public void setServicePath(Path servicePath) {
this.servicePath = servicePath;
}
/**
* @return the srlg
*/
public ArrayList<Integer> getSrlg() {
return srlg;
}
/**
* @param srlg the srlg to set
*/
public void setSrlg(ArrayList<Integer> srlg) {
this.srlg = srlg;
}
/**
* @return the baseEncapsulation
*/
public String getBaseEncapsulation() {
return baseEncapsulation;
}
/**
* @param baseEncapsulation the baseEncapsulation to set
*/
public void setBaseEncapsulation(String baseEncapsulation) {
this.baseEncapsulation = baseEncapsulation;
}
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
// 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 eu.teraflow.tid.tedb.elements;
public class StaticRoutingParams {
}
// Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
//
// 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.
syntax = "proto3";
package src.main.proto;
message updateRequest {
string addressFamilyID = 1;
string nextHop = 2;
string asPathSegment = 3;
repeated nodeInfo node = 4;
// repeated : se da la posibilidad de mandar 0 o varios
repeated linkInfo link = 5;
}
message nodeInfo{
string nodeName=1;
string igpID=2;
string bgplsID=3;
int32 asID=4;
string learntFrom = 5;
}
message linkInfo{
string remoteID=1;
string localID=2;
string remoteIPv4ID=3;
string localIPv4ID=4;
NodeDescriptors local=5;
NodeDescriptors remote=6;
float availableBw=7;
float residualBw = 8;
float utilized = 9;
float maxLinkDelay = 10;
float minLinkDelay = 11;
float delayVariation = 12;
float delay = 13;
int32 TEDefaultMetric = 14;
string adjacencySid = 15;
string learntFrom = 16;
}
message NodeDescriptors{
string asNumber=1;
string bgplsID=2;
}
message updateResponse {
string ack = 1;
}
// Defining a Service, a Service can have multiple RPC operations
service updateService {
// MODIFY HERE: Update the return to streaming return.
rpc update(updateRequest) returns (updateResponse);
}
\ No newline at end of file