public class WNet extends WAbstractNetworkElement
Modifier and Type | Method and Description |
---|---|
Pair<WFiber,WFiber> |
addFiber(WNode a,
WNode b,
List<Integer> validOpticalSlotRanges,
double lengthInKm,
boolean isBidirectional)
Adds a fiber to the design
|
Pair<WIpLink,WIpLink> |
addIpLink(WNode a,
WNode b,
double nominalLineRateGbps,
boolean isBidirectional)
Adds an IP link to the network
|
WLightpathRequest |
addLightpathRequest(WNode a,
WNode b,
double lineRateGbps,
boolean isToBe11Protected)
Adds a lightpath request to the design
|
WNode |
addNode(double xCoord,
double yCoord,
String name,
String type)
Adds a node to the design
|
void |
addOrUpdateUserService(WUserService info)
Adds or updates a user service to the defined repository of user services
|
void |
addOrUpdateVnfType(WVnfType info)
Adds a new VNF type to the network, with the provided information
|
WServiceChainRequest |
addServiceChainRequest(WNode userInjectionNode,
boolean isUpstream,
WUserService userService)
Adds a request for an upstream or downstream unidirectional service chain, for the given user service.
|
WVnfInstance |
addVnfInstance(WNode hostNode,
String name,
WVnfType type)
Adds an instance of the VNF of the given type, in the indicated host node, applying it the given name
|
static WNet |
createEmptyDesign()
Creates an empty design with no nodes, links etc.
|
List<WFiber> |
getFibers()
Returns the list of fibers, in increasing order according to its id
|
WLayerIp |
getIpLayer()
Returns the object identifying the IP layer
|
List<WIpLink> |
getIpLinks()
Returns the list of IP links, in increasing order according to its id
|
List<List<? extends WAbstractNetworkElement>> |
getKShortestServiceChainInIpLayer(int k,
WNode a,
WNode b,
List<String> sequenceOfVnfTypesToTraverse,
Optional<Map<WIpLink,Double>> optionalCostMapOrElseLatency,
Optional<Map<WVnfInstance,Double>> optionalVnfCostMapOrElseLatency)
Returns a ranking with the k-shortest paths for service chains, given the end nodes, and the sequence of types of VNFs that it should traverse.
|
List<List<WFiber>> |
getKShortestWdmPath(int k,
WNode a,
WNode b,
Optional<Map<WFiber,Double>> optionalCostMapOrElseLatency)
Returns a ranking with the k-shortest paths composed as a sequence of WFiber links in the network, given the origin and end nodes of the paths.
|
List<WLightpathRequest> |
getLightpathRequests()
Returns the list of lightpath requests, in increasing order according to its id
|
List<WLightpathUnregenerated> |
getLightpaths()
Returns the list of lightpaths, in increasing order according to its id
|
NetPlan |
getNe()
Returns the underlying Net2Plan object.
|
Optional<WNode> |
getNodeByName(String name)
Returns the network node with the indicated name, if any
|
List<WNode> |
getNodes()
Returns the list of network nodes, in increasing order according to its id
|
SortedSet<WNode> |
getNodesConnectedToCore()
Returns the nodes in the network that are supposed to have a connection to the network core (the core nodes and those connecting links are not part of the network)
|
List<WServiceChainRequest> |
getServiceChainRequests()
Returns the list of service chain requests, in increasing order according to its id
|
List<WServiceChain> |
getServiceChains()
Returns the list of service chains, in increasing order according to its id
|
SortedSet<String> |
getUserServiceNames()
Returns all the unique ids (names) of the user services defined
|
SortedMap<String,WUserService> |
getUserServicesInfo()
Returns the user service information defined, in a map with key the user service identifier, and value the user service object
|
SortedSet<WVnfInstance> |
getVnfInstances()
Returns a set with all the VNF instances in the network of any type
|
SortedSet<WVnfInstance> |
getVnfInstances(String type)
Returns a set with all the VNF instances in the network of the given type
|
Optional<WVnfType> |
getVnfType(String typeName)
Returns the WVnfType object assigned to that name, if any
|
SortedSet<String> |
getVnfTypeNames()
Returns the set of VNF type names defined
|
List<WVnfType> |
getVnfTypes()
Returns the map associating the VNF type, with the associated VNF object, as was defined by the user
|
WLayerWdm |
getWdmLayer()
Returns the object identifying the WDM layer
|
boolean |
isDeepCopy(WNet other)
Indicates if a network is an exact copy of other network in every aspect
|
static WNet |
loadFromFile(File f)
Creates a design, loading it from a file
|
void |
removeUserServiceInfo(String userServiceName)
Removes a user service definition from the internal repo
|
void |
removeVnfType(String vnfTypeName)
Removes a defined VNF type
|
void |
saveToFile(File f)
Saves this network in the given file
|
void |
setUserServicesInfo(SortedMap<String,WUserService> newInfo)
Sets a new user service id to info map, removing all previous user services defined
|
void |
setVnfTypesRemovingPreviousInfo(SortedSet<WVnfType> newInfo)
Sets a new VNF type map, removing all previous VNF types defined
|
String |
toString() |
compareTo, equals, getAsFiber, getAsIpLayer, getAsIpLink, getAsLightpathRequest, getAsLightpathUnregenerated, getAsNode, getAsServiceChain, getAsServiceChainRequest, getAsVnfInstance, getAsWdmLayer, getId, getNet, getNetPlan, isFiber, isLayerIp, isLayerWdm, isLightpathRequest, isLightpathUnregenerated, isNode, isServiceChain, isServiceChainRequest, isVnfInstance, isWIpLink, wasRemoved
public WNet(NetPlan np)
public Pair<WFiber,WFiber> addFiber(WNode a, WNode b, List<Integer> validOpticalSlotRanges, double lengthInKm, boolean isBidirectional)
a
- the origin nodeb
- the destination nodevalidOpticalSlotRanges
- the pairs (init slot , end slot) with the valid optical slot ranges for the fiberlengthInKm
- the user-defined length in km. If negative, the harversine distance is set for the link length, that considers node (x,y) coordinates a longitude-latitude pairsisBidirectional
- indicates if the fiber to add is bidirectionalpublic Pair<WIpLink,WIpLink> addIpLink(WNode a, WNode b, double nominalLineRateGbps, boolean isBidirectional)
a
- The IP link origin nodeb
- The IP lin kend nodenominalLineRateGbps
- The nominal line rate of the IP link in GbpsisBidirectional
- An indication if the IP link to add should be a pair of two unidirectional IP links in opposite directionspublic WLightpathRequest addLightpathRequest(WNode a, WNode b, double lineRateGbps, boolean isToBe11Protected)
a
- The origin node of the lightpath requestb
- The destination node of the lightpath requestlineRateGbps
- The nominal line rate in GbpsisToBe11Protected
- indicates if it is requested to have a 1+1 setting assigned to this lightpathpublic WNode addNode(double xCoord, double yCoord, String name, String type)
xCoord
- the x coordinateyCoord
- the y coordinatename
- the node name, that should be uniquetype
- the type of node: a user-defined stringpublic void addOrUpdateUserService(WUserService info)
info
- see abovepublic void addOrUpdateVnfType(WVnfType info)
info
- see abovepublic WServiceChainRequest addServiceChainRequest(WNode userInjectionNode, boolean isUpstream, WUserService userService)
userInjectionNode
- the node where the traffic starts (in upstream flows) or ends (in downstream flows)isUpstream
- if true, the flow is supposed to start in the injection node, if false, the flow is supposed to end in the injection nodeuserService
- the user service defining this service chain request.public WVnfInstance addVnfInstance(WNode hostNode, String name, WVnfType type)
hostNode
- see abovename
- see abovetype
- see abovepublic static WNet createEmptyDesign()
public List<WFiber> getFibers()
public WLayerIp getIpLayer()
public List<WIpLink> getIpLinks()
public List<List<? extends WAbstractNetworkElement>> getKShortestServiceChainInIpLayer(int k, WNode a, WNode b, List<String> sequenceOfVnfTypesToTraverse, Optional<Map<WIpLink,Double>> optionalCostMapOrElseLatency, Optional<Map<WVnfInstance,Double>> optionalVnfCostMapOrElseLatency)
k
- the maximum number of paths to return in the rankinga
- the origin nodeb
- the end nodesequenceOfVnfTypesToTraverse
- the sequence of VNF types to be traversed, in the given orderoptionalCostMapOrElseLatency
- an optional map of the cost to assign to traversing each IP link, if none, the cost is assumed to the IP link latencyoptionalVnfCostMapOrElseLatency
- an optional map of the cost to assign to traverse each VNF instance, if none, the cost is assumed to be the VNF instance processing timepublic List<List<WFiber>> getKShortestWdmPath(int k, WNode a, WNode b, Optional<Map<WFiber,Double>> optionalCostMapOrElseLatency)
k
- the maximum number of paths to return in the rankinga
- the origin nodeb
- the end nodeoptionalCostMapOrElseLatency
- an optional map of the cost to assign to traversing each WFiber link, if none, the cost is assumed to be the WFiber latencypublic List<WLightpathRequest> getLightpathRequests()
public List<WLightpathUnregenerated> getLightpaths()
public NetPlan getNe()
WAbstractNetworkElement
getNe
in class WAbstractNetworkElement
public Optional<WNode> getNodeByName(String name)
name
- see abovepublic List<WNode> getNodes()
public SortedSet<WNode> getNodesConnectedToCore()
public List<WServiceChainRequest> getServiceChainRequests()
public List<WServiceChain> getServiceChains()
public SortedSet<String> getUserServiceNames()
public SortedMap<String,WUserService> getUserServicesInfo()
public SortedSet<WVnfInstance> getVnfInstances()
public SortedSet<WVnfInstance> getVnfInstances(String type)
type
- see abovepublic Optional<WVnfType> getVnfType(String typeName)
typeName
- see abovepublic SortedSet<String> getVnfTypeNames()
public List<WVnfType> getVnfTypes()
public WLayerWdm getWdmLayer()
public boolean isDeepCopy(WNet other)
other
- see abovepublic static WNet loadFromFile(File f)
f
- see abovepublic void removeUserServiceInfo(String userServiceName)
userServiceName
- see abovepublic void removeVnfType(String vnfTypeName)
vnfTypeName
- see abovepublic void saveToFile(File f)
f
- see abovepublic void setUserServicesInfo(SortedMap<String,WUserService> newInfo)
newInfo
- see abovepublic void setVnfTypesRemovingPreviousInfo(SortedSet<WVnfType> newInfo)
newInfo
- see aboveCopyright © 2018. All rights reserved.