Commit 0ab7abf5 authored by mir's avatar mir Committed by Teodora

Packet segmentation bug. Branch created for documentation purposes

parent 9dc5255c
......@@ -659,7 +659,7 @@ add_boolean_option(NAS_UE True "NAS UE INSTANCE (<> NAS_MME)"
##########################
# RRC LAYER OPTIONS
##########################
add_boolean_option(RRC_DEFAULT_RAB_IS_AM True "set the RLC mode to AM for the default bearer, otherwise it is UM." ON)
add_boolean_option(RRC_DEFAULT_RAB_IS_AM True "set the RLC mode to AM for the default bearer, otherwise it is UM.")
##########################
......
......@@ -1186,7 +1186,7 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
rrc->nr_cellid = (uint64_t)*(GNBParamList.paramarray[i][GNB_NRCELLID_IDX].u64ptr);
rrc->um_on_default_drb = *(GNBParamList.paramarray[i][GNB_UMONDEFAULTDRB_IDX].uptr);
rrc->um_on_default_drb = 1; // *(GNBParamList.paramarray[i][GNB_UMONDEFAULTDRB_IDX].uptr);
if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) {
} else if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) {
......
......@@ -626,7 +626,11 @@ static void pf_dl(module_id_t module_id,
/* Calculate coeff */
const NR_bler_options_t *bo = &mac->dl_bler;
const int max_mcs_table = current_BWP->mcsTableIdx == 1 ? 27 : 28;
const int max_mcs = min(sched_ctrl->dl_max_mcs, max_mcs_table);
int max_mcs = min(sched_ctrl->dl_max_mcs, max_mcs_table);
if(max_mcs > 10)
max_mcs = 10;
if (bo->harq_round_max == 1)
sched_pdsch->mcs = max_mcs;
else
......
......@@ -32,6 +32,14 @@
#include "openair2/RRC/NR/nr_rrc_proto.h"
#include <stdint.h>
#include <arpa/inet.h>
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
/* from OAI */
#include "oai_asn1.h"
#include "nr_pdcp_oai_api.h"
......@@ -1108,6 +1116,42 @@ bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
return 0;
}
//printf("[mir]: PDCP pkt size %d \n", sdu_buffer_size);
// struct iphdr* hdr = (struct iphdr*)sdu_buffer;
//if(hdr->protocol == IPPROTO_TCP) {
// struct tcphdr* tcp = (struct tcphdr*)((uint32_t*)hdr + hdr->ihl);
// struct in_addr paddr;
// paddr.s_addr = hdr->saddr;
// char *strAdd2 = inet_ntoa(paddr);
// printf("PDCP: IP source address %s \n", strAdd2 );
// paddr.s_addr = hdr->daddr;
// strAdd2 = inet_ntoa(paddr);
// printf("PDCP: IP dst address %s \n", strAdd2 );
// uint16_t const sport = ntohs(tcp->source);
// uint16_t const dport = ntohs(tcp->dest);
// printf("PDCP Ingress TCP seq_number %u src %d dst %d \n", ntohl(tcp->seq), sport, dport);
// }
//printf("[mir]: PDCP pkt size %d \n", sdu_buffer_size);
// struct iphdr* hdr = (struct iphdr*)sdu_buffer;
//if(hdr->protocol == IPPROTO_TCP) {
// struct tcphdr* tcp = (struct tcphdr*)((uint32_t*)hdr + hdr->ihl);
// struct in_addr paddr;
// paddr.s_addr = hdr->saddr;
// char *strAdd2 = inet_ntoa(paddr);
// printf("PDCP: IP source address %s \n", strAdd2 );
// paddr.s_addr = hdr->daddr;
// strAdd2 = inet_ntoa(paddr);
// printf("PDCP: IP dst address %s \n", strAdd2 );
// uint16_t const sport = ntohs(tcp->source);
// uint16_t const dport = ntohs(tcp->dest);
// printf("PDCP Ingress TCP seq_number %u src %d dst %d \n", ntohl(tcp->seq), sport, dport);
// }
int max_size = sdu_buffer_size + 3 + 4; // 3: max header, 4: max integrity
char pdu_buf[max_size];
int pdu_size = rb->process_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP, pdu_buf, max_size);
......
......@@ -480,6 +480,12 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size)
if (pdu_header_size + 1 > size)
return 0;
// mir Save BW when using TCP Cubic
if(pdu_header_size + sdu->size > size ){
return 0;
}
entity->tx_list = entity->tx_list->next;
if (entity->tx_list == NULL)
entity->tx_end = NULL;
......@@ -496,8 +502,11 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size)
if (pdu_size > size) {
nr_rlc_sdu_segment_t *next_sdu;
next_sdu = resegment(sdu, entity, size);
if (next_sdu == NULL)
printf("resegmenting \n");
if (next_sdu == NULL){
printf("next_sdu == NULL \n");
return 0;
}
/* put the second SDU back at the head of the TX list */
next_sdu->next = entity->tx_list;
entity->tx_list = next_sdu;
......@@ -511,11 +520,20 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size)
}
/* update tx_next if the SDU is an SDU segment and is the last */
if (!sdu->is_first && sdu->is_last)
if (!sdu->is_first && sdu->is_last){
printf("Updating the SN \n");
entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus;
}
ret = serialize_sdu(entity, sdu, buffer, size);
//uint8_t* a = (uint8_t*) buffer;
//uint8_t* b = (uint8_t*)(buffer+1);
//uint8_t* c = (uint8_t*)(buffer+2);
//uint8_t* d = (uint8_t*)(buffer+3);
//printf("a %u b %u c %u d %u \n",*a, *b, *c, *d);
entity->tx_size -= sdu->size;
entity->common.stats.txpdu_pkts++;
......
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