fixed HO, xICIC timeout and Context Update
diff --git a/src/main/java/org.onosproject.xran/XranStore.java b/src/main/java/org.onosproject.xran/XranStore.java
index eb5dfc6..257e908 100644
--- a/src/main/java/org.onosproject.xran/XranStore.java
+++ b/src/main/java/org.onosproject.xran/XranStore.java
@@ -71,7 +71,7 @@
RnibCell getCell(ECGI cellId);
- void modifyCellRrmConf(RnibCell cell, JsonNode rrmConf);
+ void modifyCellRrmConf(RnibCell cell, JsonNode rrmConf) throws Exception;
void storeCell(RnibCell cell);
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
index c2164c3..7cd1606 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/RRMConfig.java
@@ -48,6 +48,28 @@
this.code = code;
}
+ public static XrancPdu constructPacket(RRMConfig config) {
+ XrancPduBody body = new XrancPduBody();
+ body.setRRMConfig(config);
+
+ BerUTF8String ver = null;
+ try {
+ ver = new BerUTF8String("3");
+ } catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+
+ XrancApiID apiID = new XrancApiID(29);
+ XrancPduHdr hdr = new XrancPduHdr();
+ hdr.setVer(ver);
+ hdr.setApiId(apiID);
+
+ XrancPdu pdu = new XrancPdu();
+ pdu.setHdr(hdr);
+ pdu.setBody(body);
+ return pdu;
+ }
+
public ECGI getEcgi() {
return ecgi;
}
@@ -454,7 +476,8 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<CRNTI> seqOf = null;
public Crnti() {
@@ -583,7 +606,8 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<XICICPA> seqOf = null;
public Pa() {
@@ -602,6 +626,10 @@
return seqOf;
}
+ public void setXICICPA(List<XICICPA> seqOf) {
+ this.seqOf = seqOf;
+ }
+
public int encode(BerByteArrayOutputStream os) throws IOException {
return encode(os, true);
}
@@ -701,14 +729,14 @@
}
sb.append("]");
}
-
}
public static class StartPrbDl implements Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerInteger> seqOf = null;
public StartPrbDl() {
@@ -727,7 +755,8 @@
this.seqOf = seqOf;
}
- @JsonValue public List<BerInteger> getBerInteger() {
+ @JsonValue
+ public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -843,7 +872,8 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerInteger> seqOf = null;
public EndPrbDl() {
@@ -854,7 +884,8 @@
this.code = code;
}
- @JsonValue public List<BerInteger> getBerInteger() {
+ @JsonValue
+ public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -978,7 +1009,8 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerBitString> seqOf = null;
public SubframeBitmaskDl() {
@@ -989,6 +1021,10 @@
this.code = code;
}
+ public void setSeqOf(List<BerBitString> seqOf) {
+ this.seqOf = seqOf;
+ }
+
@JsonValue
public List<BerBitString> getBerBitString() {
if (seqOf == null) {
@@ -997,6 +1033,7 @@
return seqOf;
}
+
public void addBerBitString(BerBitString berBitString) {
seqOf.add(berBitString);
}
@@ -1100,14 +1137,14 @@
}
sb.append("]");
}
-
}
public static class P0UePusch implements Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerInteger> seqOf = null;
public P0UePusch() {
@@ -1118,7 +1155,8 @@
this.code = code;
}
- @JsonValue public List<BerInteger> getBerInteger() {
+ @JsonValue
+ public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -1225,13 +1263,17 @@
sb.append("]");
}
+ public void setSeqOf(List<BerInteger> seqOf) {
+ this.seqOf = seqOf;
+ }
}
public static class StartPrbUl implements Serializable {
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerInteger> seqOf = null;
public StartPrbUl() {
@@ -1242,7 +1284,8 @@
this.code = code;
}
- @JsonValue public List<BerInteger> getBerInteger() {
+ @JsonValue
+ public List<BerInteger> getBerInteger() {
if (seqOf == null) {
seqOf = new ArrayList<BerInteger>();
}
@@ -1366,7 +1409,8 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerInteger> seqOf = null;
public EndPrbUl() {
@@ -1502,7 +1546,8 @@
public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
private static final long serialVersionUID = 1L;
- @JsonIgnore public byte[] code = null;
+ @JsonIgnore
+ public byte[] code = null;
private List<BerBitString> seqOf = null;
public SubframeBitmaskUl() {
@@ -1513,6 +1558,10 @@
this.code = code;
}
+ public void setSeqOf(List<BerBitString> seqOf) {
+ this.seqOf = seqOf;
+ }
+
@JsonValue
public List<BerBitString> getBerBitString() {
if (seqOf == null) {
@@ -1623,27 +1672,5 @@
}
- public static XrancPdu constructPacket(RRMConfig config) {
- XrancPduBody body = new XrancPduBody();
- body.setRRMConfig(config);
-
- BerUTF8String ver = null;
- try {
- ver = new BerUTF8String("3");
- } catch (UnsupportedEncodingException e) {
- e.printStackTrace();
- }
-
- XrancApiID apiID = new XrancApiID(29);
- XrancPduHdr hdr = new XrancPduHdr();
- hdr.setVer(ver);
- hdr.setApiId(apiID);
-
- XrancPdu pdu = new XrancPdu();
- pdu.setHdr(hdr);
- pdu.setBody(body);
- return pdu;
- }
-
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java b/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
index 287316a..a43fc70 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/UEContextUpdate.java
@@ -12,6 +12,7 @@
import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
import org.onosproject.xran.codecs.ber.BerLength;
import org.onosproject.xran.codecs.ber.BerTag;
+import org.onosproject.xran.codecs.ber.types.string.BerUTF8String;
import java.io.IOException;
import java.io.InputStream;
@@ -19,216 +20,263 @@
public class UEContextUpdate implements Serializable {
- private static final long serialVersionUID = 1L;
+ private static final long serialVersionUID = 1L;
- public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
+ public static final BerTag tag = new BerTag(BerTag.UNIVERSAL_CLASS, BerTag.CONSTRUCTED, 16);
- @JsonIgnore
- public byte[] code = null;
- private CRNTI crnti = null;
- private ECGI ecgi = null;
- private MMEUES1APID mMEUES1APID = null;
- private ENBUES1APID eNBUES1APID = null;
-
- public UEContextUpdate() {
- }
+ @JsonIgnore
+ public byte[] code = null;
+ private CRNTI crnti = null;
+ private ECGI ecgi = null;
+ private MMEUES1APID mMEUES1APID = null;
+ private ENBUES1APID eNBUES1APID = null;
+ private BerUTF8String imsi = null;
- public UEContextUpdate(byte[] code) {
- this.code = code;
- }
+ public UEContextUpdate() {
+ }
- public void setCrnti(CRNTI crnti) {
- this.crnti = crnti;
- }
+ public UEContextUpdate(byte[] code) {
+ this.code = code;
+ }
- public CRNTI getCrnti() {
- return crnti;
- }
+ public void setCrnti(CRNTI crnti) {
+ this.crnti = crnti;
+ }
- public void setEcgi(ECGI ecgi) {
- this.ecgi = ecgi;
- }
+ public CRNTI getCrnti() {
+ return crnti;
+ }
- public ECGI getEcgi() {
- return ecgi;
- }
+ public void setEcgi(ECGI ecgi) {
+ this.ecgi = ecgi;
+ }
- public void setMMEUES1APID(MMEUES1APID mMEUES1APID) {
- this.mMEUES1APID = mMEUES1APID;
- }
+ public ECGI getEcgi() {
+ return ecgi;
+ }
- public MMEUES1APID getMMEUES1APID() {
- return mMEUES1APID;
- }
+ public void setMMEUES1APID(MMEUES1APID mMEUES1APID) {
+ this.mMEUES1APID = mMEUES1APID;
+ }
- public void setENBUES1APID(ENBUES1APID eNBUES1APID) {
- this.eNBUES1APID = eNBUES1APID;
- }
+ public MMEUES1APID getMMEUES1APID() {
+ return mMEUES1APID;
+ }
- public ENBUES1APID getENBUES1APID() {
- return eNBUES1APID;
- }
+ public void setENBUES1APID(ENBUES1APID eNBUES1APID) {
+ this.eNBUES1APID = eNBUES1APID;
+ }
- public int encode(BerByteArrayOutputStream os) throws IOException {
- return encode(os, true);
- }
+ public ENBUES1APID getENBUES1APID() {
+ return eNBUES1APID;
+ }
- public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+ public void setImsi(BerUTF8String imsi) {
+ this.imsi = imsi;
+ }
- if (code != null) {
- for (int i = code.length - 1; i >= 0; i--) {
- os.write(code[i]);
+ public BerUTF8String getImsi() {
+ return imsi;
+ }
+
+ public int encode(BerByteArrayOutputStream os) throws IOException {
+ return encode(os, true);
+ }
+
+ public int encode(BerByteArrayOutputStream os, boolean withTag) throws IOException {
+
+ if (code != null) {
+ for (int i = code.length - 1; i >= 0; i--) {
+ os.write(code[i]);
+ }
+ if (withTag) {
+ return tag.encode(os) + code.length;
+ }
+ return code.length;
}
+
+ int codeLength = 0;
+ if (imsi != null) {
+ codeLength += imsi.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 4
+ os.write(0x84);
+ codeLength += 1;
+ }
+
+ codeLength += eNBUES1APID.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 3
+ os.write(0x83);
+ codeLength += 1;
+
+ codeLength += mMEUES1APID.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 2
+ os.write(0x82);
+ codeLength += 1;
+
+ codeLength += ecgi.encode(os, false);
+ // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
+ os.write(0xA1);
+ codeLength += 1;
+
+ codeLength += crnti.encode(os, false);
+ // write tag: CONTEXT_CLASS, PRIMITIVE, 0
+ os.write(0x80);
+ codeLength += 1;
+
+ codeLength += BerLength.encodeLength(os, codeLength);
+
if (withTag) {
- return tag.encode(os) + code.length;
+ codeLength += tag.encode(os);
}
- return code.length;
+
+ return codeLength;
+
}
- int codeLength = 0;
- codeLength += eNBUES1APID.encode(os, false);
- // write tag: CONTEXT_CLASS, PRIMITIVE, 3
- os.write(0x83);
- codeLength += 1;
-
- codeLength += mMEUES1APID.encode(os, false);
- // write tag: CONTEXT_CLASS, PRIMITIVE, 2
- os.write(0x82);
- codeLength += 1;
-
- codeLength += ecgi.encode(os, false);
- // write tag: CONTEXT_CLASS, CONSTRUCTED, 1
- os.write(0xA1);
- codeLength += 1;
-
- codeLength += crnti.encode(os, false);
- // write tag: CONTEXT_CLASS, PRIMITIVE, 0
- os.write(0x80);
- codeLength += 1;
-
- codeLength += BerLength.encodeLength(os, codeLength);
-
- if (withTag) {
- codeLength += tag.encode(os);
+ public int decode(InputStream is) throws IOException {
+ return decode(is, true);
}
- return codeLength;
+ public int decode(InputStream is, boolean withTag) throws IOException {
+ int codeLength = 0;
+ int subCodeLength = 0;
+ BerTag berTag = new BerTag();
- }
-
- public int decode(InputStream is) throws IOException {
- return decode(is, true);
- }
-
- public int decode(InputStream is, boolean withTag) throws IOException {
- int codeLength = 0;
- int subCodeLength = 0;
- BerTag berTag = new BerTag();
-
- if (withTag) {
- codeLength += tag.decodeAndCheck(is);
- }
-
- BerLength length = new BerLength();
- codeLength += length.decode(is);
-
- int totalLength = length.val;
- codeLength += totalLength;
-
- subCodeLength += berTag.decode(is);
- if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
- crnti = new CRNTI();
- subCodeLength += crnti.decode(is, false);
- subCodeLength += berTag.decode(is);
- }
- else {
- throw new IOException("Tag does not match the mandatory sequence element tag.");
- }
-
- if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
- ecgi = new ECGI();
- subCodeLength += ecgi.decode(is, false);
- subCodeLength += berTag.decode(is);
- }
- else {
- throw new IOException("Tag does not match the mandatory sequence element tag.");
- }
-
- if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
- mMEUES1APID = new MMEUES1APID();
- subCodeLength += mMEUES1APID.decode(is, false);
- subCodeLength += berTag.decode(is);
- }
- else {
- throw new IOException("Tag does not match the mandatory sequence element tag.");
- }
-
- if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
- eNBUES1APID = new ENBUES1APID();
- subCodeLength += eNBUES1APID.decode(is, false);
- if (subCodeLength == totalLength) {
- return codeLength;
+ if (withTag) {
+ codeLength += tag.decodeAndCheck(is);
}
- }
- throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
-
- }
+ BerLength length = new BerLength();
+ codeLength += length.decode(is);
- public void encodeAndSave(int encodingSizeGuess) throws IOException {
- BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
- encode(os, false);
- code = os.getArray();
- }
+ int totalLength = length.val;
+ codeLength += totalLength;
- public String toString() {
- StringBuilder sb = new StringBuilder();
- appendAsString(sb, 0);
- return sb.toString();
- }
+ subCodeLength += berTag.decode(is);
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 0)) {
+ crnti = new CRNTI();
+ subCodeLength += crnti.decode(is, false);
+ subCodeLength += berTag.decode(is);
+ }
+ else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
- public void appendAsString(StringBuilder sb, int indentLevel) {
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.CONSTRUCTED, 1)) {
+ ecgi = new ECGI();
+ subCodeLength += ecgi.decode(is, false);
+ subCodeLength += berTag.decode(is);
+ }
+ else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
- sb.append("{");
- sb.append("\n");
- for (int i = 0; i < indentLevel + 1; i++) {
- sb.append("\t");
- }
- if (crnti != null) {
- sb.append("crnti: ").append(crnti);
- }
-
- sb.append(",\n");
- for (int i = 0; i < indentLevel + 1; i++) {
- sb.append("\t");
- }
- if (ecgi != null) {
- sb.append("ecgi: ");
- ecgi.appendAsString(sb, indentLevel + 1);
- }
-
- sb.append(",\n");
- for (int i = 0; i < indentLevel + 1; i++) {
- sb.append("\t");
- }
- if (mMEUES1APID != null) {
- sb.append("mMEUES1APID: ").append(mMEUES1APID);
- }
-
- sb.append(",\n");
- for (int i = 0; i < indentLevel + 1; i++) {
- sb.append("\t");
- }
- if (eNBUES1APID != null) {
- sb.append("eNBUES1APID: ").append(eNBUES1APID);
- }
-
- sb.append("\n");
- for (int i = 0; i < indentLevel; i++) {
- sb.append("\t");
- }
- sb.append("}");
- }
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 2)) {
+ mMEUES1APID = new MMEUES1APID();
+ subCodeLength += mMEUES1APID.decode(is, false);
+ subCodeLength += berTag.decode(is);
+ }
+ else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 3)) {
+ eNBUES1APID = new ENBUES1APID();
+ subCodeLength += eNBUES1APID.decode(is, false);
+ if (subCodeLength == totalLength) {
+ return codeLength;
+ }
+ subCodeLength += berTag.decode(is);
+ }
+ else {
+ throw new IOException("Tag does not match the mandatory sequence element tag.");
+ }
+
+ if (berTag.equals(BerTag.CONTEXT_CLASS, BerTag.PRIMITIVE, 4)) {
+ imsi = new BerUTF8String();
+ subCodeLength += imsi.decode(is, false);
+ if (subCodeLength == totalLength) {
+ return codeLength;
+ }
+ }
+ throw new IOException("Unexpected end of sequence, length tag: " + totalLength + ", actual sequence length: " + subCodeLength);
+
+
+ }
+
+ public void encodeAndSave(int encodingSizeGuess) throws IOException {
+ BerByteArrayOutputStream os = new BerByteArrayOutputStream(encodingSizeGuess);
+ encode(os, false);
+ code = os.getArray();
+ }
+
+ public String toString() {
+ StringBuilder sb = new StringBuilder();
+ appendAsString(sb, 0);
+ return sb.toString();
+ }
+
+ public void appendAsString(StringBuilder sb, int indentLevel) {
+
+ sb.append("{");
+ sb.append("\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (crnti != null) {
+ sb.append("crnti: ").append(crnti);
+ }
+ else {
+ sb.append("crnti: <empty-required-field>");
+ }
+
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (ecgi != null) {
+ sb.append("ecgi: ");
+ ecgi.appendAsString(sb, indentLevel + 1);
+ }
+ else {
+ sb.append("ecgi: <empty-required-field>");
+ }
+
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (mMEUES1APID != null) {
+ sb.append("mMEUES1APID: ").append(mMEUES1APID);
+ }
+ else {
+ sb.append("mMEUES1APID: <empty-required-field>");
+ }
+
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ if (eNBUES1APID != null) {
+ sb.append("eNBUES1APID: ").append(eNBUES1APID);
+ }
+ else {
+ sb.append("eNBUES1APID: <empty-required-field>");
+ }
+
+ if (imsi != null) {
+ sb.append(",\n");
+ for (int i = 0; i < indentLevel + 1; i++) {
+ sb.append("\t");
+ }
+ sb.append("imsi: ").append(imsi);
+ }
+
+ sb.append("\n");
+ for (int i = 0; i < indentLevel; i++) {
+ sb.append("\t");
+ }
+ sb.append("}");
+ }
}
diff --git a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
index 7d841c9..b0e2440 100644
--- a/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
+++ b/src/main/java/org.onosproject.xran/codecs/pdu/XICICConfig.java
@@ -468,25 +468,48 @@
sb.append("}");
}
- public static XrancPdu constructPacket(RRMConfig config) {
+ public static XrancPdu constructPacket(RRMConfig config, CellConfigReport cellConfigReport) {
XrancPduBody body = new XrancPduBody();
XICICConfig xicicConfig = new XICICConfig();
- xicicConfig.setCrnti(config.getCrnti().getCRNTI().get(0));
xicicConfig.setEcgi(config.getEcgi());
+ xicicConfig.setCrnti(config.getCrnti().getCRNTI().get(0));
try {
- xicicConfig.setEndPrbDl(config.getEndPrbDl().getSeqOf().get(0));
- } catch (Exception ignored) {}
+ PCIARFCN pciarfcn = new PCIARFCN();
+ pciarfcn.setPci(cellConfigReport.getPci());
+ pciarfcn.setEarfcnDl(cellConfigReport.getEarfcnDl());
+ xicicConfig.setPciArfcn(pciarfcn);
+ } catch (Exception ignored) {}
- try {
- xicicConfig.setEndPrbUl(config.getEndPrbUl().getSeqOf().get(0));
- } catch (Exception ignored) {}
+ try {
+ xicicConfig.setPa(config.getPa().getXICICPA().get(0));
+ } catch (Exception ignored) {}
- try {
- xicicConfig.setStartPrbDl(config.getStartPrbDl().getSeqOf().get(0));
- } catch (Exception ignored) {}
+ try {
+ xicicConfig.setStartPrbDl(config.getStartPrbDl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setEndPrbDl(config.getEndPrbDl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setSubframeBitmaskDl(config.getSubframeBitmaskDl().getBerBitString().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setSubframeBitmaskUl(config.getSubframeBitmaskUl().getBerBitString().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setP0UePusch(config.getP0UePusch().getBerInteger().get(0));
+ } catch (Exception ignored) {}
+
+ try {
+ xicicConfig.setEndPrbUl(config.getEndPrbUl().getSeqOf().get(0));
+ } catch (Exception ignored) {}
try {
xicicConfig.setEndPrbUl(config.getStartPrbUl().getSeqOf().get(0));
diff --git a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
index c21db62..c985a84 100644
--- a/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
+++ b/src/main/java/org.onosproject.xran/controller/XranControllerImpl.java
@@ -107,8 +107,7 @@
private LinkMap linkMap;
/* MAPS */
private ConcurrentMap<String, ECGI> legitCells = new ConcurrentHashMap<>();
- private ConcurrentMap<CRNTI, UEContextUpdate> hoContextUpdateMap = new ConcurrentHashMap<>();
- private ConcurrentMap<CRNTI, SynchronousQueue<String>> hoQueue = new ConcurrentHashMap<>();
+ private ConcurrentMap<ECGI, SynchronousQueue<String>> hoQueue = new ConcurrentHashMap<>();
private ConcurrentMap<ECGI, SynchronousQueue<String>> RRMCellQueue = new ConcurrentHashMap<>();
private ConcurrentMap<CRNTI, SynchronousQueue<String>> scellAddQueue = new ConcurrentHashMap<>();
private ConcurrentMap<CRNTI, SynchronousQueue<String>> scellDeleteQueue = new ConcurrentHashMap<>();
@@ -156,23 +155,24 @@
}
@Override
- public SynchronousQueue<String> sendHORequest(RnibLink newLink, RnibLink oldLink) {
- ECGI newEcgi = newLink.getLinkId().getEcgi(),
- oldEcgi = oldLink.getLinkId().getEcgi();
- CRNTI crnti = linkMap.getCrnti(newLink.getLinkId().getMmeues1apid());
- ChannelHandlerContext newCtx = cellMap.getCtx(newEcgi),
- oldCtx = cellMap.getCtx(oldEcgi);
+ public SynchronousQueue<String> sendHORequest(RnibLink link_t, RnibLink link_s) {
+ ECGI ecgi_t = link_t.getLinkId().getEcgi(),
+ ecgi_s = link_s.getLinkId().getEcgi();
+
+ CRNTI crnti = linkMap.getCrnti(link_t.getLinkId().getMmeues1apid());
+ ChannelHandlerContext ctx_t = cellMap.getCtx(ecgi_t),
+ ctx_s = cellMap.getCtx(ecgi_s);
try {
- XrancPdu xrancPdu = HORequest.constructPacket(crnti, oldEcgi, newEcgi);
- newCtx.writeAndFlush(getSctpMessage(xrancPdu));
- oldCtx.writeAndFlush(getSctpMessage(xrancPdu));
+ XrancPdu xrancPdu = HORequest.constructPacket(crnti, ecgi_s, ecgi_t);
+ ctx_t.writeAndFlush(getSctpMessage(xrancPdu));
+ ctx_s.writeAndFlush(getSctpMessage(xrancPdu));
} catch (IOException e) {
e.printStackTrace();
}
SynchronousQueue<String> queue = new SynchronousQueue<>();
- hoQueue.put(crnti, queue);
+ hoQueue.put(ecgi_s, queue);
return queue;
}
@@ -202,20 +202,26 @@
ECGI ecgi = rrmConfig.getEcgi();
ChannelHandlerContext ctx = cellMap.getCtx(ecgi);
try {
- XrancPdu pdu;
+ XrancPdu pdu = null;
+
if (xICIC) {
- pdu = XICICConfig.constructPacket(rrmConfig);
+ CellConfigReport cellConfigReport = cellMap.get(ecgi).getConf();
+ if (cellConfigReport != null) {
+ pdu = XICICConfig.constructPacket(rrmConfig, cellConfigReport);
+ ctx.writeAndFlush(getSctpMessage(pdu));
+ }
} else {
pdu = RRMConfig.constructPacket(rrmConfig);
+ ctx.writeAndFlush(getSctpMessage(pdu));
+ SynchronousQueue<String> queue = new SynchronousQueue<>();
+ RRMCellQueue.put(ecgi, queue);
+ return queue;
}
- ctx.writeAndFlush(getSctpMessage(pdu));
} catch (IOException e) {
e.printStackTrace();
}
- SynchronousQueue<String> queue = new SynchronousQueue<>();
- RRMCellQueue.put(ecgi, queue);
- return queue;
+ return null;
}
@Override
@@ -597,22 +603,17 @@
UEContextUpdate ueContextUpdate = recv_pdu.getBody().getUEContextUpdate();
RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
- if (ue != null && hoQueue.keySet().contains(ue.getRanId())) {
- CRNTI crnti = ueContextUpdate.getCrnti();
- hoContextUpdateMap.put(crnti, ueContextUpdate);
- hoQueue.remove(ue.getRanId());
- } else {
- RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
- if (ue == null) {
- ue = new RnibUe();
- }
-
- ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
- ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
- ue.setRanId(ueContextUpdate.getCrnti());
-
- hostAgent.addConnectedHost(ue, cell, ctx);
+ RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
+ if (ue == null) {
+ ue = new RnibUe();
}
+
+ ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
+ ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
+ ue.setRanId(ueContextUpdate.getCrnti());
+
+ hostAgent.addConnectedHost(ue, cell, ctx);
+
break;
}
case 6: {
@@ -692,13 +693,13 @@
HOFailure hoFailure = recv_pdu.getBody().getHOFailure();
try {
- hoQueue.get(hoFailure.getCrnti())
+ hoQueue.get(hoFailure.getEcgi())
.put("Hand Over Failed with cause: " + hoFailure.getCause());
} catch (InterruptedException e) {
log.error(ExceptionUtils.getFullStackTrace(e));
e.printStackTrace();
} finally {
- hoQueue.remove(hoFailure.getCrnti());
+ hoQueue.remove(hoFailure.getEcgi());
}
break;
@@ -706,34 +707,14 @@
case 14: {
HOComplete hoComplete = recv_pdu.getBody().getHOComplete();
- RnibLink oldLink = linkMap.get(hoComplete.getEcgiS(), hoComplete.getCrntiNew()),
- newLink = linkMap.get(hoComplete.getEcgiT(), hoComplete.getCrntiNew());
-
- oldLink.setType(RnibLink.Type.NON_SERVING);
- newLink.setType(RnibLink.Type.SERVING_PRIMARY);
-
try {
- hoQueue.get(hoComplete.getCrntiNew())
+ hoQueue.get(hoComplete.getEcgiS())
.put("Hand Over Completed");
} catch (InterruptedException e) {
log.error(ExceptionUtils.getFullStackTrace(e));
e.printStackTrace();
} finally {
- hoQueue.remove(hoComplete.getCrntiNew());
-
- UEContextUpdate ueContextUpdate = hoContextUpdateMap.get(hoComplete.getCrntiNew());
-
- RnibUe ue = ueMap.get(ueContextUpdate.getMMEUES1APID());
- RnibCell cell = xranStore.getCell(ueContextUpdate.getEcgi());
- if (ueMap.get(ueContextUpdate.getMMEUES1APID()) == null) {
- ue = new RnibUe();
- }
-
- ue.setMmeS1apId(ueContextUpdate.getMMEUES1APID());
- ue.setEnbS1apId(ueContextUpdate.getENBUES1APID());
- ue.setRanId(ueContextUpdate.getCrnti());
-
- hostAgent.addConnectedHost(ue, cell, ctx);
+ hoQueue.remove(hoComplete.getEcgiS());
}
break;
}
diff --git a/src/main/java/org.onosproject.xran/entities/RnibCell.java b/src/main/java/org.onosproject.xran/entities/RnibCell.java
index f3f41d9..3179357 100644
--- a/src/main/java/org.onosproject.xran/entities/RnibCell.java
+++ b/src/main/java/org.onosproject.xran/entities/RnibCell.java
@@ -18,12 +18,15 @@
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.JsonNode;
+import com.google.common.collect.Lists;
import org.onosproject.net.DeviceId;
import org.onosproject.store.Timestamp;
import org.onosproject.store.service.WallClockTimestamp;
import org.onosproject.xran.codecs.api.ECGI;
import org.onosproject.xran.codecs.api.PRBUsage;
+import org.onosproject.xran.codecs.api.XICICPA;
import org.onosproject.xran.codecs.ber.BerByteArrayOutputStream;
+import org.onosproject.xran.codecs.ber.types.BerBitString;
import org.onosproject.xran.codecs.ber.types.BerInteger;
import org.onosproject.xran.codecs.pdu.CellConfigReport;
import org.onosproject.xran.codecs.pdu.L2MeasConfig;
@@ -154,11 +157,29 @@
this.conf = conf;
}
- public void modifyRrmConfig(JsonNode rrmConfigNode, List<RnibUe> ueList) {
+ public void modifyRrmConfig(JsonNode rrmConfigNode, List<RnibUe> ueList) throws Exception {
RRMConfig.Crnti crnti = new RRMConfig.Crnti();
ueList.forEach(ue -> crnti.addCRNTI(ue.getRanId()));
{
+ JsonNode p_a = rrmConfigNode.path("p_a");
+ if (!p_a.isMissingNode()) {
+ RRMConfig.Pa pa = new RRMConfig.Pa();
+ if (p_a.isArray()) {
+ if (ueList.size() == p_a.size()) {
+ List<XICICPA> collect = Stream.of(p_a)
+ .map(val -> new XICICPA(val.asInt()))
+ .collect(Collectors.toList());
+ pa.setXICICPA(collect);
+ } else {
+ throw new Exception("p_a size is not the same as UE size");
+ }
+ }
+ rrmConfig.setPa(pa);
+ }
+ }
+
+ {
JsonNode start_prb_dl = rrmConfigNode.path("start_prb_dl");
if (!start_prb_dl.isMissingNode()) {
RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
@@ -168,6 +189,8 @@
.map(val -> new BerInteger(val.asInt()))
.collect(Collectors.toList());
startPrbDl.setSeqOf(collect);
+ } else {
+ throw new Exception("start_prb_dl size is not the same as UE size");
}
}
rrmConfig.setStartPrbDl(startPrbDl);
@@ -184,6 +207,8 @@
.map(val -> new BerInteger(val.asInt()))
.collect(Collectors.toList());
endPrbDl.setSeqOf(collect);
+ } else {
+ throw new Exception("end_prb_dl size is not the same as UE size");
}
}
rrmConfig.setEndPrbDl(endPrbDl);
@@ -191,6 +216,23 @@
}
{
+ JsonNode sub_frame_bitmask_dl = rrmConfigNode.path("sub_frame_bitmask_dl");
+ if (!sub_frame_bitmask_dl.isMissingNode()) {
+ RRMConfig.SubframeBitmaskDl subframeBitmaskDl = new RRMConfig.SubframeBitmaskDl();
+ if (sub_frame_bitmask_dl.isArray()) {
+ List<BerBitString> collect = Stream.of(sub_frame_bitmask_dl)
+ .map(val -> new BerBitString(DatatypeConverter.parseHexBinary(val.asText()), 10))
+ .collect(Collectors.toList());
+
+ subframeBitmaskDl.setSeqOf(collect);
+ } else {
+ throw new Exception("sub_frame_bitmask_dl size is not the same as UE size");
+ }
+ rrmConfig.setSubframeBitmaskDl(subframeBitmaskDl);
+ }
+ }
+
+ {
JsonNode start_prb_ul = rrmConfigNode.path("start_prb_ul");
if (!start_prb_ul.isMissingNode()) {
RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
@@ -200,6 +242,8 @@
.map(val -> new BerInteger(val.asInt()))
.collect(Collectors.toList());
startPrbUl.setSeqOf(collect);
+ } else {
+ throw new Exception("start_prb_ul size is not the same as UE size");
}
}
rrmConfig.setStartPrbUl(startPrbUl);
@@ -216,12 +260,49 @@
.map(val -> new BerInteger(val.asInt()))
.collect(Collectors.toList());
endPrbUl.setSeqOf(collect);
+ } else {
+ throw new Exception("end_prb_ul size is not the same as UE size");
}
}
rrmConfig.setEndPrbUl(endPrbUl);
}
}
+ {
+ JsonNode p0_ue_pusch = rrmConfigNode.path("p0_ue_pusch");
+ if (!p0_ue_pusch.isMissingNode()) {
+ RRMConfig.P0UePusch p0UePusch = new RRMConfig.P0UePusch();
+ if (p0_ue_pusch.isArray()) {
+ if (ueList.size() == p0_ue_pusch.size()) {
+ List<BerInteger> collect = Stream.of(p0_ue_pusch)
+ .map(val -> new BerInteger(val.asInt()))
+ .collect(Collectors.toList());
+ p0UePusch.setSeqOf(collect);
+ } else {
+ throw new Exception("p0_ue_pusch size is not the same as UE size");
+ }
+ }
+ rrmConfig.setP0UePusch(p0UePusch);
+ }
+ }
+
+ {
+ JsonNode sub_frame_bitmask_ul = rrmConfigNode.path("sub_frame_bitmask_ul");
+ if (!sub_frame_bitmask_ul.isMissingNode()) {
+ RRMConfig.SubframeBitmaskUl subframeBitmaskUl = new RRMConfig.SubframeBitmaskUl();
+ if (sub_frame_bitmask_ul.isArray()) {
+ List<BerBitString> collect = Stream.of(sub_frame_bitmask_ul)
+ .map(val -> new BerBitString(DatatypeConverter.parseHexBinary(val.asText()), 10))
+ .collect(Collectors.toList());
+
+ subframeBitmaskUl.setSeqOf(collect);
+ } else {
+ throw new Exception("sub_frame_bitmask_ul size is not the same as UE size");
+ }
+ rrmConfig.setSubframeBitmaskUl(subframeBitmaskUl);
+ }
+ }
+
rrmConfig.setCrnti(crnti);
}
diff --git a/src/main/java/org.onosproject.xran/entities/RnibLink.java b/src/main/java/org.onosproject.xran/entities/RnibLink.java
index f3d04e7..7d2b374 100644
--- a/src/main/java/org.onosproject.xran/entities/RnibLink.java
+++ b/src/main/java/org.onosproject.xran/entities/RnibLink.java
@@ -21,11 +21,15 @@
import com.google.common.collect.Lists;
import org.onosproject.store.service.WallClockTimestamp;
import org.onosproject.xran.codecs.api.*;
+import org.onosproject.xran.codecs.ber.types.BerBitString;
import org.onosproject.xran.codecs.ber.types.BerInteger;
import org.onosproject.xran.codecs.pdu.PDCPMeasReportPerUe;
import org.onosproject.xran.codecs.pdu.RRMConfig;
import org.onosproject.xran.identifiers.LinkId;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import javax.xml.bind.DatatypeConverter;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
@@ -47,6 +51,10 @@
})
@JsonIgnoreProperties(ignoreUnknown = true)
public class RnibLink {
+ @JsonIgnore
+ private static final Logger log =
+ LoggerFactory.getLogger(RnibLink.class);
+
@JsonProperty("Link-ID")
private LinkId linkId;
@JsonProperty("RRMConfiguration")
@@ -166,6 +174,18 @@
public void modifyRrmParameters(JsonNode rrmConfigNode) {
{
+ JsonNode p_a = rrmConfigNode.path("p_a");
+ if (!p_a.isMissingNode()) {
+ RRMConfig.Pa pa = new RRMConfig.Pa();
+
+ List<XICICPA> collect = Lists.newArrayList();
+ collect.add(new XICICPA(p_a.asInt()));
+ pa.setXICICPA(collect);
+ rrmParameters.setPa(pa);
+ }
+ }
+
+ {
JsonNode start_prb_dl = rrmConfigNode.path("start_prb_dl");
if (!start_prb_dl.isMissingNode()) {
RRMConfig.StartPrbDl startPrbDl = new RRMConfig.StartPrbDl();
@@ -192,6 +212,19 @@
}
{
+ JsonNode sub_frame_bitmask_dl = rrmConfigNode.path("sub_frame_bitmask_dl");
+ if (!sub_frame_bitmask_dl.isMissingNode()) {
+ RRMConfig.SubframeBitmaskDl subframeBitmaskDl = new RRMConfig.SubframeBitmaskDl();
+ List<BerBitString> collect = Lists.newArrayList();
+
+ byte[] hexString = DatatypeConverter.parseHexBinary(sub_frame_bitmask_dl.asText());
+ collect.add(new BerBitString(hexString, 10));
+ subframeBitmaskDl.setSeqOf(collect);
+ rrmParameters.setSubframeBitmaskDl(subframeBitmaskDl);
+ }
+ }
+
+ {
JsonNode start_prb_ul = rrmConfigNode.path("start_prb_ul");
if (!start_prb_ul.isMissingNode()) {
RRMConfig.StartPrbUl startPrbUl = new RRMConfig.StartPrbUl();
@@ -216,6 +249,32 @@
rrmParameters.setEndPrbUl(endPrbUl);
}
}
+
+ {
+ JsonNode p0_ue_pusch = rrmConfigNode.path("p0_ue_pusch");
+ if (!p0_ue_pusch.isMissingNode()) {
+ RRMConfig.P0UePusch p0UePusch = new RRMConfig.P0UePusch();
+
+ List<BerInteger> collect = Lists.newArrayList();
+ collect.add(new BerInteger(p0_ue_pusch.asInt()));
+ p0UePusch.setSeqOf(collect);
+
+ rrmParameters.setP0UePusch(p0UePusch);
+ }
+ }
+
+ {
+ JsonNode sub_frame_bitmask_ul = rrmConfigNode.path("sub_frame_bitmask_ul");
+ if (!sub_frame_bitmask_ul.isMissingNode()) {
+ RRMConfig.SubframeBitmaskUl subframeBitmaskUl = new RRMConfig.SubframeBitmaskUl();
+ List<BerBitString> collect = Lists.newArrayList();
+
+ byte[] hexString = DatatypeConverter.parseHexBinary(sub_frame_bitmask_ul.asText());
+ collect.add(new BerBitString(hexString, 10));
+ subframeBitmaskUl.setSeqOf(collect);
+ rrmParameters.setSubframeBitmaskUl(subframeBitmaskUl);
+ }
+ }
}
@JsonProperty("PDCP-Throughput")
diff --git a/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java b/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java
index 279f46d..9dab964 100644
--- a/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java
+++ b/src/main/java/org.onosproject.xran/impl/DefaultXranStore.java
@@ -230,7 +230,7 @@
}
@Override
- public void modifyCellRrmConf(RnibCell cell, JsonNode rrmConf) {
+ public void modifyCellRrmConf(RnibCell cell, JsonNode rrmConf) throws Exception {
List<RnibLink> linkList = getLinksByECGI(cell.getEcgi());
List<RnibUe> ueList = linkList.stream().map(link -> link.getLinkId().getUe()).collect(Collectors.toList());
diff --git a/src/main/java/org.onosproject.xran/rest/CellWebResource.java b/src/main/java/org.onosproject.xran/rest/CellWebResource.java
index e87964e..c738b40 100644
--- a/src/main/java/org.onosproject.xran/rest/CellWebResource.java
+++ b/src/main/java/org.onosproject.xran/rest/CellWebResource.java
@@ -15,7 +15,6 @@
*/
package org.onosproject.xran.rest;
-import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.commons.lang.exception.ExceptionUtils;
@@ -141,8 +140,8 @@
return ResponseHelper.getResponse(
mapper(),
- ResponseHelper.statusCode.NOT_IMPLEMENTED,
- "Not Implemented",
+ ResponseHelper.statusCode.BAD_REQUEST,
+ "Bad Request",
"The command you specified is not implemented or doesn't exist. We support " +
"RRMConf commands."
);
diff --git a/src/main/java/org.onosproject.xran/rest/LinkWebResource.java b/src/main/java/org.onosproject.xran/rest/LinkWebResource.java
index 979e84e..097cab9 100644
--- a/src/main/java/org.onosproject.xran/rest/LinkWebResource.java
+++ b/src/main/java/org.onosproject.xran/rest/LinkWebResource.java
@@ -260,8 +260,8 @@
return ResponseHelper.getResponse(
mapper(),
- ResponseHelper.statusCode.NOT_IMPLEMENTED,
- "Not Implemented",
+ ResponseHelper.statusCode.BAD_REQUEST,
+ "Bad Request",
"The command you specified is not implemented or doesn't exist. We support " +
"type/RRMConf/traficpercent commands."
);
@@ -392,9 +392,9 @@
return ResponseHelper.getResponse(
mapper(),
- ResponseHelper.statusCode.NOT_IMPLEMENTED,
- "Not Implemented",
- "This request is not implemented"
+ ResponseHelper.statusCode.BAD_REQUEST,
+ "Bad Request",
+ "The command you specified is not implemented or doesn't exist."
);
}
@@ -420,24 +420,36 @@
private Response handleRRMChange(RnibLink link, JsonNode rrmConf) throws InterruptedException {
final SynchronousQueue<String>[] queue = new SynchronousQueue[1];
get(XranStore.class).modifyLinkRrmConf(link, rrmConf);
- queue[0] = get(XranController.class).sendModifiedRRMConf(link.getRrmParameters(),
- link.getLinkId().getCell().getVersion() <= 3);
- String poll = queue[0].poll(5, TimeUnit.SECONDS);
+ boolean isxICIC = link.getLinkId().getCell().getVersion() <= 3;
- if (poll != null) {
+ queue[0] = get(XranController.class).sendModifiedRRMConf(link.getRrmParameters(),
+ isxICIC);
+
+ if (isxICIC) {
return ResponseHelper.getResponse(
mapper(),
ResponseHelper.statusCode.OK,
- "RRMConfig Response",
- poll
+ "OK",
+ "xICIC was sent successfully"
);
} else {
- return ResponseHelper.getResponse(
- mapper(),
- ResponseHelper.statusCode.REQUEST_TIMEOUT,
- "RRMConfig Timeout",
- "eNodeB did not send a RRMConfingStatus on time"
- );
+ String poll = queue[0].poll(5, TimeUnit.SECONDS);
+
+ if (poll != null) {
+ return ResponseHelper.getResponse(
+ mapper(),
+ ResponseHelper.statusCode.OK,
+ "RRMConfig Response",
+ poll
+ );
+ } else {
+ return ResponseHelper.getResponse(
+ mapper(),
+ ResponseHelper.statusCode.REQUEST_TIMEOUT,
+ "RRMConfig Timeout",
+ "eNodeB did not send a RRMConfingStatus on time"
+ );
+ }
}
}
}