X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=renderer%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Frenderer%2Fopenroadminterface%2FOpenRoadmInterface710.java;h=ecbb6eb7525393b85de93ef622577fbdf799aa08;hb=6f0efa0400200632b9d240dc39ae10b97010abf7;hp=01ed89c376488eac4a901fedf5d3072c1a0381c0;hpb=0dfe16a3954b9c3e566f87f7b37e6df9bb757d5e;p=transportpce.git diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface710.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface710.java index 01ed89c37..ecbb6eb75 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface710.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterface710.java @@ -12,6 +12,7 @@ import java.math.BigDecimal; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.Optional; import java.util.stream.IntStream; import org.opendaylight.transportpce.common.StringConstants; @@ -224,8 +225,7 @@ public class OpenRoadmInterface710 { LOG.info("FOIC is 2.8 for 31.6 Gbaud and rate is 200"); // FOIC rate is different flexoBuilder.setFoicType(Foic28.class) - .setIid(new ArrayList<>(Arrays.asList(Uint8.valueOf(1), Uint8.valueOf(2), - Uint8.valueOf(3), Uint8.valueOf(4)))); + .setIid(new ArrayList<>(Arrays.asList(Uint8.valueOf(1), Uint8.valueOf(2)))); } else { // default is dp-qpsk for 200G under 63.1 GBaud flexoBuilder.setFoicType(Foic24.class) @@ -1091,45 +1091,41 @@ public class OpenRoadmInterface710 { justification = "call in call() method") private int getServiceRate(ModulationFormat modulationFormat, SpectrumInformation spectrumInformation) { - double spectralWidth = (spectrumInformation.getHigherSpectralSlotNumber() - - spectrumInformation.getLowerSpectralSlotNumber() + 1) * GridConstant.GRANULARITY; + int rate; switch (modulationFormat) { case DpQpsk: - // DpQpsk is possible for both 31.6 or 63.1 GBaud, for which spectral width is different - // Here take the difference of highest and lowest spectral numbers and determine the width - LOG.info("The width with guard band {}", spectralWidth); - if (spectralWidth == 50.0) { - // Based on roll-of-factor of 0.2, 50 - 12.5 = 37.5GHz translates to 31.6 GBaud - LOG.info("The baud-rate is 31.6 GBaud"); - LOG.info("Given modulation format {} with 31.6 Gbaud rate is 100G", modulationFormat); - return 100; - } else { - // Based on roll-of-factor of 0.2, 87.5 - 12.5 = 75GHz translates to 63.1 GBaud - LOG.info("The baud-rate is 63.1 GBaud"); - return 200; - } - case DpQam8: - LOG.info("Given modulation format is {} and thus rate is 300G", modulationFormat); - return 300; case DpQam16: - // DpQam16 is possible for both 31.6 or 63.1 GBaud, for which spectral width is different + // DpQpsk and DpQam16 are possible for both 31.6 or 63.1 GBaud, for which spectral width is different // Here take the difference of highest and lowest spectral numbers and determine the width + double spectralWidth = (spectrumInformation.getHigherSpectralSlotNumber() + - spectrumInformation.getLowerSpectralSlotNumber() + 1) * GridConstant.GRANULARITY; LOG.info("The width with guard band {}", spectralWidth); + Map rateMap; if (spectralWidth == 50.0) { + rateMap = Map.of( + ModulationFormat.DpQpsk , 100, + ModulationFormat.DpQam16 , 200); // Based on roll-of-factor of 0.2, 50 - 12.5 = 37.5GHz translates to 31.6 GBaud LOG.info("The baud-rate is 31.6 GBaud"); - LOG.info("Given modulation format {} with 31.6 Gbaud rate is 200G", modulationFormat); - return 200; + return rateMap.get(modulationFormat); } else { + rateMap = Map.of( + ModulationFormat.DpQpsk , 200, + ModulationFormat.DpQam16 , 400); // Based on roll-of-factor of 0.2, 87.5 - 12.5 = 75GHz translates to 63.1 GBaud LOG.info("The baud-rate is 63.1 GBaud"); - return 400; } + rate = rateMap.get(modulationFormat); + break; + case DpQam8: + rate = 300; + break; default: LOG.error("Modulation format is required to select the rate"); - break; + return 0; } - return 0; + LOG.info("Given modulation format {} rate is {}", modulationFormat, rate); + return rate; } }