Ejemplo n.º 1
0
// This retrieves the RRCConnectionReconfiguration RRC SDU
u16 attach_ue3(char *dcch_sdu_ue, char dcch_sdu_ue_len, char *dcch_sdu_eNB)
{

  mac_rlc_status_resp_t rlc_status;
  u16 sdu_len;

  // simulation reception of RRCConnectionSetupComplete

  mac_rlc_data_ind(0,134,1,
                   DCCH,
                   dcch_sdu_ue,
                   dcch_sdu_ue_len,
                   1,
                   NULL);

  /// ... and generation of RRCConnectionReconfiguration
  /// First RLC-AM Control SDU (ACK)
  rlc_status = mac_rlc_status_ind(0,135,1,
                                  DCCH,
                                  100);

  sdu_len = mac_rlc_data_req(0,135,
                             DCCH,
                             dcch_sdu_eNB);

  mac_rlc_data_ind(1,135,1,
                   DCCH,
                   dcch_sdu_eNB,
                   sdu_len,
                   1,
                   NULL);

  // now RRC message
  rlc_status = mac_rlc_status_ind(0,136,1,
                                  DCCH,
                                  100);

  sdu_len = mac_rlc_data_req(0,136,
                             DCCH,
                             dcch_sdu_eNB);

  return(sdu_len);
}
Ejemplo n.º 2
0
// This retrieves the RRCConnectionReconfigurationComplete RRC SDU
u16 attach_ue4(char *dcch_sdu_eNB, char dcch_sdu_eNB_len, char *dcch_sdu_ue)
{

  mac_rlc_status_resp_t rlc_status;
  u16 sdu_len;

  // simulation UE reception of RRCConnectionReconfiguration ....

  mac_rlc_data_ind(1,135,0,
                   DCCH,
                   dcch_sdu_eNB,
                   dcch_sdu_eNB_len,
                   1,
                   NULL);

  // ... and generation of RRCConnectionReconfigurationComplete


  rlc_status = mac_rlc_status_ind(1,135,0,
                                  DCCH,
                                  100);

  sdu_len = mac_rlc_data_req(1,135,
                             DCCH,
                             dcch_sdu_ue);

  rlc_status = mac_rlc_status_ind(1,136,0,
                                  DCCH,
                                  100);

  sdu_len = mac_rlc_data_req(1,136,
                             DCCH,
                             dcch_sdu_ue);

  return(sdu_len);
}
Ejemplo n.º 3
0
// This retrieves the RRCConnectionSetupComplete RRC SDU
u16 attach_ue2(char *dcch_sdu_eNB, char dcch_sdu_eNB_len, char *dcch_sdu)
{

  mac_rlc_status_resp_t rlc_status;
  u16 sdu_len;

  printf("************* attach_ue2 (CCCH payload %d)\n",
         eNB_rrc_inst[0].Srb0.Tx_buffer.payload_size);
  // simulate reception of CCCH at UE (RRCConnectionSetup)
  mac_rrc_lite_data_ind(0,132,0,dcch_sdu_eNB,dcch_sdu_eNB_len,0,0);

  // simulate transmission of RRCConnectionSetupComplete
  rlc_status = mac_rlc_status_ind(1,134,0,
                                  DCCH,
                                  100);
  sdu_len = mac_rlc_data_req(1,133,
                             DCCH,
                             dcch_sdu);

  return(sdu_len);
}
Ejemplo n.º 4
0
// This function stores the downlink buffer for all the logical channels 
void store_dlsch_buffer (module_id_t Mod_id,
                         frame_t     frameP,
                         sub_frame_t subframeP){

  int                   UE_id,i;
  rnti_t                rnti;
  mac_rlc_status_resp_t rlc_status;
  UE_list_t             *UE_list = &eNB_mac_inst[Mod_id].UE_list;
  UE_TEMPLATE           *UE_template;

  for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]){

    UE_template = &UE_list->UE_template[UE_PCCID(Mod_id,UE_id)][UE_id];
    
  // clear logical channel interface variables
    UE_template->dl_buffer_total = 0;
    UE_template->dl_pdus_total = 0;
    for(i=0;i< MAX_NUM_LCID; i++) {
      UE_template->dl_buffer_info[i]=0;
      UE_template->dl_pdus_in_buffer[i]=0;
      UE_template->dl_buffer_head_sdu_creation_time[i]=0;
      UE_template->dl_buffer_head_sdu_remaining_size_to_send[i]=0;
    }
 
    rnti = UE_RNTI(Mod_id,UE_id);
      
    for(i=0;i< MAX_NUM_LCID; i++){ // loop over all the logical channels
      
      rlc_status = mac_rlc_status_ind(Mod_id,UE_id, frameP,ENB_FLAG_YES,MBMS_FLAG_NO,i,0 );
      UE_template->dl_buffer_info[i] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
      UE_template->dl_pdus_in_buffer[i] = rlc_status.pdus_in_buffer;
      UE_template->dl_buffer_head_sdu_creation_time[i] = rlc_status.head_sdu_creation_time ;
      UE_template->dl_buffer_head_sdu_creation_time_max = cmax(UE_template->dl_buffer_head_sdu_creation_time_max, 
							       rlc_status.head_sdu_creation_time );
      UE_template->dl_buffer_head_sdu_remaining_size_to_send[i] = rlc_status.head_sdu_remaining_size_to_send;
      UE_template->dl_buffer_head_sdu_is_segmented[i] = rlc_status.head_sdu_is_segmented;
      UE_template->dl_buffer_total += UE_template->dl_buffer_info[i];//storing the total dlsch buffer
      UE_template->dl_pdus_total   += UE_template->dl_pdus_in_buffer[i];
      
#ifdef DEBUG_eNB_SCHEDULER
      /* note for dl_buffer_head_sdu_remaining_size_to_send[i] :
       * 0 if head SDU has not been segmented (yet), else remaining size not already segmented and sent
       */
      if (UE_template->dl_buffer_info[i]>0)
	LOG_D(MAC,"[eNB %d] Frame %d Subframe %d : RLC status for UE %d in LCID%d: total of %d pdus and size %d, head sdu queuing time %d, remaining size %d, is segmeneted %d \n",
	      Mod_id, frameP, subframeP, UE_id,
	      i, UE_template->dl_pdus_in_buffer[i],UE_template->dl_buffer_info[i],
	      UE_template->dl_buffer_head_sdu_creation_time[i],
	      UE_template->dl_buffer_head_sdu_remaining_size_to_send[i],
	      UE_template->dl_buffer_head_sdu_is_segmented[i]
	      );
#endif
      
    }
    //#ifdef DEBUG_eNB_SCHEDULER
    if ( UE_template->dl_buffer_total>0)
      LOG_D(MAC,"[eNB %d] Frame %d Subframe %d : RLC status for UE %d : total DL buffer size %d and total number of pdu %d \n",
	    Mod_id, frameP, subframeP, UE_id,
	    UE_template->dl_buffer_total,
	    UE_template->dl_pdus_total
	    );
    //#endif   
  }
}