提交 a3e7def8 编写于 作者: C calin.cerchez

begin rrc

上级 4c536dea
file 13724 1341907082
version 2
run General-0-20120709-16:16:37-6492
attr configname General
attr datetime 20120709-16:16:37
attr experiment General
attr inifile omnetpp.ini
attr iterationvars ""
attr iterationvars2 $repetition=0
attr measurement ""
attr network Test
attr processid 6492
attr repetition 0
attr replication #0
attr resultdir results
attr runnumber 0
attr seedset 0
vector 4 Test.MME.eth[0].mac framesSent ETV
4 7520 541 27 678 1.000006719999 28.908845762154 22 1 22 253 3795
vector 6 Test.MME.eth[0].mac bytesSent ETV
6 8602 583 27 678 1.000006719999 28.908845762154 22 64 2116 24154 35499636
vector 20 Test.HSS.eth[0].mac framesSent ETV
20 10825 563 28 663 1.000006719999 28.908833442155 22 1 22 253 3795
vector 22 Test.HSS.eth[0].mac bytesSent ETV
22 11951 605 28 663 1.000006719999 28.908833442155 22 64 1956 22434 29915876
vector 21 Test.HSS.eth[0].mac framesReceivedOK ETV
21 11388 563 29 679 1.000006719999 28.908845762154 22 1 22 253 3795
vector 23 Test.HSS.eth[0].mac bytesReceivedOK ETV
23 12556 605 29 679 1.000006719999 28.908845762154 22 64 2116 24154 35499636
vector 27 Test.HSS.eth[0].mac framesPassedToHL ETV
27 13161 563 29 679 1.000006719999 28.908845762154 22 1 22 253 3795
vector 5 Test.MME.eth[0].mac framesReceivedOK ETV
5 8061 541 30 664 1.000006719999 28.908833442155 22 1 22 253 3795
vector 7 Test.MME.eth[0].mac bytesReceivedOK ETV
7 9185 583 30 664 1.000006719999 28.908833442155 22 64 1956 22434 29915876
vector 11 Test.MME.eth[0].mac framesPassedToHL ETV
11 9768 563 30 664 1.000006719999 28.908833442155 22 1 22 253 3795
vector 18 Test.HSS.eth[0].queue "queue length" ETV
18 10331 494 44 412 1.000006719999 1.000142239985 20 0 2 14 18
vector 2 Test.MME.eth[0].queue "queue length" ETV
2 7047 473 46 365 1.000006719999 1.000128639987 20 0 2 14 18
vector 70 Test.HSS.sctp "Slow Start Threshold 10:192.168.1.2" ETV
70 3655 54 141 471 1.000047199995 1.000155679983 2 0 65535 65535 4294836225
vector 71 Test.HSS.sctp "Congestion Window 10:192.168.1.2" ETV
71 3709 53 141 471 1.000047199995 1.000155679983 2 0 4380 4380 19184400
vector 74 Test.HSS.sctp "HB Sent 10:192.168.1.2" ETV
74 3927 25 141 141 1.000047199995 1.000047199995 1 1 1 1 1
vector 68 Test.HSS.sctp "RTO 10:192.168.1.2" ETV
68 3762 75 141 471 1.000047199995 1.000155679983 3 0 3 4 10
vector 59 Test.MME.sctp "Slow Start Threshold 9:192.168.1.1" ETV
59 4453 173 142 687 1.000047199995 34.000047199995 6 0 65535 327675 21474181125
vector 60 Test.MME.sctp "Congestion Window 9:192.168.1.1" ETV
60 4626 168 142 687 1.000047199995 34.000047199995 6 0 4380 21900 95922000
vector 63 Test.MME.sctp "HB Sent 9:192.168.1.1" ETV
63 5416 25 142 142 1.000047199995 1.000047199995 1 1 1 1 1
vector 57 Test.MME.sctp "RTO 9:192.168.1.1" ETV
57 4794 178 142 687 1.000047199995 34.000047199995 7 0 3 8 14
vector 42 Test.MME.sctp "HB ACK Sent 5:192.168.1.1" ETV
42 4378 25 183 183 1.000054079994 1.000054079994 1 1 1 1 1
vector 43 Test.MME.sctp "HB Received 5:192.168.1.1" ETV
43 4353 25 183 183 1.000054079994 1.000054079994 1 1 1 1 1
vector 53 Test.HSS.sctp "HB ACK Sent 8:192.168.1.2" ETV
53 6717 25 184 184 1.000054079994 1.000054079994 1 1 1 1 1
vector 54 Test.HSS.sctp "HB Received 8:192.168.1.2" ETV
54 6692 25 184 184 1.000054079994 1.000054079994 1 1 1 1 1
vector 37 Test.MME.sctp "Slow Start Threshold 5:192.168.1.1" ETV
37 4055 54 211 472 1.000060799993 1.000155679983 2 0 65535 65535 4294836225
vector 38 Test.MME.sctp "Congestion Window 5:192.168.1.1" ETV
38 4109 53 211 472 1.000060799993 1.000155679983 2 0 4380 4380 19184400
vector 41 Test.MME.sctp "HB Sent 5:192.168.1.1" ETV
41 4328 25 211 211 1.000060799993 1.000060799993 1 1 1 1 1
vector 35 Test.MME.sctp "RTO 5:192.168.1.1" ETV
35 4162 75 211 472 1.000060799993 1.000155679983 3 0 3 4 10
vector 48 Test.HSS.sctp "Slow Start Threshold 8:192.168.1.2" ETV
48 5763 174 212 687 1.000060799993 34.000047199995 6 0 65535 327675 21474181125
vector 49 Test.HSS.sctp "Congestion Window 8:192.168.1.2" ETV
49 5937 169 212 687 1.000060799993 34.000047199995 6 0 4380 21900 95922000
vector 52 Test.HSS.sctp "HB Sent 8:192.168.1.2" ETV
52 6667 25 212 212 1.000060799993 1.000060799993 1 1 1 1 1
vector 46 Test.HSS.sctp "RTO 8:192.168.1.2" ETV
46 6106 153 212 687 1.000060799993 34.000047199995 6 0 3 7 13
vector 86 Test.MME.sctp "SendQueue of Association 5" ETV
86 4428 25 218 218 1.000060799993 1.000060799993 1 0 0 0 0
vector 39 Test.MME.sctp "TSN Sent 5:192.168.1.1" ETV
39 4300 28 218 218 1.000060799993 1.000060799993 1 1000 1000 1000 1000000
vector 89 Test.HSS.sctp "SendQueue of Association 8" ETV
89 6945 102 220 636 1.000060799993 28.708826562156 4 0 0 0 0
vector 50 Test.HSS.sctp "TSN Sent 8:192.168.1.2" ETV
50 6439 114 220 636 1.000060799993 28.708826562156 4 1000 1003 4006 4012014
vector 66 Test.MME.sctp "HB ACK Received 9:192.168.1.1" ETV
66 5491 25 251 251 1.000067679992 1.000067679992 1 1 1 1 1
vector 58 Test.MME.sctp "RTT 9:192.168.1.1" ETV
58 4972 218 251 687 1.000067679992 34.000047199995 6 0 0.200019199998 0.600117439987 0.1200222751551
vector 77 Test.HSS.sctp "HB ACK Received 10:192.168.1.2" ETV
77 4002 25 252 252 1.000067679992 1.000067679992 1 1 1 1 1
vector 69 Test.HSS.sctp "RTT 10:192.168.1.2" ETV
69 3837 63 252 471 1.000067679992 1.000155679983 2 0 2.0479997e-005 2.0479997e-005 4.1943027712001e-010
vector 64 Test.MME.sctp "HB ACK Sent 9:192.168.1.1" ETV
64 5466 25 271 271 1.000074559991 1.000074559991 1 1 1 1 1
vector 65 Test.MME.sctp "HB Received 9:192.168.1.1" ETV
65 5441 25 271 271 1.000074559991 1.000074559991 1 1 1 1 1
vector 75 Test.HSS.sctp "HB ACK Sent 10:192.168.1.2" ETV
75 3977 25 272 272 1.000074559991 1.000074559991 1 1 1 1 1
vector 76 Test.HSS.sctp "HB Received 10:192.168.1.2" ETV
76 3952 25 272 272 1.000074559991 1.000074559991 1 1 1 1 1
vector 62 Test.MME.sctp "TSN Received 9:192.168.1.1" ETV
62 5303 113 299 650 1.00009423999 28.708838882155 4 1000 1003 4006 4012014
vector 32 Test.MME.sctp "Advertised Receiver Window 4" ETV
32 5516 146 299 669 1.00009423999 28.908838882155 5 65375 65535 327515 21453235525
vector 73 Test.HSS.sctp "TSN Received 10:192.168.1.2" ETV
73 3900 27 300 300 1.00009423999 1.00009423999 1 1000 1000 1000 1000000
vector 33 Test.HSS.sctp "Advertised Receiver Window 7" ETV
33 4027 28 300 300 1.00009423999 1.00009423999 1 65375 65375 65375 4273890625
vector 83 Test.MME.sctp "SendQueue of Association 9" ETV
83 5662 101 314 618 1.00009423999 28.708815202157 4 0 0 0 0
vector 61 Test.MME.sctp "TSN Sent 9:192.168.1.1" ETV
61 5190 113 314 618 1.00009423999 28.708815202157 4 2000 2003 8006 16024014
vector 44 Test.MME.sctp "HB ACK Received 5:192.168.1.1" ETV
44 4403 25 339 339 1.000101119989 1.000101119989 1 1 1 1 1
vector 36 Test.MME.sctp "RTT 5:192.168.1.1" ETV
36 4237 63 339 472 1.000101119989 1.000155679983 2 0 4.0319996e-005 4.0319996e-005 1.62570207744e-009
vector 55 Test.HSS.sctp "HB ACK Received 8:192.168.1.2" ETV
55 6742 25 340 340 1.000101119989 1.000101119989 1 1 1 1 1
vector 47 Test.HSS.sctp "RTT 8:192.168.1.2" ETV
47 6259 180 340 687 1.000101119989 34.000047199995 5 0 0.200019199998 0.60009695999 0.12002265869328
vector 51 Test.HSS.sctp "TSN Received 8:192.168.1.2" ETV
51 6553 114 372 632 1.000128639987 28.708826562156 4 2000 2003 8006 16024014
vector 45 Test.HSS.sctp "Advertised Receiver Window 8" ETV
45 6767 178 372 654 1.000128639987 28.908826562156 6 65363 65535 393038 25746502894
file 13724 1344238656
version 2
run General-0-20120709-16:16:37-6492
attr configname General
attr datetime 20120709-16:16:37
attr experiment General
attr inifile omnetpp.ini
attr iterationvars ""
attr iterationvars2 $repetition=0
attr measurement ""
attr network Test
attr processid 6492
attr repetition 0
attr replication #0
attr resultdir results
attr runnumber 0
attr seedset 0
vector 4 Test.MME.eth[0].mac framesSent ETV
4 7520 541 27 678 1.000006719999 28.908845762154 22 1 22 253 3795
vector 6 Test.MME.eth[0].mac bytesSent ETV
6 8602 583 27 678 1.000006719999 28.908845762154 22 64 2116 24154 35499636
vector 20 Test.HSS.eth[0].mac framesSent ETV
20 10825 563 28 663 1.000006719999 28.908833442155 22 1 22 253 3795
vector 22 Test.HSS.eth[0].mac bytesSent ETV
22 11951 605 28 663 1.000006719999 28.908833442155 22 64 1956 22434 29915876
vector 21 Test.HSS.eth[0].mac framesReceivedOK ETV
21 11388 563 29 679 1.000006719999 28.908845762154 22 1 22 253 3795
vector 23 Test.HSS.eth[0].mac bytesReceivedOK ETV
23 12556 605 29 679 1.000006719999 28.908845762154 22 64 2116 24154 35499636
vector 27 Test.HSS.eth[0].mac framesPassedToHL ETV
27 13161 563 29 679 1.000006719999 28.908845762154 22 1 22 253 3795
vector 5 Test.MME.eth[0].mac framesReceivedOK ETV
5 8061 541 30 664 1.000006719999 28.908833442155 22 1 22 253 3795
vector 7 Test.MME.eth[0].mac bytesReceivedOK ETV
7 9185 583 30 664 1.000006719999 28.908833442155 22 64 1956 22434 29915876
vector 11 Test.MME.eth[0].mac framesPassedToHL ETV
11 9768 563 30 664 1.000006719999 28.908833442155 22 1 22 253 3795
vector 18 Test.HSS.eth[0].queue "queue length" ETV
18 10331 494 44 412 1.000006719999 1.000142239985 20 0 2 14 18
vector 2 Test.MME.eth[0].queue "queue length" ETV
2 7047 473 46 365 1.000006719999 1.000128639987 20 0 2 14 18
vector 70 Test.HSS.sctp "Slow Start Threshold 10:192.168.1.2" ETV
70 3655 54 141 471 1.000047199995 1.000155679983 2 0 65535 65535 4294836225
vector 71 Test.HSS.sctp "Congestion Window 10:192.168.1.2" ETV
71 3709 53 141 471 1.000047199995 1.000155679983 2 0 4380 4380 19184400
vector 74 Test.HSS.sctp "HB Sent 10:192.168.1.2" ETV
74 3927 25 141 141 1.000047199995 1.000047199995 1 1 1 1 1
vector 68 Test.HSS.sctp "RTO 10:192.168.1.2" ETV
68 3762 75 141 471 1.000047199995 1.000155679983 3 0 3 4 10
vector 59 Test.MME.sctp "Slow Start Threshold 9:192.168.1.1" ETV
59 4453 173 142 687 1.000047199995 34.000047199995 6 0 65535 327675 21474181125
vector 60 Test.MME.sctp "Congestion Window 9:192.168.1.1" ETV
60 4626 168 142 687 1.000047199995 34.000047199995 6 0 4380 21900 95922000
vector 63 Test.MME.sctp "HB Sent 9:192.168.1.1" ETV
63 5416 25 142 142 1.000047199995 1.000047199995 1 1 1 1 1
vector 57 Test.MME.sctp "RTO 9:192.168.1.1" ETV
57 4794 178 142 687 1.000047199995 34.000047199995 7 0 3 8 14
vector 42 Test.MME.sctp "HB ACK Sent 5:192.168.1.1" ETV
42 4378 25 183 183 1.000054079994 1.000054079994 1 1 1 1 1
vector 43 Test.MME.sctp "HB Received 5:192.168.1.1" ETV
43 4353 25 183 183 1.000054079994 1.000054079994 1 1 1 1 1
vector 53 Test.HSS.sctp "HB ACK Sent 8:192.168.1.2" ETV
53 6717 25 184 184 1.000054079994 1.000054079994 1 1 1 1 1
vector 54 Test.HSS.sctp "HB Received 8:192.168.1.2" ETV
54 6692 25 184 184 1.000054079994 1.000054079994 1 1 1 1 1
vector 37 Test.MME.sctp "Slow Start Threshold 5:192.168.1.1" ETV
37 4055 54 211 472 1.000060799993 1.000155679983 2 0 65535 65535 4294836225
vector 38 Test.MME.sctp "Congestion Window 5:192.168.1.1" ETV
38 4109 53 211 472 1.000060799993 1.000155679983 2 0 4380 4380 19184400
vector 41 Test.MME.sctp "HB Sent 5:192.168.1.1" ETV
41 4328 25 211 211 1.000060799993 1.000060799993 1 1 1 1 1
vector 35 Test.MME.sctp "RTO 5:192.168.1.1" ETV
35 4162 75 211 472 1.000060799993 1.000155679983 3 0 3 4 10
vector 48 Test.HSS.sctp "Slow Start Threshold 8:192.168.1.2" ETV
48 5763 174 212 687 1.000060799993 34.000047199995 6 0 65535 327675 21474181125
vector 49 Test.HSS.sctp "Congestion Window 8:192.168.1.2" ETV
49 5937 169 212 687 1.000060799993 34.000047199995 6 0 4380 21900 95922000
vector 52 Test.HSS.sctp "HB Sent 8:192.168.1.2" ETV
52 6667 25 212 212 1.000060799993 1.000060799993 1 1 1 1 1
vector 46 Test.HSS.sctp "RTO 8:192.168.1.2" ETV
46 6106 153 212 687 1.000060799993 34.000047199995 6 0 3 7 13
vector 86 Test.MME.sctp "SendQueue of Association 5" ETV
86 4428 25 218 218 1.000060799993 1.000060799993 1 0 0 0 0
vector 39 Test.MME.sctp "TSN Sent 5:192.168.1.1" ETV
39 4300 28 218 218 1.000060799993 1.000060799993 1 1000 1000 1000 1000000
vector 89 Test.HSS.sctp "SendQueue of Association 8" ETV
89 6945 102 220 636 1.000060799993 28.708826562156 4 0 0 0 0
vector 50 Test.HSS.sctp "TSN Sent 8:192.168.1.2" ETV
50 6439 114 220 636 1.000060799993 28.708826562156 4 1000 1003 4006 4012014
vector 66 Test.MME.sctp "HB ACK Received 9:192.168.1.1" ETV
66 5491 25 251 251 1.000067679992 1.000067679992 1 1 1 1 1
vector 58 Test.MME.sctp "RTT 9:192.168.1.1" ETV
58 4972 218 251 687 1.000067679992 34.000047199995 6 0 0.200019199998 0.600117439987 0.1200222751551
vector 77 Test.HSS.sctp "HB ACK Received 10:192.168.1.2" ETV
77 4002 25 252 252 1.000067679992 1.000067679992 1 1 1 1 1
vector 69 Test.HSS.sctp "RTT 10:192.168.1.2" ETV
69 3837 63 252 471 1.000067679992 1.000155679983 2 0 2.0479997e-05 2.0479997e-05 4.1943027712001e-10
vector 64 Test.MME.sctp "HB ACK Sent 9:192.168.1.1" ETV
64 5466 25 271 271 1.000074559991 1.000074559991 1 1 1 1 1
vector 65 Test.MME.sctp "HB Received 9:192.168.1.1" ETV
65 5441 25 271 271 1.000074559991 1.000074559991 1 1 1 1 1
vector 75 Test.HSS.sctp "HB ACK Sent 10:192.168.1.2" ETV
75 3977 25 272 272 1.000074559991 1.000074559991 1 1 1 1 1
vector 76 Test.HSS.sctp "HB Received 10:192.168.1.2" ETV
76 3952 25 272 272 1.000074559991 1.000074559991 1 1 1 1 1
vector 62 Test.MME.sctp "TSN Received 9:192.168.1.1" ETV
62 5303 113 299 650 1.00009423999 28.708838882155 4 1000 1003 4006 4012014
vector 32 Test.MME.sctp "Advertised Receiver Window 4" ETV
32 5516 146 299 669 1.00009423999 28.908838882155 5 65375 65535 327515 21453235525
vector 73 Test.HSS.sctp "TSN Received 10:192.168.1.2" ETV
73 3900 27 300 300 1.00009423999 1.00009423999 1 1000 1000 1000 1000000
vector 33 Test.HSS.sctp "Advertised Receiver Window 7" ETV
33 4027 28 300 300 1.00009423999 1.00009423999 1 65375 65375 65375 4273890625
vector 83 Test.MME.sctp "SendQueue of Association 9" ETV
83 5662 101 314 618 1.00009423999 28.708815202157 4 0 0 0 0
vector 61 Test.MME.sctp "TSN Sent 9:192.168.1.1" ETV
61 5190 113 314 618 1.00009423999 28.708815202157 4 2000 2003 8006 16024014
vector 44 Test.MME.sctp "HB ACK Received 5:192.168.1.1" ETV
44 4403 25 339 339 1.000101119989 1.000101119989 1 1 1 1 1
vector 36 Test.MME.sctp "RTT 5:192.168.1.1" ETV
36 4237 63 339 472 1.000101119989 1.000155679983 2 0 4.0319996e-05 4.0319996e-05 1.62570207744e-09
vector 55 Test.HSS.sctp "HB ACK Received 8:192.168.1.2" ETV
55 6742 25 340 340 1.000101119989 1.000101119989 1 1 1 1 1
vector 47 Test.HSS.sctp "RTT 8:192.168.1.2" ETV
47 6259 180 340 687 1.000101119989 34.000047199995 5 0 0.200019199998 0.60009695999 0.12002265869328
vector 51 Test.HSS.sctp "TSN Received 8:192.168.1.2" ETV
51 6553 114 372 632 1.000128639987 28.708826562156 4 2000 2003 8006 16024014
vector 45 Test.HSS.sctp "Advertised Receiver Window 8" ETV
45 6767 178 372 654 1.000128639987 28.908826562156 6 65363 65535 393038 25746502894
......@@ -215,7 +215,7 @@ void S1APConnection::performStateTransition(S1APConnectionEvent &event, OpenType
void S1APConnection::send(S1APPdu *msg) {
cPacket* cmsg = new cPacket();
SCTPSimpleMessage* smsg = new SCTPSimpleMessage();
PerEncoder perEnc = PerEncoder();
PerEncoder perEnc = PerEncoder(ALIGNED);
msg->encode(perEnc);
smsg->setDataArraySize(perEnc.getLength());
......
......@@ -190,7 +190,7 @@ enum RrcEstablishmentCauseValues {
typedef Enumerated<EXTCONSTRAINED, 4> RrcEstablishmentCause;
typedef BitString<CONSTRAINED, 256, 256> SecurityKey;
typedef BitString<CONSTRAINED, 256, 256> SecurityKey;
typedef OctetString<CONSTRAINED, 2, 2> Tac;
......
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include "RRC.h"
#include "RRCPdu.h"
#include "PerEncoder.h"
#include "LTEUtils.h"
RRC::RRC() {
// TODO Auto-generated constructor stub
}
RRC::~RRC() {
// TODO Auto-generated destructor stub
}
void RRC::initialize(int stage) {
char lac[2] = {0x5b, 0x10};
char tmsi[4] = {0x19, 0x02, 0x2c, 0xba};
std::vector<unsigned char> mcc;
std::vector<unsigned char> mnc;
mcc.push_back(2);
mcc.push_back(6);
mcc.push_back(0);
mnc.push_back(0);
mnc.push_back(2);
PlmnIdentity plmnId = PlmnIdentity(mcc, mnc);
Lai lai = Lai(plmnId, lac);
TmsiAndLaiGsmMap *tmsiAndLaiGsmMap = new TmsiAndLaiGsmMap(tmsi, lai);
InitialUeIdentity initUeId = InitialUeIdentity();
initUeId.setValue(tmsiAndLaiGsmMap, tmsiAndLai);
RRCConnectionRequest rrcConnReq = RRCConnectionRequest(initUeId, interRATCellReselection, noError);
PerEncoder perEnc = PerEncoder(UNALIGNED);
perEnc.encodeSequence(rrcConnReq);
LTEUtils().printBytes(perEnc.getBuffer(), perEnc.getLength());
}
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#ifndef RRC_H_
#define RRC_H_
class RRC {
public:
RRC();
virtual ~RRC();
void initialize(int stage);
};
#endif /* RRC_H_ */
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
package inet.linklayer.lte.rrc;
simple RRC
{
}
\ No newline at end of file
at the moment only mandatory information elements are inserted in messages (add optional elements too).
\ No newline at end of file
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include "RRCIe.h"
const void *ImsiAndEsnDs41::itemsInfo[2] = {
&ImsiDs41::theInfo,
&EsnDs41::theInfo,
};
bool ImsiAndEsnDs41::itemsPres[2] = {
1,
1
};
Mcc *toMcc(std::vector<unsigned char> mcc) {
Mcc *ret = new Mcc();
for (unsigned i = 0; i < mcc.size(); i++)
ret->push_back(Digit(mcc.at(i)));
return ret;
}
std::vector<unsigned char> fromMcc(Mcc *mcc) {
std::vector<unsigned char> ret;
for (unsigned i = 0; i < mcc->size(); i++)
ret.push_back(static_cast<const Digit>(mcc->at(i)).getValue());
return ret;
}
Mnc *toMnc(std::vector<unsigned char> mnc) {
Mnc *ret = new Mnc();
for (unsigned i = 0; i < mnc.size(); i++)
ret->push_back(Digit(mnc.at(i)));
return ret;
}
std::vector<unsigned char> fromMnc(Mcc *mnc) {
std::vector<unsigned char> ret;
for (unsigned i = 0; i < mnc->size(); i++)
ret.push_back(static_cast<const Digit>(mnc->at(i)).getValue());
return ret;
}
const void *PlmnIdentity::itemsInfo[2] = {
&Mcc::theInfo,
&Mnc::theInfo,
};
bool PlmnIdentity::itemsPres[2] = {
1,
1
};
PlmnIdentity::PlmnIdentity(std::vector<unsigned char>mcc, std::vector<unsigned char>mnc) : Sequence(&theInfo) {
setMcc(mcc);
setMnc(mnc);
}
const void *Lai::itemsInfo[2] = {
&PlmnIdentity::theInfo,
&Lac::theInfo,
};
bool Lai::itemsPres[2] = {
1,
1
};
Lai::Lai(PlmnIdentity& plmnId, char *lac) : Sequence(&theInfo) {
setPlmnIdentity(plmnId);
setLac(lac);
}
const void *Rai::itemsInfo[2] = {
&Lai::theInfo,
&RoutingAreaCode::theInfo,
};
bool Rai::itemsPres[2] = {
1,
1
};
const void *PTmsiAndRaiGsmMap::itemsInfo[2] = {
&PTmsiGsmMap::theInfo,
&Rai::theInfo,
};
bool PTmsiAndRaiGsmMap::itemsPres[2] = {
1,
1
};
const void *TmsiAndLaiGsmMap::itemsInfo[2] = {
&TmsiGsmMap::theInfo,
&Lai::theInfo,
};
bool TmsiAndLaiGsmMap::itemsPres[2] = {
1,
1
};
TmsiAndLaiGsmMap::TmsiAndLaiGsmMap(char *tmsi, Lai& lai) : Sequence(&theInfo) {
setTmsiGsmMap(tmsi);
setLai(lai);
}
const void *InitialUeIdentity::choicesInfo[8] = {
&ImsiGsmMap::theInfo,
&TmsiAndLaiGsmMap::theInfo,
&PTmsiAndRaiGsmMap::theInfo,
&Imei::theInfo,
&EsnDs41::theInfo,
&ImsiDs41::theInfo,
&ImsiAndEsnDs41::theInfo,
&TmsiDs41::theInfo,
};
const InitialUeIdentity::Info InitialUeIdentity::theInfo = {
Choice::create,
CHOICE,
0,
true,
choicesInfo,
7
};
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#ifndef RRCIE_H_
#define RRCIE_H_
#include "ASNTypes.h"
/*
* Simple RRC message information elements.
*/
typedef Integer<CONSTRAINED, 0, 9> Digit;
typedef BitString<CONSTRAINED, 32, 32> EsnDs41;
enum EstablishmentCauseValues {
originatingConversationalCall,
originatingStreamingCall,
originatingInteractiveCall,
originatingBackgroundCall,
originatingSubscribedTrafficCall,
terminatingConversationalCall,
terminatingStreamingCall,
terminatingInteractiveCall,
terminatingBackgroundCall,
emergencyCall,
interRATCellReselection,
interRATCellChangeOrder,
registration,
detach,
originatingHighPrioritySignalling,
originatingLowPrioritySignalling,
callReestablishment,
terminatingHighPrioritySignalling,
terminatingLowPrioritySignalling,
terminatingCauseUnknown,
mbmsReception,
mbmsPTPRBRequest,
spare10,
spare9,
spare8,
spare7,
spare6,
spare5,
spare4,
spare3,
spare2,
spare1
};
typedef Enumerated<CONSTRAINED, 32> EstablishmentCause;
typedef Integer<CONSTRAINED, 0, 15> ImeiDigit;
typedef OctetString<CONSTRAINED, 5, 7> ImsiDs41;
typedef BitString<CONSTRAINED, 16, 16> Lac;
enum ProtocolErrorIndicatorValues {
noError,
errorOcurred
};
typedef Enumerated<CONSTRAINED, 2> ProtocolErrorIndicator;
typedef BitString<CONSTRAINED, 32, 32> PTmsiGsmMap;
typedef BitString<CONSTRAINED, 8, 8> RoutingAreaCode;
typedef OctetString<CONSTRAINED, 2, 17> TmsiDs41;
typedef BitString<CONSTRAINED, 32, 32> TmsiGsmMap;
/*
* Compound RRC message information elements.
*/
typedef SequenceOf<Digit, CONSTRAINED, 15, 15> Imei;
//ERabToBeSetupListCtxtSuReq *toERabToBeSetupListCtxtSuReq(std::vector<BearerContext*> bearers);
//std::vector<BearerContext*> fromERabToBeSetupListCtxtSuReq(ERabToBeSetupListCtxtSuReq *eRabToBeSetupListCtxtSuReq);
class ImsiAndEsnDs41 : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
ImsiAndEsnDs41() : Sequence(&theInfo) {}
// AllocationAndRetentionPriority(unsigned char prioLvl = 0, unsigned char preCapab = 0, unsigned char preVul = 0, ProtocolExtContainer *exts = NULL);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
// void setPriorityLevel(unsigned char prioLvl) { static_cast<PriorityLevel*>(items[0])->setValue(prioLvl); }
// void setPreEmptionCapability(unsigned char preCapab) { static_cast<PriorityLevel*>(items[1])->setValue(preCapab); }
// void setPreEmptionVulnerability(unsigned char preVul) { static_cast<PriorityLevel*>(items[2])->setValue(preVul); }
// void setProtocolExtContainer(ProtocolExtContainer *exts);
};
typedef SequenceOf<Digit, CONSTRAINED, 6, 21> ImsiGsmMap;
//ERabToBeSetupListCtxtSuReq *toERabToBeSetupListCtxtSuReq(std::vector<BearerContext*> bearers);
//std::vector<BearerContext*> fromERabToBeSetupListCtxtSuReq(ERabToBeSetupListCtxtSuReq *eRabToBeSetupListCtxtSuReq);
typedef SequenceOf<Digit, CONSTRAINED, 3, 3> Mcc;
Mcc *toMcc(std::vector<unsigned char> mcc);
std::vector<unsigned char> fromMcc(Mcc *mcc);
typedef SequenceOf<Digit, CONSTRAINED, 2, 3> Mnc;
Mnc *toMnc(std::vector<unsigned char> mnc);
std::vector<unsigned char> fromMnc(Mnc *mnc);
class MeasuredResultsOnRACH : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
MeasuredResultsOnRACH() : Sequence(&theInfo) {}
// AllocationAndRetentionPriority(unsigned char prioLvl = 0, unsigned char preCapab = 0, unsigned char preVul = 0, ProtocolExtContainer *exts = NULL);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
// void setPriorityLevel(unsigned char prioLvl) { static_cast<PriorityLevel*>(items[0])->setValue(prioLvl); }
// void setPreEmptionCapability(unsigned char preCapab) { static_cast<PriorityLevel*>(items[1])->setValue(preCapab); }
// void setPreEmptionVulnerability(unsigned char preVul) { static_cast<PriorityLevel*>(items[2])->setValue(preVul); }
// void setProtocolExtContainer(ProtocolExtContainer *exts);
};
class PlmnIdentity : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
PlmnIdentity() : Sequence(&theInfo) {}
PlmnIdentity(std::vector<unsigned char> mcc, std::vector<unsigned char>mnc);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
void setMcc(std::vector<unsigned char> mcc) { *static_cast<Mcc*>(items[0]) = toMcc(mcc); }
void setMnc(std::vector<unsigned char>mnc) { *static_cast<Mnc*>(items[1]) = toMnc(mnc); }
};
class Lai : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
Lai() : Sequence(&theInfo) {}
Lai(PlmnIdentity& plmnId, char *lac);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
void setPlmnIdentity(PlmnIdentity& plmnId) { *static_cast<PlmnIdentity*>(items[0]) = plmnId; }
void setLac(char *lac) { static_cast<Lac*>(items[1])->setValue(lac); }
};
class Rai : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
Rai() : Sequence(&theInfo) {}
// AllocationAndRetentionPriority(unsigned char prioLvl = 0, unsigned char preCapab = 0, unsigned char preVul = 0, ProtocolExtContainer *exts = NULL);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
// void setPriorityLevel(unsigned char prioLvl) { static_cast<PriorityLevel*>(items[0])->setValue(prioLvl); }
// void setPreEmptionCapability(unsigned char preCapab) { static_cast<PriorityLevel*>(items[1])->setValue(preCapab); }
// void setPreEmptionVulnerability(unsigned char preVul) { static_cast<PriorityLevel*>(items[2])->setValue(preVul); }
// void setProtocolExtContainer(ProtocolExtContainer *exts);
};
class PTmsiAndRaiGsmMap : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
PTmsiAndRaiGsmMap() : Sequence(&theInfo) {}
// AllocationAndRetentionPriority(unsigned char prioLvl = 0, unsigned char preCapab = 0, unsigned char preVul = 0, ProtocolExtContainer *exts = NULL);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
// void setPriorityLevel(unsigned char prioLvl) { static_cast<PriorityLevel*>(items[0])->setValue(prioLvl); }
// void setPreEmptionCapability(unsigned char preCapab) { static_cast<PriorityLevel*>(items[1])->setValue(preCapab); }
// void setPreEmptionVulnerability(unsigned char preVul) { static_cast<PriorityLevel*>(items[2])->setValue(preVul); }
// void setProtocolExtContainer(ProtocolExtContainer *exts);
};
class TmsiAndLaiGsmMap : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
TmsiAndLaiGsmMap() : Sequence(&theInfo) {}
TmsiAndLaiGsmMap(char *tmsi, Lai& lai);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
void setTmsiGsmMap(char *tmsi) { static_cast<TmsiGsmMap*>(items[0])->setValue(tmsi); }
void setLai(Lai& lai) { *static_cast<Lai*>(items[0]) = lai; }
};
enum InitialUeIdentityChoices {
imsi = 0,
tmsiAndLai = 1,
pTmsiAndRai = 2,
imei = 3,
esnDs41 = 4,
imsiDs41 = 5,
imsiAndEsnDs41 = 6,
tmsiAndDs41 = 7
};
class InitialUeIdentity : public Choice {
private:
static const void *choicesInfo[8];
public:
static const Info theInfo;
InitialUeIdentity() : Choice(&theInfo) {}
// void setId(char *id);
// char *getId();
};
class V3d0NonCriticalExtensions : public Sequence {
private:
static const void *itemsInfo[2];
static bool itemsPres[2];
public:
static const Info theInfo;
V3d0NonCriticalExtensions() : Sequence(&theInfo) {}
// AllocationAndRetentionPriority(unsigned char prioLvl = 0, unsigned char preCapab = 0, unsigned char preVul = 0, ProtocolExtContainer *exts = NULL);
// unsigned char getPriorityLevel() const { return static_cast<PriorityLevel*>(items[0])->getValue(); }
// unsigned char getPreEmptionCapability() const { return static_cast<PreEmptionCapability*>(items[1])->getValue(); }
// unsigned char getPreEmptionVulnerability() const { return static_cast<PreEmptionVulnerability*>(items[2])->getValue(); }
//
// void setPriorityLevel(unsigned char prioLvl) { static_cast<PriorityLevel*>(items[0])->setValue(prioLvl); }
// void setPreEmptionCapability(unsigned char preCapab) { static_cast<PriorityLevel*>(items[1])->setValue(preCapab); }
// void setPreEmptionVulnerability(unsigned char preVul) { static_cast<PriorityLevel*>(items[2])->setValue(preVul); }
// void setProtocolExtContainer(ProtocolExtContainer *exts);
};
#endif /* RRCIE_H_ */
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include "RRCPdu.h"
const void *RRCConnectionRequest::itemsInfo[5] = {
&InitialUeIdentity::theInfo,
&EstablishmentCause::theInfo,
&ProtocolErrorIndicator::theInfo,
&MeasuredResultsOnRACH::theInfo,
&V3d0NonCriticalExtensions::theInfo,
};
bool RRCConnectionRequest::itemsPres[5] = {
1,
1,
1,
0,
0
};
RRCConnectionRequest::RRCConnectionRequest(InitialUeIdentity& initUeId, unsigned char estCause, bool protErrInd, MeasuredResultsOnRACH *measResOnRach, V3d0NonCriticalExtensions *v3d0NonCritExt) : Sequence(&theInfo) {
setInitialUeIdentity(initUeId);
setEstablishmentCause(estCause);
setProtocolErrorIndicator(protErrInd);
}
//
// Copyright (C) 2012 Calin Cerchez
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#ifndef RRCPDU_H_
#define RRCPDU_H_
#include "RRCIe.h"
class RRCConnectionRequest : public Sequence {
private:
static const void *itemsInfo[5];
static bool itemsPres[5];
public:
static const Info theInfo;
RRCConnectionRequest(InitialUeIdentity& initUeId, unsigned char estCause, bool protErrInd, MeasuredResultsOnRACH *measResOnRach = NULL, V3d0NonCriticalExtensions *v3d0NonCritExt = NULL);
// unsigned char getProcedureCode() { return static_cast<IntegerBase*>(items.at(0))->getValue(); }
// OpenType *getValue() { return static_cast<OpenType*>(items.at(2)); }
//
void setInitialUeIdentity(InitialUeIdentity& initUeId) { *static_cast<InitialUeIdentity*>(items[0]) = initUeId; }
void setEstablishmentCause(unsigned char estCause) { static_cast<EstablishmentCause*>(items[1])->setValue(estCause); }
void setProtocolErrorIndicator(unsigned char protErrInd) { static_cast<ProtocolErrorIndicator*>(items[1])->setValue(protErrInd); }
};
#endif /* RRCPDU_H_ */
......@@ -17,6 +17,7 @@
package inet.nodes._4gsim;
import inet.linklayer.lte.rrc.RRC;
import inet.networklayer.ipv4.RoutingTable;
import inet.networklayer.common.InterfaceTable;
import inet.applications.pingapp.PingApp;
......@@ -30,9 +31,9 @@ import inet.mobility.BasicMobility;
module UE
{
parameters:
@display("i=device/cellphone;bgb=335,382");
@display("i=device/cellphone;bgb=512,472");
string mobilityType = default("NullMobility");
string destAddr = default("");
string destAddr = default("");
volatile double interval @unit("s") = default(1s);
int channelNumber;
string configFile;
......@@ -54,7 +55,7 @@ module UE
@display("p=55,135");
}
nas: NAS {
@display("p=266,182");
@display("p=342,174");
configFile = configFile;
channelNumber = channelNumber;
}
......@@ -71,6 +72,9 @@ module UE
routingTable: RoutingTable {
@display("p=266,54");
}
rrc: RRC {
@display("p=403,310");
}
connections allowunconnected:
radioIn --> lteRadio.radioIn;
......
......@@ -15,6 +15,7 @@
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include <errno.h>
#include "DCTDump.h"
#include "IPSerializer.h"
......
......@@ -19,6 +19,7 @@
#define DCTDUMP_H_
#include <omnetpp.h>
#include <assert.h>
#include "TCPDump.h"
/*
......
......@@ -44,7 +44,7 @@ OpenType::OpenType(char *value, int64_t length, const void *info) : AbstractType
}
OpenType::OpenType(AbstractType *val, const void *info) : AbstractType(info) {
PerEncoder enc = PerEncoder();
PerEncoder enc = PerEncoder(ALIGNED);
enc.encodeAbstractType(*val);
this->length = enc.getLength();
this->value = enc.getBuffer();
......
......@@ -18,10 +18,11 @@
#include "PerEncoder.h"
#include <omnetpp.h>
PerEncoder::PerEncoder() {
PerEncoder::PerEncoder(bool alignment) {
usedBits = 8;
length = 0;
buffer = NULL;
alignmentFlag = alignment;
}
PerEncoder::~PerEncoder() {
......@@ -98,10 +99,17 @@ void PerEncoder::print(bool type) {
void PerEncoder::encodeBytes(const char *value, int64_t length) {
// appends the bytes to the buffer and increases the size of it
this->buffer = (char *)realloc(this->buffer, this->length + length);
memcpy(this->buffer + this->length, value, length);
this->length += length;
usedBits = 8;
if (alignmentFlag == ALIGNED) {
this->buffer = (char *)realloc(this->buffer, this->length + length);
memcpy(this->buffer + this->length, value, length);
this->length += length;
usedBits = 8;
} else {
for (int64_t i = 0; i < length; i++) {
encodeBits(value[i], 8);
this->length++;
}
}
}
bool PerEncoder::encodeSmallNumber(int64_t value) {
......@@ -173,7 +181,6 @@ void PerEncoder::encodeValue(int64_t value, int64_t size) {
char tmp = (char)(value >> i * 8);
encodeBytes(&tmp, 1);
}
usedBits = 8;
}
bool PerEncoder::encodeAbstractType(const AbstractType& abstractType) {
......
......@@ -27,6 +27,9 @@
#define BIN 0
#define HEX 1
#define ALIGNED 0
#define UNALIGNED 1
/*
* Class for encoding ASN.1 types. The encoder will produce a buffer according to PER
* rules. It will start with an empty buffer and add bytes to it according to desired
......@@ -37,6 +40,7 @@ private:
short usedBits;
int64_t length;
char *buffer;
bool alignmentFlag;
/* Utility methods for encoding */
bool encodeConstrainedValue(int64_t lowerBound, int64_t upperBound, int64_t value);
......@@ -49,7 +53,7 @@ private:
void encodeValue(int64_t value, int64_t length);
public:
PerEncoder();
PerEncoder(bool alignment);
virtual ~PerEncoder();
/* Encoding methods */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册