├── .gitignore
├── .project
├── .travis.yml
├── CHANGELOG
├── LICENSE
├── README.md
├── VERSION
├── pom.xml
└── src
└── main
├── java
└── es
│ └── tid
│ ├── emulator
│ ├── node
│ │ ├── FastPCEPSession.java
│ │ ├── FastPCEPSessionServer.java
│ │ ├── NetworkNode.java
│ │ ├── NodeInformation.java
│ │ ├── NodeLauncher.java
│ │ ├── RemoteLSPInitPCEPSession.java
│ │ ├── RemoteLSPInitPCEPSessionServer.java
│ │ ├── management
│ │ │ ├── NodeManagementSession.java
│ │ │ └── NodeManagementSever.java
│ │ ├── resources
│ │ │ ├── Resource.java
│ │ │ ├── ResourceManager.java
│ │ │ ├── mpls
│ │ │ │ └── MPLSResourceManager.java
│ │ │ ├── sson
│ │ │ │ └── SSONResourceManager.java
│ │ │ └── wson
│ │ │ │ └── WSONResourceManager.java
│ │ ├── tedb
│ │ │ └── SimpleLocalTEDB.java
│ │ ├── topology
│ │ │ ├── Handler.java
│ │ │ ├── HandlerTestMain.java
│ │ │ └── ParametersPrueba.java
│ │ └── transport
│ │ │ ├── EmulatedPCCPCEPSession.java
│ │ │ ├── Errors.java
│ │ │ ├── ForwardingTable.java
│ │ │ ├── Interfaz.java
│ │ │ ├── LSPCreationException.java
│ │ │ ├── LSPReservationException.java
│ │ │ ├── PathComputationClient.java
│ │ │ ├── RequestedLSPinformation.java
│ │ │ ├── RequestedLSPinformationMPLS.java
│ │ │ ├── RequestedLSPinformationSSON.java
│ │ │ ├── RequestedLSPinformationWSON.java
│ │ │ ├── defineLocalTEDB.java
│ │ │ ├── lsp
│ │ │ ├── LSP.java
│ │ │ ├── LSPCreationErrorTypes.java
│ │ │ ├── LSPKey.java
│ │ │ ├── LSPManager.java
│ │ │ ├── LSPParameters.java
│ │ │ ├── Node_State_Parameters.java
│ │ │ ├── NotifyLSP.java
│ │ │ ├── PathState.java
│ │ │ └── te
│ │ │ │ ├── LSPTE.java
│ │ │ │ ├── PathStateParameters.java
│ │ │ │ ├── TEPathState.java
│ │ │ │ └── TechnologyParameters.java
│ │ │ ├── ospf
│ │ │ ├── OSPFController.java
│ │ │ ├── OSPFSendAllTopology.java
│ │ │ ├── OSPFSenderManager.java
│ │ │ └── OSPFSenderThread.java
│ │ │ └── rsvp
│ │ │ ├── RSVPListener.java
│ │ │ ├── RSVPManager.java
│ │ │ ├── RSVPProcessor.java
│ │ │ ├── RSVPSender.java
│ │ │ └── RSVPSession.java
│ └── pccPrueba
│ │ ├── ClientRequestManagerPrueba.java
│ │ ├── RemoteAutomaticPCC.java
│ │ ├── RemoteAutomaticPCCLauncher.java
│ │ ├── RemoteLSPInitPCEPSession.java
│ │ └── RemoteLSPInitPCEPSessionServer.java
│ ├── ipnms
│ ├── datamodel
│ │ ├── misc
│ │ │ ├── Address.java
│ │ │ ├── AuthInfo.java
│ │ │ ├── IPAddressUtils.java
│ │ │ └── package-info.java
│ │ ├── router
│ │ │ ├── GRETunnel
│ │ │ │ └── GRETunnelDesc.java
│ │ │ ├── IPinterface
│ │ │ │ ├── IPInterfaceConfig.java
│ │ │ │ └── IPInterfaceDesc.java
│ │ │ ├── LabelSwitchedPath
│ │ │ │ ├── LabelSwitchedPath.java
│ │ │ │ ├── LabelSwitchedPathProperties.java
│ │ │ │ └── LabelSwitchedPathWithUnnumIf.java
│ │ │ ├── RouterDesc.java
│ │ │ └── routing
│ │ │ │ ├── StaticRouteDesc.java
│ │ │ │ ├── acl
│ │ │ │ ├── ACLDesc.java
│ │ │ │ └── ForwardingRuleDesc.java
│ │ │ │ └── routingprotocol
│ │ │ │ └── RProtocolDesc.java
│ │ └── utils
│ │ │ └── IPSubnetUtils.java
│ └── wsimpl
│ │ ├── IPnmsWs.java
│ │ └── impl
│ │ ├── IPnmsALUCliImpl.java
│ │ ├── IPnmsCiscoCliImpl.java
│ │ ├── IPnmsJuniperCliImpl.java
│ │ ├── IdaTelnetClientPrueba.java
│ │ ├── JuniperNetconfImpl.java
│ │ └── JuniperOFImpl.java
│ ├── netManager
│ ├── NetworkLSPManager.java
│ ├── NetworkLSPManagerParameters.java
│ ├── NetworkLSPManagerTypes.java
│ ├── OSPFSender.java
│ ├── TCPOSPFSender.java
│ ├── emulated
│ │ ├── AdvancedEmulatedNetworkLSPManager.java
│ │ ├── CompletedEmulatedNetworkLSPManager.java
│ │ ├── DummyEmulatedNetworkLSPManager.java
│ │ ├── EmulatedUniNetworkLSPManager.java
│ │ ├── LayerTypes.java
│ │ └── SimpleEmulatedNetworkLSPManager.java
│ └── uni
│ │ ├── ChangeIPRoute.java
│ │ ├── CreateLSP.java
│ │ ├── DeleteLSP.java
│ │ ├── DispatcherObjects.java
│ │ ├── NoIPNMSDispatcher.java
│ │ └── UniNetworkLSPManager.java
│ ├── pce
│ └── client
│ │ ├── emulator
│ │ ├── AutomaticTesterStatistics.java
│ │ ├── Emulator.java
│ │ ├── PrintStatistics.java
│ │ └── TestClient_NetEmulated.java
│ │ ├── management
│ │ ├── AutomaticTesterManagementSession.java
│ │ ├── AutomaticTesterManagementSever.java
│ │ └── StopManagement.java
│ │ ├── multiDomain
│ │ ├── AutomaticTesterSpainNetwork.java
│ │ ├── AutomaticTesterSpainNetworkTask.java
│ │ └── CreateSpainNetwork.java
│ │ ├── multiLayer
│ │ ├── AutomaticExponentialTesterMLNetworkTask.java
│ │ ├── AutomaticTesterMLNetwork.java
│ │ ├── AutomaticTesterMLNetworkRandomTask.java
│ │ ├── AutomaticTesterMLNetworkTask.java
│ │ └── RealiseMLCapacityTask.java
│ │ └── tester
│ │ ├── Activity.java
│ │ ├── AutomaticClient.java
│ │ ├── AutomaticClientTask.java
│ │ ├── AutomaticTesterNetworkTask.java
│ │ ├── ClientSendTopology.java
│ │ ├── ClientSendTopologyConfiguration.java
│ │ ├── DummyActivity.java
│ │ ├── InformationRequest.java
│ │ ├── LSPConfirmationDispatcher.java
│ │ ├── LSPConfirmationProcessorThread.java
│ │ ├── NetworkEmulatorActivity.java
│ │ ├── PCCPCEPSessionParameters.java
│ │ ├── RealiseCapacityTask.java
│ │ ├── RealiseControlPlaneCapacityTask.java
│ │ ├── RealiseMLCapacityTask.java
│ │ ├── RequestParametersConfiguration.java
│ │ ├── RequestToSend.java
│ │ ├── SendTopologyClientTask.java
│ │ ├── StatefulPCEPSession.java
│ │ ├── StatefulSession.java
│ │ ├── VNTMActivity.java
│ │ ├── restoration
│ │ ├── DisconnectingLinkTask.java
│ │ ├── RestorationCaseClient.java
│ │ ├── RestorationCaseInformation.java
│ │ ├── RestorationCaseParameters.java
│ │ ├── RestorationCaseStatistics.java
│ │ ├── RestorationCaseTable.java
│ │ └── SendRequestRestorationCase.java
│ │ └── singleClient.java
│ ├── provisioningManager
│ └── objects
│ │ └── openflow
│ │ ├── PushFlowController.java
│ │ ├── PushFlowFloodlight.java
│ │ ├── PushFlowODL.java
│ │ ├── PushFlowRYU.java
│ │ └── StaticFlow.java
│ ├── test
│ ├── InterfaceDisable.java
│ ├── PCEClient.java
│ ├── ReactivateInterface.java
│ ├── RestartInterfaces.java
│ └── TestRawSocket.java
│ └── vntm
│ ├── LSP.java
│ ├── LSPManager.java
│ ├── LigthPathCreateIP.java
│ ├── LigthPathManagement.java
│ ├── OpTable.java
│ ├── VNTMParameters.java
│ ├── VNTMServer.java
│ ├── VNTMSession.java
│ ├── client
│ ├── VNTMClient.java
│ └── VNTMClientSession.java
│ ├── emulator
│ ├── OSPFSender.java
│ └── TCPOSPFSender.java
│ ├── management
│ ├── VNTMManagementSession.java
│ └── VNTMManagementSever.java
│ └── topology
│ ├── VNTMGraph.java
│ ├── elements
│ ├── Bandwidth.java
│ ├── BgpParams.java
│ ├── EndPoint.java
│ ├── IPNodeParams.java
│ ├── Intf.java
│ ├── IsisParams.java
│ ├── Link.java
│ ├── Location.java
│ ├── Node.java
│ ├── OspfParams.java
│ ├── Path.java
│ ├── PhyLinkParams.java
│ ├── Service.java
│ └── StaticRoutingParams.java
│ └── interlayerTopology.xml
└── sample-config-files
├── defaultConfiguration.properties
├── example1_Triangle_SSON
├── Node1
│ ├── defaultConfiguration.properties
│ ├── killRoadm.sh
│ ├── log4j2.xml
│ ├── roadm.sh
│ └── topologia.xml
├── Node2
│ ├── defaultConfiguration.properties
│ ├── log4j2.xml
│ ├── roadm.sh
│ └── topologia.xml
├── Node3
│ ├── defaultConfiguration.properties
│ ├── log4j2.xml
│ ├── roadm.sh
│ └── topologia.xml
└── PCE
│ ├── PCEServerConfiguration_SSON.xml
│ └── log4j2.xml
├── log4j2.xml
└── topologia-1.xml
/.gitignore:
--------------------------------------------------------------------------------
1 | # Directories #
2 | /build/
3 | /bin/
4 | target/
5 |
6 | *.class
7 |
8 | # Package Files #
9 | *.jar
10 | *.war
11 | *.ear
12 | *.db
13 | *.log
14 | *.log.*
15 |
16 | ######################
17 | # Windows
18 | ######################
19 | # Windows image file caches
20 | Thumbs.db
21 | # Folder config file
22 | Desktop.ini
23 |
24 | ######################
25 | # OSX
26 | ######################
27 | .DS_Store
28 | .svn
29 |
30 | # Thumbnails
31 | ._*
32 | # Files that might appear on external disk
33 | .Spotlight-V100
34 | .Trashes
35 |
36 | ######################
37 | # Eclipse
38 | ######################
39 | *.pydevproject
40 | .project
41 | .metadata
42 | bin/**
43 | tmp/**
44 | tmp/**/*
45 | *.tmp
46 | *.bak
47 | *.swp
48 | *~.nib
49 | local.properties
50 | .classpath
51 | .settings/
52 | .loadpath
53 | /src/main/resources/rebel.xml
54 | # External tool builders
55 | .externalToolBuilders/
56 | # Locally stored "Eclipse launch configurations"
57 | *.launch
58 | # CDT-specific
59 | .cproject
60 | # PDT-specific
61 | .buildpath
62 |
63 |
64 |
65 | # Created by https://www.gitignore.io/api/intellij,intellij+iml
66 |
67 | ### Intellij ###
68 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
69 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
70 |
71 | # User-specific stuff:
72 | .idea/workspace.xml
73 | .idea/tasks.xml
74 |
75 | # Sensitive or high-churn files:
76 | .idea/dataSources/
77 | .idea/dataSources.ids
78 | .idea/dataSources.xml
79 | .idea/dataSources.local.xml
80 | .idea/sqlDataSources.xml
81 | .idea/dynamic.xml
82 | .idea/uiDesigner.xml
83 |
84 | # Gradle:
85 | .idea/gradle.xml
86 | .idea/libraries
87 |
88 | # Mongo Explorer plugin:
89 | .idea/mongoSettings.xml
90 |
91 | ## File-based project format:
92 | *.iws
93 |
94 | ## Plugin-specific files:
95 |
96 | # IntelliJ
97 | /out/
98 |
99 | # mpeltonen/sbt-idea plugin
100 | .idea_modules/
101 |
102 | # JIRA plugin
103 | atlassian-ide-plugin.xml
104 |
105 | # Crashlytics plugin (for Android Studio and IntelliJ)
106 | com_crashlytics_export_strings.xml
107 | crashlytics.properties
108 | crashlytics-build.properties
109 | fabric.properties
110 |
111 | ### Intellij Patch ###
112 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
113 |
114 | # *.iml
115 | # modules.xml
116 | # .idea/misc.xml
117 | # *.ipr
118 |
119 |
120 | ### Intellij+iml ###
121 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
122 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
123 |
124 | # User-specific stuff:
125 |
126 | # Sensitive or high-churn files:
127 |
128 | # Gradle:
129 |
130 | # Mongo Explorer plugin:
131 |
132 | ## File-based project format:
133 |
134 | ## Plugin-specific files:
135 |
136 | # IntelliJ
137 |
138 | # mpeltonen/sbt-idea plugin
139 |
140 | # JIRA plugin
141 |
142 | # Crashlytics plugin (for Android Studio and IntelliJ)
143 |
144 | ### Intellij+iml Patch ###
145 | # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023
146 |
147 | *.iml
148 | modules.xml
149 | .idea/misc.xml
150 | *.ipr
151 | .idea/markdown-navigator/profiles_settings.xml
152 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | cne-emulator
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 | org.eclipse.wst.common.project.facet.core.builder
15 |
16 |
17 |
18 |
19 | org.eclipse.m2e.core.maven2Builder
20 |
21 |
22 |
23 |
24 |
25 | org.eclipse.jdt.core.javanature
26 | org.eclipse.m2e.core.maven2Nature
27 | org.eclipse.wst.common.project.facet.core.nature
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: java
2 | jdk:
3 | - oraclejdk7
4 | - oraclejdk8
5 | script:
6 | - mvn install -X -f ./pom.xml
7 | - mvn org.apache.maven.plugins:maven-javadoc-plugin:2.9.1:jar
8 |
--------------------------------------------------------------------------------
/CHANGELOG:
--------------------------------------------------------------------------------
1 | v1.3.3
2 | - Uploaded to Maven Central
3 | - Example of use added.
4 | - Profile to buid autojar for Transport Node Emulator added
5 | - Updated to work with netphony-network-protocols, netphony-topology and netphony PCE 1.3.3
6 | - License in now Apache 2.0
7 | v1.3.2
8 | - Updated to work with netphony-network-protocols, netphony-topology and netphony PCE 1.3.2
9 | - Added maven profiles
10 | - Updated reference to es.tid.rocksaw library
11 | - Moved all to es.tid package
12 | v1.2
13 | - Fixed maven support
14 | - Works with network protocols 1.2.1 and netphony-topology 1.2.1
15 | v1.1.1
16 | - Added maven support and adaptation to other netphony libraries
17 | v1.0.0
18 | - Initial version
19 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | netphony-gmpls-emulator v1.3.3
2 | ===================
3 | Repository branch build status:
4 |
5 | | **Master** | **Develop** |
6 | |:---:|:---:|
7 | | [](https://travis-ci.org/telefonicaid/netphony-gmpls-emulator) | [](https://travis-ci.org/telefonicaid/netphony-gmpls-emulator) |
8 |
9 | Latest Maven Central Release:
10 |
11 | [](https://maven-badges.herokuapp.com/maven-central/es.tid.netphony/network-emulator/)
12 |
13 | This software is a Java Based emulator of a Transport Network. It is based on the emulator of a Transport Node, which can have L1 (OTN) and L0 (fixed grid or flexi-grid DWDM) equipment, that runs a GMPLS based control plane. In particular, it has a OSPF-TE daemon that sends/receives OSPF-TE packets and a RSVP-TE daemon to set-up LSPs. It maintains a PCEP connection with a domain PCE. If used in stateless mode, the PCEP connection is used for path queries. If used in stateful mode, the PCEP connection can be used for remote initiation of LSPs.
14 |
15 | For more information and examples, see [Netphony GMPLS Emulator Wiki](https://github.com/telefonicaid/netphony-gmpls-emulator/wiki)
16 | ## Compilation and use
17 |
18 | The software can be built using the maven tool.
19 | To build the .jar file and run the tests, clone the repository, go to the main directory and run:
20 | ```bash
21 | git clone https://github.com/telefonicaid/netphony-gmpls-emulator.git
22 | cd netphony-gmpls-emulator
23 | mvn install
24 | ```
25 | To use the library in your application, add the dependency in your pom.xml file:
26 | ```xml
27 |
28 | es.tid.netphony
29 | network-emulator
30 | 1.3.3
31 |
32 | ```
33 | Authors keep also a copy of the artifact in maven central to facilitate the deployment.
34 | Note that, in the develop branch is maintained only in snapshots.
35 |
36 | ##Transport Node Emulator
37 |
38 | NodeLauncher is the main class to run a GMPLS Node emulator. It represents a Transport Node with GMPLS capabilities (e.g. an OTN node or a ROADM). It launches the OSPF-TE, RSVP-TE and PCEP necessary connectiosn.
39 |
40 | To run the Transport Node Emulator as a standalone application use the class NodeLauncher. You can use maven to create an autoexecutable jar that includes all dependencies in a single file. Plase be aware that you need to start as root.
41 | ```bash
42 | git clone https://github.com/telefonicaid/netphony-gmpls-emulator.git
43 | cd netphony-gmpls-emulator
44 | mvn clean package -P generate-autojar
45 | cd target
46 | sudo java -jar Emulator-jar-with-dependencies.jar
47 | ```
48 |
49 | Before running, you should configure the parameteres. The parameters are configured in an xml file. By default, if used with NodeLauncher, or it is not specified a file name, XXX.xml should be used. An example of the file is located in examples/xxx.xml (and with the maven assembly build, it is copied in the target directory).
50 |
51 |
--------------------------------------------------------------------------------
/VERSION:
--------------------------------------------------------------------------------
1 | 1.3.3
2 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/FastPCEPSessionServer.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node;
2 |
3 | import java.net.Inet4Address;
4 | import java.net.ServerSocket;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | import es.tid.emulator.node.transport.lsp.LSPManager;
9 | import es.tid.pce.client.emulator.AutomaticTesterStatistics;
10 |
11 | public class FastPCEPSessionServer extends Thread {
12 |
13 | private Logger log;
14 | private Inet4Address idRoadm;
15 | private LSPManager lspManager;
16 | private int nodeTechnology;
17 | private AutomaticTesterStatistics stats;
18 |
19 | public FastPCEPSessionServer(LSPManager lspManager, Inet4Address idRoadm, int nodeTechnology)
20 | {
21 | log=LoggerFactory.getLogger("ROADM");
22 | this.idRoadm=idRoadm;
23 | this.lspManager=lspManager;
24 | this.nodeTechnology=nodeTechnology;
25 | }
26 |
27 | public void run(){
28 | ServerSocket serverSocket = null;
29 | boolean listening=true;
30 | try {
31 | log.info("Listening Fast PCEP on port 2222 ooohhh");
32 | serverSocket = new ServerSocket(2222);
33 | }
34 | catch (Exception e){
35 | log.error("Could not listen fast PCEP on port 222");
36 | e.printStackTrace();
37 | return;
38 | }
39 | try {
40 | while (listening) {
41 | log.info("Waiting for connection Fast PCEP");
42 | new FastPCEPSession(serverSocket.accept(), lspManager, idRoadm, nodeTechnology,stats).start();
43 | }
44 | serverSocket.close();
45 | } catch (Exception e) {
46 | e.printStackTrace();
47 | }
48 | log.info("Ending Fast PCEP Session!!");
49 | }
50 |
51 | public AutomaticTesterStatistics getStats() {
52 | return stats;
53 | }
54 |
55 | public void setStats(AutomaticTesterStatistics stats) {
56 | this.stats = stats;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/NodeLauncher.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package es.tid.emulator.node;
6 |
7 | /**
8 | * MAIN ROADM: Launches the ROADM
9 | */
10 |
11 | public class NodeLauncher {
12 |
13 | /**
14 | * @param args the command line arguments
15 | */
16 | public static void main(String[] args) {
17 | NetworkNode r = new NetworkNode();
18 | r.setConfig(args);
19 | r.startNode();
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/RemoteLSPInitPCEPSessionServer.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node;
2 |
3 | import java.net.Inet4Address;
4 | import java.net.ServerSocket;
5 | import org.slf4j.Logger;
6 | import org.slf4j.LoggerFactory;
7 |
8 | import es.tid.emulator.node.transport.lsp.LSPManager;
9 | import es.tid.pce.client.emulator.AutomaticTesterStatistics;
10 | import es.tid.pce.pcepsession.PCEPSessionsInformation;
11 |
12 | public class RemoteLSPInitPCEPSessionServer implements Runnable {
13 |
14 | private Logger log;
15 | private Inet4Address idRoadm;
16 | private LSPManager lspManager;
17 | private int nodeTechnology;
18 | private AutomaticTesterStatistics stats;
19 | private boolean isStateful;
20 |
21 | public RemoteLSPInitPCEPSessionServer(LSPManager lspManager, Inet4Address idRoadm, int nodeTechnology, boolean isStateful)
22 | {
23 | log=LoggerFactory.getLogger("ROADM");
24 | this.idRoadm=idRoadm;
25 | this.lspManager=lspManager;
26 | this.nodeTechnology=nodeTechnology;
27 | this.isStateful = isStateful;
28 | }
29 |
30 | @Override
31 | public void run() {
32 | ServerSocket serverSocket = null;
33 | boolean listening=true;
34 | try {
35 | log.info("Listening PCEP on port 4189");
36 | serverSocket = new ServerSocket(4189);
37 | }
38 | catch (Exception e){
39 | log.error("Could not listen fast PCEP on port 4189");
40 | e.printStackTrace();
41 | return;
42 | }
43 | try {
44 | while (listening) {
45 | //Socket s, LSPManager lspManager, Inet4Address idRoadm, PCEPSessionsInformation pcepSessionManager)
46 | log.info("New PCEP Session Open with Client!");
47 | PCEPSessionsInformation pceSessionInf = new PCEPSessionsInformation();
48 | pceSessionInf.setStateful(isStateful);
49 | log.info("Session is stateful ? :"+ isStateful);
50 | new RemoteLSPInitPCEPSession(serverSocket.accept(), lspManager, idRoadm, pceSessionInf).start();
51 | }
52 | serverSocket.close();
53 | } catch (Exception e) {
54 | e.printStackTrace();
55 | }
56 |
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/management/NodeManagementSever.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.management;
2 |
3 | import java.net.ServerSocket;
4 | import org.slf4j.Logger;
5 | import org.slf4j.LoggerFactory;
6 |
7 | import es.tid.emulator.node.NetworkNode;
8 |
9 | public class NodeManagementSever extends Thread {
10 |
11 | private Logger log;
12 | private NetworkNode node;
13 |
14 |
15 | public NodeManagementSever(NetworkNode node){
16 | log =LoggerFactory.getLogger("PCEServer");
17 | this.node=node;
18 | }
19 |
20 | @Override
21 | public void run(){
22 | ServerSocket serverSocket = null;
23 | boolean listening=true;
24 | try {
25 | log.info("Listening on port 6666");
26 | serverSocket = new ServerSocket(6666);
27 | }
28 | catch (Exception e){
29 | log.error("Could not listen management on port 6666");
30 | e.printStackTrace();
31 | return;
32 | }
33 | try {
34 | while (listening) {
35 | new NodeManagementSession(serverSocket.accept(), node).start();
36 | }
37 | serverSocket.close();
38 | } catch (Exception e) {
39 | e.printStackTrace();
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/resources/Resource.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.resources;
2 |
3 | /**
4 | *
5 | * Class to include the needed information to check, reserve or free a network resource
6 | *
7 | * @author Fernando Mu�oz del Nuevo
8 | *
9 | * FIXME: A�adir la informaci�n necesaria para tocar los recursos
10 | *
11 | */
12 |
13 | public class Resource {
14 |
15 | private String resourceName;
16 |
17 | public String getResourceName() {
18 | return resourceName;
19 | }
20 |
21 | public void setResourceName(String resourceName) {
22 | this.resourceName = resourceName;
23 | }
24 |
25 |
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/resources/ResourceManager.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.resources;
2 |
3 | import java.net.Inet4Address;
4 | import java.util.Hashtable;
5 |
6 | import es.tid.emulator.node.transport.lsp.LSPKey;
7 | import es.tid.emulator.node.transport.lsp.te.LSPTE;
8 | import es.tid.pce.pcep.messages.PCEPRequest;
9 | import es.tid.rsvp.messages.RSVPPathTearMessage;
10 | import es.tid.rsvp.messages.te.RSVPTEPathMessage;
11 | import es.tid.rsvp.messages.te.RSVPTEResvMessage;
12 |
13 |
14 | public interface ResourceManager {
15 |
16 | public boolean checkResources(LSPTE lsp);
17 |
18 | public boolean reserveResources(LSPTE lsp, Inet4Address dstNodeLink);
19 |
20 |
21 | public boolean freeResources(LSPTE lsp);
22 |
23 | public PCEPRequest getPCEPRequest(LSPTE lspInfo);
24 |
25 | //public boolean checkLocalResources(LSPTE lspInfo);
26 |
27 | public RSVPTEPathMessage getRSVPTEPathMessageFromPCEPResponse(LSPTE lsp);
28 | public RSVPPathTearMessage getRSVPPathTearMessage(LSPTE lsp);
29 | public RSVPTEResvMessage getRSVPResvMessageFromDestination(RSVPTEPathMessage path, LSPTE lsp);
30 | public RSVPTEPathMessage forwardRSVPpath(LSPTE lsp,RSVPTEPathMessage path);
31 |
32 | public Hashtable getProxHopIPv4List();
33 |
34 | public void setProxHopIPv4List(Hashtable proxHopIPv4List);
35 |
36 | public Hashtable getPreviousHopIPv4List();
37 |
38 | public void setPreviousHopIPv4List(Hashtable previousHopIPv4List);
39 | }
40 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/resources/mpls/MPLSResourceManager.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.resources.mpls;
2 |
3 | import java.net.Inet4Address;
4 | import java.util.Hashtable;
5 |
6 | import es.tid.emulator.node.resources.ResourceManager;
7 | import es.tid.emulator.node.tedb.SimpleLocalTEDB;
8 | import es.tid.emulator.node.transport.lsp.LSPKey;
9 | import es.tid.emulator.node.transport.lsp.te.LSPTE;
10 | import es.tid.pce.pcep.messages.PCEPRequest;
11 | import es.tid.rsvp.messages.RSVPPathTearMessage;
12 | import es.tid.rsvp.messages.te.RSVPTEPathMessage;
13 | import es.tid.rsvp.messages.te.RSVPTEResvMessage;
14 | import es.tid.tedb.MDTEDB;
15 |
16 | /**
17 | *
18 | * Class implementing an MPLS resource manager
19 | *
20 | * @author Fernando Mu�oz del Nuevo
21 | *
22 | */
23 |
24 | public class MPLSResourceManager implements ResourceManager{
25 |
26 | private SimpleLocalTEDB ted;
27 | private Inet4Address localID;
28 |
29 | public MPLSResourceManager(SimpleLocalTEDB tedb, Inet4Address localID){
30 | this.ted=tedb;
31 | this.localID=localID;
32 | }
33 |
34 | public MPLSResourceManager(SimpleLocalTEDB tedb, Inet4Address localID, MDTEDB MDted){
35 | this.ted=tedb;
36 | this.localID=localID;
37 | }
38 |
39 | @Override
40 | public boolean checkResources(LSPTE lsp) {
41 |
42 | return false;
43 | }
44 |
45 | @Override
46 | public PCEPRequest getPCEPRequest(LSPTE lspInfo) {
47 |
48 | return null;
49 | }
50 |
51 | @Override
52 | public RSVPTEPathMessage forwardRSVPpath(LSPTE lsp, RSVPTEPathMessage path) {
53 | // TODO Auto-generated method stub
54 | return null;
55 | }
56 |
57 | @Override
58 | public boolean freeResources(LSPTE lsp) {
59 | // TODO Auto-generated method stub
60 | return false;
61 | }
62 |
63 |
64 | @Override
65 | public Hashtable getPreviousHopIPv4List() {
66 | // TODO Auto-generated method stub
67 | return null;
68 | }
69 |
70 | @Override
71 | public Hashtable getProxHopIPv4List() {
72 | // TODO Auto-generated method stub
73 | return null;
74 | }
75 |
76 | @Override
77 | public RSVPPathTearMessage getRSVPPathTearMessage(LSPTE lsp) {
78 | // TODO Auto-generated method stub
79 | return null;
80 | }
81 |
82 | @Override
83 | public RSVPTEResvMessage getRSVPResvMessageFromDestination(RSVPTEPathMessage path,
84 | LSPTE lsp) {
85 | // TODO Auto-generated method stub
86 | return null;
87 | }
88 |
89 | @Override
90 | public boolean reserveResources(LSPTE lsp, Inet4Address dstNodeLink) {
91 | // TODO Auto-generated method stub
92 | return false;
93 | }
94 |
95 | @Override
96 | public RSVPTEPathMessage getRSVPTEPathMessageFromPCEPResponse(LSPTE lsp) {
97 | // TODO Auto-generated method stub
98 | return null;
99 | }
100 |
101 | @Override
102 | public void setProxHopIPv4List(
103 | Hashtable proxHopIPv4List) {
104 | // TODO Auto-generated method stub
105 |
106 | }
107 |
108 | @Override
109 | public void setPreviousHopIPv4List(
110 | Hashtable previousHopIPv4List) {
111 | // TODO Auto-generated method stub
112 |
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/topology/HandlerTestMain.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.topology;
2 |
3 | import java.util.concurrent.LinkedBlockingQueue;
4 |
5 | import es.tid.netManager.TCPOSPFSender;
6 | import es.tid.ospf.ospfv2.OSPFv2LinkStateUpdatePacket;
7 |
8 |
9 | public class HandlerTestMain {
10 |
11 | /**
12 | * @param args
13 | */
14 | public static void main(String[] args) {
15 | // TODO Auto-generated method stub
16 | ParametersPrueba params= new ParametersPrueba();
17 | params.initialize("parametersPrueba.xml");
18 | Handler handler = new Handler();
19 | handler.XMLRead(params.getNetworkFile());
20 | LinkedBlockingQueue sendingQueue;
21 | TCPOSPFSender TCPOSPFsender = new TCPOSPFSender(params.getPCETEDBAddressList(),params.getOSPF_TCP_PORTList());
22 | TCPOSPFsender.start();
23 | sendingQueue=TCPOSPFsender.getSendingQueue();
24 | handler.sendTopology(sendingQueue);
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/Errors.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | public class Errors {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/ForwardingTable.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | import java.io.FileInputStream;
4 | import java.io.IOException;
5 | import java.net.Inet4Address;
6 | import java.net.InetAddress;
7 | import java.util.Properties;
8 |
9 | import es.tid.emulator.node.NetworkNode;
10 |
11 | /**
12 | * Forwarding Table Class
13 | * Implements methods to get the next hop to reach a destination node
14 | * @author fmn
15 | *
16 | */
17 |
18 | public class ForwardingTable {
19 |
20 | private NetworkNode roadm;
21 |
22 | public ForwardingTable(NetworkNode roadm){
23 |
24 | this.roadm = roadm;
25 | }
26 | public static Inet4Address getNextHop(Inet4Address destinationAddress){
27 | Properties props = new Properties();
28 | try{
29 | props.load(new FileInputStream("defaultConfiguration.properties"));
30 | String nextHop = props.getProperty("nextHop");
31 | try{
32 | Inet4Address addr = (Inet4Address) InetAddress.getByName(nextHop);
33 | return addr;
34 | }catch(Exception e){
35 | return null;
36 | }
37 | }catch(IOException e){
38 | // FIXME: Meter mensaje de error
39 | return null;
40 | }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/Interfaz.java:
--------------------------------------------------------------------------------
1 | /*
2 | * To change this template, choose Tools | Templates
3 | * and open the template in the editor.
4 | */
5 | package es.tid.emulator.node.transport;
6 | /**
7 | * Interfaz Class will represent the information that the ROADM needs to know about its own interfaces
8 | * in order to be able of connecting itself with other nodes.
9 | *
10 | * The main information to be stored about every Interfaz will be the following:
11 | *
12 | * 1.- Interfaz ID: FIXME: IP? No numerada? habr� que verlo
13 | * 2.- Grid: The transmission bandwidth over a single channel FIXME: RFCs
14 | * 3.- Channel Number: Number of channels that can be used per interface FIXME: RFCs
15 | * 4.- Channels: The status of every channel (occupied, free, reserved... ) FIXME: Decidirlo
16 | *
17 | * @author fmn
18 | */
19 | public class Interfaz {
20 |
21 | private int idInterfaz;
22 | private int grid;
23 | private int channelNumber;
24 | private int[] channels;
25 |
26 | /**
27 | *
28 | * Default constructor
29 | * Creates an Interfaz with id = 0, grid = 0, channelNumber = 0 and creates
30 | * an empty channel array.
31 | *
32 | */
33 |
34 | public Interfaz(){
35 |
36 | idInterfaz = 0;
37 | grid = 0;
38 | channelNumber = 0;
39 |
40 | }
41 |
42 | /**
43 | * Constructor with parameters to fill idInterfaz, grid and channel number
44 | * attributes. It also initalizes the channel array to channelNumber size
45 | * with all channels free (0 value)
46 | * @param idInterfaz
47 | * @param grid
48 | * @param channelNumber
49 | */
50 |
51 | public Interfaz(int idInterfaz, int grid, int channelNumber){
52 |
53 | this.idInterfaz = idInterfaz;
54 | this.grid = grid;
55 | this.channelNumber = channelNumber;
56 | this.channels = new int[channelNumber];
57 |
58 | }
59 |
60 | /**
61 | * @return idInterfaz parameter
62 | */
63 |
64 | public int getIdIntefaz(){
65 |
66 | return idInterfaz;
67 |
68 | }
69 |
70 | /**
71 | *
72 | * @return grid parameter
73 | */
74 |
75 | public int getGrid(){
76 |
77 | return grid;
78 |
79 | }
80 |
81 | /**
82 | * Method to extract channelNumber attribute
83 | * @return channelNumber
84 | */
85 |
86 | public int getChannelNumber(){
87 |
88 | return channelNumber;
89 |
90 | }
91 |
92 | /**
93 | * This method returns the channels status with the following legend:
94 | * 0 --> Free
95 | * 1 --> Used
96 | * 2 --> Down
97 | * 3 --> Admin Down
98 | * @return The array containing the channels status
99 | */
100 |
101 | public int[] getChannels(){
102 |
103 | return channels;
104 |
105 | }
106 |
107 | /**
108 | *
109 | * @param idInterfaz to fill idInterfaz attribute
110 | */
111 |
112 | public void setIdInterfaz(int idInterfaz){
113 |
114 | this.idInterfaz = idInterfaz;
115 |
116 | }
117 |
118 | /**
119 | *
120 | * @param grid to fill grid attribute
121 | */
122 |
123 | public void setGrid(int grid){
124 |
125 | this.grid = grid;
126 |
127 | }
128 |
129 | /**
130 | * Method to set the value of channelNumber attribute
131 | * @param channelNumber The number of channels to be set
132 | */
133 |
134 | public void setChannelNumber(int channelNumber){
135 |
136 | this.channelNumber = channelNumber;
137 |
138 | }
139 |
140 | }
141 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/LSPCreationException.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | public class LSPCreationException extends Exception {
4 | private static final long serialVersionUID = 0;
5 | private int errorType;
6 | private long lspID;
7 |
8 |
9 | public LSPCreationException(String msg){
10 | super(msg);
11 | }
12 | public LSPCreationException(int errorType){
13 | this.errorType = errorType;
14 | }
15 | public int getErrorType() {
16 | return errorType;
17 | }
18 | public void setErrorType(int errorType) {
19 | this.errorType = errorType;
20 | }
21 | public long getLspID() {
22 | return lspID;
23 | }
24 | public void setLspID(long lspID) {
25 | this.lspID = lspID;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/LSPReservationException.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | public class LSPReservationException extends Exception {
4 | private static final long serialVersionUID = 0;
5 |
6 | public LSPReservationException(){
7 | super();
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/RequestedLSPinformation.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | import java.net.Inet4Address;
4 |
5 | public class RequestedLSPinformation {
6 | //toda la información de entrada para el lsp en la request
7 | private Inet4Address source;
8 |
9 | private Inet4Address destination;
10 |
11 | //exclude nodes
12 |
13 | //exclude links
14 |
15 | //include nodes
16 |
17 | //include links
18 |
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/RequestedLSPinformationMPLS.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | public class RequestedLSPinformationMPLS extends RequestedLSPinformation{
4 | //toda la información de entrada para el lsp en la request
5 | private long bandwidth;
6 | }
7 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/RequestedLSPinformationSSON.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | public class RequestedLSPinformationSSON extends RequestedLSPinformation{
4 | //toda la información de entrada para el lsp en la request
5 | private int suggestedN;
6 | private int suggestedM;
7 | private long bandwidth;
8 |
9 | public RequestedLSPinformationSSON (){
10 |
11 | }
12 |
13 | public int getSuggestedN() {
14 | return suggestedN;
15 | }
16 |
17 | public void setSuggestedN(int suggestedN) {
18 | this.suggestedN = suggestedN;
19 | }
20 |
21 | public int getSuggestedM() {
22 | return suggestedM;
23 | }
24 |
25 | public void setSuggestedM(int suggestedM) {
26 | this.suggestedM = suggestedM;
27 | }
28 |
29 | public long getBandwidth() {
30 | return bandwidth;
31 | }
32 |
33 | public void setBandwidth(long bandwidth) {
34 | this.bandwidth = bandwidth;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/RequestedLSPinformationWSON.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | public class RequestedLSPinformationWSON extends RequestedLSPinformation{
4 | //toda la información de entrada para el lsp en la request
5 | private int suggestedLambda;
6 |
7 | public RequestedLSPinformationWSON(){
8 |
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/src/main/java/es/tid/emulator/node/transport/defineLocalTEDB.java:
--------------------------------------------------------------------------------
1 | package es.tid.emulator.node.transport;
2 |
3 | import java.net.Inet4Address;
4 | import java.util.Iterator;
5 | import java.util.Set;
6 | import org.slf4j.Logger;
7 | import org.slf4j.LoggerFactory;
8 |
9 | import org.jgrapht.graph.DirectedWeightedMultigraph;
10 | import org.jgrapht.graph.SimpleDirectedWeightedGraph;
11 |
12 | import es.tid.tedb.InterDomainEdge;
13 | import es.tid.tedb.IntraDomainEdge;
14 |
15 | public class defineLocalTEDB {
16 | private static Logger log;
17 | // Podate Simple TEDB
18 | public static SimpleDirectedWeightedGraph