Commit c2005144 authored by Ferreira's avatar Ferreira
Browse files

Added SPECTRA modifications for demo polishing and bug fixing (v1.13)



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5891 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 423d69b0
......@@ -7,7 +7,7 @@
#
# Rui Costa <ferreira@eurecom.fr>
#
# v1.12 (13 Oct 2014)
# v1.13 (15 Oct 2014)
#
########################################
......@@ -83,6 +83,14 @@
2.3. CRM
This component of the demo MUST be compiled and installed separately.
Check <spectra_root_folder>/CRM/ for more details.
There is a google app that must be running in the google cloud,
and it's url configured in the source code. The local client is based
on the C++ REST framework codenamed "Casablanca".
Furthermore you need to compile the local client components
(CRMClient and CRMMain).
In the CRM client you will find a folder <tosend> which includes some
basic scripts that populate the google app database, and show how to
interact with it.
2.4. TVWS Sensing Measurements
There is a server and client for simulating the TVWS measurements and
......@@ -180,7 +188,7 @@
########################################
################################################################################
CHANGELOG
v0.99 (03/09/2014)
......@@ -248,4 +256,15 @@ v1.12 (13/10/2014)
- Added final version to openair svn
- Reworked README file.
v1.13 (15/10/2014)
- Polishing of the demo
- Added bug fixes on launch scripts for enb1
- Added feature to put measurements on CRM from enb1
- Changed readable output of received measurement reports on enb2
- Added more informative output on the sensingClient (TVWS)
- Demonstration now stops at end of MIH_Link_Actions.confirm
message on MIH_User of enb2
- Added info on sensing client and CRM
- Reworked README file.
################################################################################ EOF
......@@ -109,10 +109,10 @@ void *connection_handler(int fd) {
/* now loop, receiving data and printing what we received */
for (;;) {
printf("---\n Waiting on port %d\n", PORT);
printf("\n[SPECTRA Sensing Module] Started!\n[SPECTRA Sensing Module] ---\n[SPECTRA Sensing Module] Waiting on port %d\n", PORT);
recvlen = recvfrom(fd, rawPacket, MAX_PACKET_SIZE, 0,
(struct sockaddr *) &remaddr, &addrlen);
printf("Received %d bytes > ", recvlen);
printf("\n[SPECTRA Sensing Module] Received Data (%d bytes) > ", recvlen);
for (i=0; i<recvlen;i++){
printf("%x ", (rawPacket[i] & 0xff));
......@@ -126,7 +126,7 @@ void *connection_handler(int fd) {
} else {
request = assembleMessage(&rawPacket);
printf(" > Received spectra packet %i of type %i for function %i with %i parameters\n",
printf("\n[SPECTRA Sensing Module] > Received spectra packet %i of type %i for function %i with %i parameters\n",
request.messageID,
(uint32_t) request.type, (uint32_t) request.function,
(uint32_t) request.numberOfparameters);
......@@ -135,7 +135,7 @@ void *connection_handler(int fd) {
if (request.type == EndProcessing) {
returnMessage = createReturnPacket(&request, 0, EndProcessing);
printf("End processing!!!\n");
printf("\n[SPECTRA Sensing Module] Received: End of cognitive algorithm processing!\n");
fflush(stdout);
} else {
if (request.function == EnergyDetection) {
......@@ -143,11 +143,11 @@ void *connection_handler(int fd) {
// circular loop over the score list
scoreIndex = (scoreIndex < (sizeof(scoresList)/ sizeof(scoresList[0]))) ?
scoreIndex : 0;
printf("Score value: %16llx (%lld)\n",
printf("\n[SPECTRA Sensing Module] Received: Energy Detection Request!\n");
printf("\n[SPECTRA Sensing Module] Processing Score value: %16llx (%lld)\n",
(long long int)scoresList[scoreIndex],
(long long int)scoresList[scoreIndex]);
printf("Score host to network value: 0x%016llx (%lld)\n",
printf("\n[SPECTRA Sensing Module] Processing Score host to network value: 0x%016llx (%lld)\n",
(long long int)htonll(scoresList[scoreIndex]),
(long long int)htonll(scoresList[scoreIndex]));
......@@ -157,6 +157,7 @@ void *connection_handler(int fd) {
}
// Sends the answer
printf("\n[SPECTRA Sensing Module] Sending: Reply Message!\n");
int retError = returnSpectraPacket(returnMessage, fd, remaddr);
if (retError == -1) {
perror("Send failed!!!\n");
......@@ -203,7 +204,7 @@ int socketBind() {
perror("bind failed");
return 0;
}
puts("bind done");
puts("\n[SPECTRA Sensing Module] Initialization done");
return fd;
}
......
......@@ -1395,18 +1395,36 @@ void mih_user::receive_MIH_Link_Parameters_Report(odtone::mih::message& msg, con
log_(0, "[MSC_MSG]["+getTimeStamp4Log()+"]["+ msg.source().to_string() +"][--- MIH_Link_Parameters_Report.indication --->]["+msg.destination().to_string()+"]\n");
log_(0, " - LINK_TUPLE_ID - Link identifier: ", link_id2string(link).c_str());
std::cout<<"LINK_TUPLE_ID - Link identifier: "<<link<<std::endl;
for (odtone::mih::link_param_rpt_list::iterator i=lprl.begin(); i!=lprl.end(); i++)
{
log_(0, "Meausrement Type: --- 0 => RSRP ----- 1=>RSRQ ---- 2=>CQI ", i->param.type);
if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
{
log_(0, "Meausrement Value: ", (short) *value );
// ferreira: Upload of measurements to gae-spectra.com
// FIXME This will not work for: more than 3 types of measurements OR out of sequence types of measurements
std::string crmc_cmd_str;
std::stringstream crmc_ss;
std::string result;
if (count % 10 == 0) // All measures at CRM are outdated! do server cleanup!
result = exec ("./CRMClient DEL 2");
if (count % 3 == 0) // Add 1st measurement (RSRP)
crmc_ss << "./CRMClient PUT 2 meas_no." << count << " " << msg.source().to_string() << "_" << link_id2string(link).c_str() << " RSRP dB " << (short) *value << " 3" ;
if (count % 3 == 1) // Add 2nd measurement (RSRQ)
crmc_ss << "./CRMClient PUT 2 meas_no." << count << " " << msg.source().to_string() << "_" << link_id2string(link).c_str() << " RSRQ dB " << (short) *value << " 3" ;
if (count % 3 == 2) // Add 3rd measurement (CQI)
crmc_ss << "./CRMClient PUT 2 meas_no." << count << " " << msg.source().to_string() << "_" << link_id2string(link).c_str() << " CQI - " << (short) *value << " 3" ;
crmc_cmd_str = crmc_ss.str();
const char* crmc_cmd_cstr = crmc_cmd_str.c_str();
char* crmc_cmd_char = new char [strlen(crmc_cmd_cstr)+1];
strcpy(crmc_cmd_char, crmc_cmd_cstr);
result = exec (crmc_cmd_char);
delete [] crmc_cmd_char;
}
}
log_(0, "MIH_Link_Parameters_Report.indication - End");
//eNB1: Forward the message to UE 2
forward_Parameters_Report_indication(msg);
......
......@@ -68,8 +68,8 @@ source $THIS_SCRIPT_PATH/env_802dot21.bash
###########################################################
bash_exec "ifconfig $EMULATION_DEV_INTERFACE up $EMULATION_DEV_ADDRESS netmask 255.255.255.0"
bash_exec "ifconfig eth2 up 192.168.14.3 netmask 255.255.255.0"
#bash_exec "ip r d default dev eth0"
#bash_exec "ip r a default via 192.168.14.4 dev eth2"
bash_exec "ip r d default via 192.168.14.4 dev eth2"
bash_exec "ip r a default via 192.168.12.100 dev eth0"
###########################################################
IPTABLES=/sbin/iptables
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
......
......@@ -1372,13 +1372,15 @@ void mih_user::receive_MIH_Link_Actions_confirm(odtone::mih::message& msg)
// #endif // SCENARIO_2
log_(0, "MIH_Link_Actions.confirm - End\n");
// ferreira: Added sleep time + exit + output to make visible the end of SPECTRA demo
if( second_link_activated == 1 )
{
unsigned int pause_time = 30; // in seconds to show the result of the demo then proceed
log_(0, "\n\n\n\n\t----- Confirmed Configuration of LTE Link for TVWS -----\n");
log_(0, "\n\t----- END OF SPECTRA DEMO ! -----\n");
log_(0, "\n\n MIH User regular function will resume in (secs) : ", pause_time );
usleep(pause_time * 1000000);
// log_(0, "\n\n MIH User regular function will resume in (secs) : ", pause_time );
// usleep(pause_time * 1000000);
exit(1);
}
}
......@@ -1422,20 +1424,34 @@ void mih_user::receive_MIH_MN_HO_Candidate_Query_request(odtone::mih::message& m
& odtone::mih::tlv_link_identifier(link)
& odtone::mih::tlv_link_param_rpt_list(lprl);
log_(0, "MIH_MN_HO_Candidate_Query.request - RECEIVED - Begin");
log_(0, "\t- LINK CFG STATUS LIST - Length: ", lprl.size());
log_(0, "[MSC_MSG]["+getTimeStamp4Log()+"]["+ msg.source().to_string() +"][--- MIH_Link_Parameters_Report.indication --->]["+msg.destination().to_string()+"]\n");
log_(0, " - LINK_TUPLE_ID - Link identifier: ", link_id2string(link).c_str());
// log_(0, "MIH_MN_HO_Candidate_Query.request - RECEIVED - Begin");
// log_(0, "\t- LINK CFG STATUS LIST - Length: ", lprl.size());
// log_(0, "[MSC_MSG]["+getTimeStamp4Log()+"]["+ msg.source().to_string() +"][--- MIH_Link_Parameters_Report.indication --->]["+msg.destination().to_string()+"]\n");
// log_(0, " - LINK_TUPLE_ID - Link identifier: ", link_id2string(link).c_str());
//
// for (odtone::mih::link_param_rpt_list::iterator i=lprl.begin(); i!=lprl.end(); i++)
// {
// log_(0, "Meausrement Type: --- 0 => RSRP ----- 1=>RSRQ ---- 2=>CQI ", i->param.type);
// if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
// {
// log_(0, "Meausrement Value: ", (short) *value );
// }
// }
// ferreira: changed output of message for better readability!
log_(0, "\n["+getTimeStamp4Log()+"] [RX] [FROM: "+ msg.source().to_string() +"] [Link ID: "+ link_id2string(link).c_str() +"]");
log_(0, "\t[MIH_MN_HO_Candidate_Query [MIH_Link_Parameters_Report]]");
for (odtone::mih::link_param_rpt_list::iterator i=lprl.begin(); i!=lprl.end(); i++)
for (odtone::mih::link_param_rpt_list::iterator i=lprl.begin(); i!=lprl.end(); i++)
{
log_(0, "Meausrement Type: --- 0 => RSRP ----- 1=>RSRQ ---- 2=>CQI ", i->param.type);
if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
{
log_(0, "Meausrement Value: ", (short) *value );
}
if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
{
log_(0, "\t[Measurement Types: RSRP 0|RSRQ 1|CQI 2] [type: ", i->param.type, "| value: ", (short) *value, "]" );
}
}
//eNB2 : Action Power Up the TVWS Link after running the cognitive algorithm
//First Phase: Collect the data as input fot the cognitive algorithm
......@@ -1461,12 +1477,13 @@ void mih_user::receive_MIH_MN_HO_Candidate_Query_request(odtone::mih::message& m
// link1.type = type;
// send_MIH_Link_Actions_request(link, odtone::mih::link_ac_type_power_up);
// ferreira: commented out the count printouts and changed the comparison value (originally count >= 30 )
//Send ONLY ONCE RRC_Connection_Reconfiguration request to the UE on LTE link 0
// log_(0, "COUNT: ", count );
if (second_link_activated==0)
{
// log_(0, "COUNT: ", count );
if (count >= 750)
if (count >= 1500)
{
// log_(0, "COUNT: ", count );
send_MIH_Link_Action_Power_Up_request(_link_id_list[0]);//Link LTE
......@@ -1497,21 +1514,34 @@ void mih_user::receive_MIH_Link_Parameters_Report(odtone::mih::message& msg, con
& odtone::mih::tlv_link_identifier(link)
& odtone::mih::tlv_link_param_rpt_list(lprl);
log_(0, "MIH_Link_Parameters_Report.indication - RECEIVED - Begin");
log_(0, "\t- LINK CFG STATUS LIST - Length: ", lprl.size());
log_(0, "[MSC_MSG]["+getTimeStamp4Log()+"]["+ msg.source().to_string() +"][--- MIH_Link_Parameters_Report.indication --->]["+msg.destination().to_string()+"]\n");
log_(0, " - LINK_TUPLE_ID - Link identifier: ", link_id2string(link).c_str());
std::cout<<"LINK_TUPLE_ID - Link identifier: "<<link<<std::endl;
// log_(0, "MIH_Link_Parameters_Report.indication - RECEIVED - Begin");
// log_(0, "\t- LINK CFG STATUS LIST - Length: ", lprl.size());
// log_(0, "[MSC_MSG]["+getTimeStamp4Log()+"]["+ msg.source().to_string() +"][--- MIH_Link_Parameters_Report.indication --->]["+msg.destination().to_string()+"]\n");
// log_(0, " - LINK_TUPLE_ID - Link identifier: ", link_id2string(link).c_str());
// std::cout<<"LINK_TUPLE_ID - Link identifier: "<<link<<std::endl;
//
// for (odtone::mih::link_param_rpt_list::iterator i=lprl.begin(); i!=lprl.end(); i++)
// {
// log_(0, "Meausrement Type: --- 0 => RSRP ----- 1=>RSRQ ---- 2=>CQI ", i->param.type);
// if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
// {
// log_(0, "Meausrement Value: ", (short) *value );
// }
// }
// log_(0, "MIH_Link_Parameters_Report.indication - End");
// ferreira: changed output of message for better readability!
log_(0, "\n["+getTimeStamp4Log()+"] [RX] [FROM: "+ msg.source().to_string() +"] [Link ID: "+ link_id2string(link).c_str() +"]");
log_(0, "\t[MIH_Link_Parameters_Report]");
for (odtone::mih::link_param_rpt_list::iterator i=lprl.begin(); i!=lprl.end(); i++)
{
log_(0, "Meausrement Type: --- 0 => RSRP ----- 1=>RSRQ ---- 2=>CQI ", i->param.type);
if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
{
log_(0, "Meausrement Value: ", (short) *value );
}
if(odtone::mih::link_param_val *value = boost::get<odtone::mih::link_param_val>(&i->param.value))
{
log_(0, "\t[Measurement Types: RSRP 0|RSRQ 1|CQI 2] [type: ", i->param.type, "| value: ", (short) *value, "]" );
}
}
log_(0, "MIH_Link_Parameters_Report.indication - End");
// log_(0, "MIH_Link_Parameters_Report.indication - End");
//eNB1: Forward the message to UE 2
......
......@@ -68,8 +68,8 @@ source $THIS_SCRIPT_PATH/env_802dot21.bash
###########################################################
bash_exec "ifconfig $EMULATION_DEV_INTERFACE up $EMULATION_DEV_ADDRESS netmask 255.255.255.0"
bash_exec "ifconfig eth2 up 192.168.14.3 netmask 255.255.255.0"
#bash_exec "ip r d default dev eth0"
#bash_exec "ip r a default via 192.168.14.4 dev eth2"
bash_exec "ip r d default via 192.168.14.4 dev eth2"
bash_exec "ip r a default via 192.168.12.100 dev eth0"
###########################################################
IPTABLES=/sbin/iptables
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment