
es.tid.emulator.node.NetworkNode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of network-emulator Show documentation
Show all versions of network-emulator Show documentation
Emulator of GMPLS-controlled transport Network
The newest version!
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package es.tid.emulator.node;
import java.io.IOException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.jgrapht.graph.DirectedWeightedMultigraph;
import org.jgrapht.graph.SimpleDirectedWeightedGraph;
import es.tid.emulator.node.management.NodeManagementSever;
import es.tid.emulator.node.resources.ResourceManager;
import es.tid.emulator.node.resources.mpls.MPLSResourceManager;
import es.tid.emulator.node.resources.sson.SSONResourceManager;
import es.tid.emulator.node.resources.wson.WSONResourceManager;
import es.tid.emulator.node.tedb.SimpleLocalTEDB;
import es.tid.emulator.node.transport.PathComputationClient;
import es.tid.emulator.node.transport.defineLocalTEDB;
import es.tid.emulator.node.transport.lsp.LSPManager;
import es.tid.emulator.node.transport.lsp.te.TechnologyParameters;
import es.tid.emulator.node.transport.ospf.OSPFController;
import es.tid.emulator.node.transport.rsvp.RSVPManager;
import es.tid.pce.client.emulator.AutomaticTesterStatistics;
import es.tid.pce.server.lspdb.ReportDB_Redis;
import es.tid.tedb.DomainTEDB;
import es.tid.tedb.InterDomainEdge;
import es.tid.tedb.IntraDomainEdge;
import es.tid.tedb.MDTEDB;
import es.tid.tedb.SimpleTEDB;
import es.tid.tedb.TEDB;
/**
* This class represent a Reconfigurable Optical Add Drop Multiplexer Node. A ROADM is composed
* by different interfaces to interconnect itself with other ROADMs. It also is composed by
* different clients that come from IP nodes transport requirements. Internal interconnections
* such as client-interface(channel) and interface(channel) - interface(channel) are stored
* in the connections vector.
*
* As can be seen in the ROADM architecture scheme, FIXME:(Nombre archivo), dividing the ROADM
* in sub-blocks, there are 5 with different functionalities that are listed below:
*
* 1.- TED: The complete resources that the ROADM has, joint with its utilization, which means
* the complete LSP reservation implications.
* 2.- PCEPClient: The PCEPClient is in charge of communicate the ROADM with the domain PCE used to
* calculate the optimum path between two nodes.
* 3.- RSVPManager: Block that takes care of listening RSVP messages from the network, maintenance of
* RSVP sessions (LSP implications) and translating LSP petitions into the adequate
* RSVP message.
* 4.- LSPManager: The LSP Manager role is getting all the LSP that are born in the ROADM and the ones
* which it is one of the middle nodes, in order to be capable of taking actions to
* restore connectivity in case of failure or path re-optimization.
* 5.- UserInterface: Configuration & Operation module that will rule the ROADM behaviour.
*
* @author fmn
*/
public class NetworkNode {
//Properties of the Node (IP & technology)
/**
* Class with the spcecific information of the Node
*/
private NodeInformation nodeInformation;
//Components of the node (TEDB, RSVPManager, LSPManager, PathComputationClient, OSPFController, ResourceManager)
/**
* Domain TEDB: specific for each technology
*/
private DomainTEDB ted;
/**
* Multi Domain TEDB: specific for each technology in case we have interDomain Links
*/
private TEDB MDted;
/**
* Generic RSVP Manager
*/
private RSVPManager rsvpManager;
/**
* Generic LSP Manager
*/
private LSPManager managerLSP;
/**
* Module encharged of the PCEP Session
*/
private PathComputationClient PCC;
/**
* Controller for the OSPF Session messages with the PCE
*/
private OSPFController ospfController;
/**
* Specific resourceManager for each technology
*/
private ResourceManager resourceManager;
/**
* Management Module for the manual node configuration
*/
private NodeManagementSever nodeManagement;
/**
* Launches a fast PCEP Session Server to initiate
* and tear down LSPs remotely.
*/
private FastPCEPSessionServer fastPCEPSessionServer;
private RemoteLSPInitPCEPSessionServer rlsserver;
private boolean isStateful = true;
private boolean statefulDFlag =true;
private boolean statefulTFlag = true;
private boolean statefulSFlag = true;
private boolean dbTest = false;
private boolean isActive = true;
private boolean isSRCapable = true;
private int MSD = 47;
private Logger log, log2, log3, log4;
/**
*
* Default constructor. Initializes all attributes
*
*/
public NetworkNode(){
// Create the Logs
log = LoggerFactory.getLogger("ROADM");
log2 = LoggerFactory.getLogger("PCCClient");
log3 = LoggerFactory.getLogger("OSPFParser");
log4 = LoggerFactory.getLogger("PCEPParser");
log.error("ROADM Created");
log.info("ROADM created con info");
}
/**
* Class constructor with two parameters.
* config[0] Main node properties configuration file.
* config[1] Default node properties configuration file.
*/
public void setConfig(String[] config) {
// @// TODO: 05/12/2016 Implements this config method.
// Create information of te Node
if((config == null)||(config.length!=2)) {
nodeInformation = new NodeInformation();
} else {
nodeInformation = new NodeInformation(config[0], config[1]);
}
nodeInformation.readNodeConfiguration();
log3.info("Info: "+nodeInformation.toString());
if (nodeInformation.isRsvpMode()== true){
// Create the RSVP Manager
rsvpManager = new RSVPManager();
}
log3.info("Log de OSPF Creado!!");
// Creamos el LSP Manager
managerLSP = new LSPManager(isStateful);
//Create the PathComputationClient
PCC = new PathComputationClient();
//The Traffic Engineering Database
ted=new SimpleLocalTEDB();
if (nodeInformation.getNodeTechnology()==TechnologyParameters.SSON){
((SimpleLocalTEDB)ted).initializeFromFile(nodeInformation.getTopologyName(), null, false, 0, Integer.MAX_VALUE, true , false);
}else
((SimpleLocalTEDB)ted).initializeFromFile(nodeInformation.getTopologyName(), null, false, 0, Integer.MAX_VALUE, false , false);
// Create the Multi Domain TEDB
MDted = new MDTEDB();
// Initialice
((MDTEDB)MDted).initializeFromFileInterDomainLinks(nodeInformation.getTopologyName());
//TEDB CREADA --> recorrer grafo y podar
SimpleDirectedWeightedGraph
© 2015 - 2025 Weber Informatics LLC | Privacy Policy