[PATCH] osmo-pcu[master]: Add compression support in EGPRS PUAN

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

sivasankari gerrit-no-reply at lists.osmocom.org
Mon Jan 16 10:13:01 UTC 2017


Hello Jenkins Builder, Holger Freyther,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/413

to look at the new patch set (#5).

Add compression support in EGPRS PUAN

This adds compression of bitmap in PUAN. The compressed bitmap
is used only if the number of bits in the bitmap does not fit in
the message and there is a gain after compression.
The algorithm is part of libosmocore and so there is dependency
on the libosmocore for compilation.
The algorithm is tested on integration setup by forcing compression.

Change-Id: Id2eec4b5eb6da0ebd24054b541b09b700b9b40ba
---
M src/egprs_rlc_compression.cpp
M src/egprs_rlc_compression.h
M src/encoding.cpp
M src/rlc.cpp
M src/rlc.h
M src/tbf.cpp
M src/tbf.h
M src/tbf_ul.cpp
M tests/tbf/TbfTest.err
9 files changed, 537 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/413/5

diff --git a/src/egprs_rlc_compression.cpp b/src/egprs_rlc_compression.cpp
index f4e6bde..82605ff 100644
--- a/src/egprs_rlc_compression.cpp
+++ b/src/egprs_rlc_compression.cpp
@@ -84,8 +84,203 @@
 	}
 }
 
-/* The code words for one run length and zero run length are described in
- * table 9.1.10.1 of 3gpp 44.060
+/*
+ * Terminating codes for uninterrupted sequences of 0 and 1 up to 64 bit length
+ * according to TS 44.060 9.1.10
+ */
+static const unsigned t4_term[2][64] = {
+	{
+		0b0000110111,
+		0b10,
+		0b11,
+		0b010,
+		0b011,
+		0b0011,
+		0b0010,
+		0b00011,
+		0b000101,
+		0b000100,
+		0b0000100,
+		0b0000101,
+		0b0000111,
+		0b00000100,
+		0b00000111,
+		0b000011000,
+		0b0000010111,
+		0b0000011000,
+		0b0000001000,
+		0b00001100111,
+		0b00001101000,
+		0b00001101100,
+		0b00000110111,
+		0b00000101000,
+		0b00000010111,
+		0b00000011000,
+		0b000011001010,
+		0b000011001011,
+		0b000011001100,
+		0b000011001101,
+		0b000001101000,
+		0b000001101001,
+		0b000001101010,
+		0b000001101011,
+		0b000011010010,
+		0b000011010011,
+		0b000011010100,
+		0b000011010101,
+		0b000011010110,
+		0b000011010111,
+		0b000001101100,
+		0b000001101101,
+		0b000011011010,
+		0b000011011011,
+		0b000001010100,
+		0b000001010101,
+		0b000001010110,
+		0b000001010111,
+		0b000001100100,
+		0b000001100101,
+		0b000001010010,
+		0b000001010011,
+		0b000000100100,
+		0b000000110111,
+		0b000000111000,
+		0b000000100111,
+		0b000000101000,
+		0b000001011000,
+		0b000001011001,
+		0b000000101011,
+		0b000000101100,
+		0b000001011010,
+		0b000001100110,
+		0b000001100111
+
+	},
+	{
+		0b00110101,
+		0b000111,
+		0b0111,
+		0b1000,
+		0b1011,
+		0b1100,
+		0b1110,
+		0b1111,
+		0b10011,
+		0b10100,
+		0b00111,
+		0b01000,
+		0b001000,
+		0b000011,
+		0b110100,
+		0b110101,
+		0b101010,
+		0b101011,
+		0b0100111,
+		0b0001100,
+		0b0001000,
+		0b0010111,
+		0b0000011,
+		0b0000100,
+		0b0101000,
+		0b0101011,
+		0b0010011,
+		0b0100100,
+		0b0011000,
+		0b00000010,
+		0b00000011,
+		0b00011010,
+		0b00011011,
+		0b00010010,
+		0b00010011,
+		0b00010100,
+		0b00010101,
+		0b00010110,
+		0b00010111,
+		0b00101000,
+		0b00101001,
+		0b00101010,
+		0b00101011,
+		0b00101100,
+		0b00101101,
+		0b00000100,
+		0b00000101,
+		0b00001010,
+		0b00001011,
+		0b01010010,
+		0b01010011,
+		0b01010100,
+		0b01010101,
+		0b00100100,
+		0b00100101,
+		0b01011000,
+		0b01011001,
+		0b01011010,
+		0b01011011,
+		0b01001010,
+		0b01001011,
+		0b00110010,
+		0b00110011,
+		0b00110100
+	}
+};
+static const unsigned t4_term_length[2][64] = {
+	{10, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12},
+	{8, 6, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}
+};
+
+static const unsigned t4_min_term_length[] = {2, 4};
+static const unsigned t4_min_make_up_length[] = {10, 5};
+
+static const unsigned t4_max_term_length[] = {12, 8};
+static const unsigned t4_max_make_up_length[] = {13, 9};
+
+static const unsigned t4_make_up_length[2][15] = {
+	{10, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13},
+	{5, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9}
+};
+
+static const unsigned t4_make_up_ind[15] = {64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960};
+
+static const unsigned t4_make_up[2][15] = {
+	{
+		0b0000001111,
+		0b000011001000,
+		0b000011001001,
+		0b000001011011,
+		0b000000110011,
+		0b000000110100,
+		0b000000110101,
+		0b0000001101100,
+		0b0000001101101,
+		0b0000001001010,
+		0b0000001001011,
+		0b0000001001100,
+		0b0000001001101,
+		0b0000001110010,
+		0b0000001110011
+	},
+	{
+		0b11011,
+		0b10010,
+		0b010111,
+		0b0110111,
+		0b00110110,
+		0b00110111,
+		0b01100100,
+		0b01100101,
+		0b01101000,
+		0b01100111,
+		0b011001100,
+		0b011001101,
+		0b011010010,
+		0b011010011,
+		0b011010100
+	 }
+};
+
+/* The code words for one run length and zero
+ * run length are described in table 9.1.10.1
+ * of 3gpp 44.060
  */
 const char *one_run_len_code_list[EGPRS_CODEWORDS] = {
 	"00110101",
@@ -359,3 +554,138 @@
 	decode_tree_init();
 }
 
+/* Compress received block bitmap
+ * \param run_len_cnt[in] Count of number of 1's and 0's
+ * \param codewrd_bitmap[in] Code word for coresponding run length.
+ * \param crbb_vec[out] compressed bitvector.
+ */
+static void compress_bitmap(
+		uint16_t *run_len_cnt,    /* cnt: run length count */
+		uint16_t *codewrd_bitmap, /* code word */
+		int16_t *codewrd_len, /* number of bits in the code word */
+		bitvec *crbb_vec,  /* bitmap buffer to put code word in */
+		bool start)
+{
+	int i = 0;
+	unsigned writeIndex = crbb_vec->cur_bit;
+	*codewrd_bitmap = 0;
+	*codewrd_len = 0;
+	if (*run_len_cnt >= 64) {
+		for (i = 0; i < 15; i++) {
+			if (t4_make_up_ind[i] == *run_len_cnt) {
+				*codewrd_bitmap = t4_make_up[start][i];
+				*codewrd_len = t4_make_up_length[start][i];
+			}
+		}
+	} else {
+		*codewrd_bitmap = t4_term[start][*run_len_cnt];
+		*codewrd_len = t4_term_length[start][*run_len_cnt];
+	}
+	bitvec_write_field(crbb_vec, writeIndex, *codewrd_bitmap, *codewrd_len);
+}
+
+/* Compress received block bitmap */
+int egprs_compress::osmo_t4_compress(struct bitvec *bv)
+{
+	uint8_t crbb_len = 0;
+	uint8_t uclen_crbb = 0;
+	uint8_t crbb_bitmap[127] = {'\0'};
+	bool start = (bv->data[0] & 0x80)>>7;
+	struct bitvec crbb_vec;
+
+	crbb_vec.data = crbb_bitmap;
+	crbb_vec.cur_bit = 0;
+	crbb_vec.data_len = 127;
+	bv->data_len = bv->cur_bit;
+	bv->cur_bit = 0;
+	if (egprs_compress::compress_rbb(bv, &crbb_vec, &uclen_crbb, 23*8)) {
+		memcpy(bv->data, crbb_bitmap, (crbb_len+7)/8);
+		bv->cur_bit = crbb_len;
+		bv->data_len = (crbb_len+7)/8;
+		return start;
+	}
+	else
+		printf("Encode failed\n");
+	return -1;
+}
+
+/*! \brief compression algorithm using T4 encoding
+ *  the compressed bitmap's are copied in crbb_bitmap
+ *  \param[in] rbb_vec bit vector to be encoded
+ *  \return 1 if compression is success or 0 for failure
+ */
+int egprs_compress::compress_rbb(
+		struct bitvec *urbb_vec,
+		struct bitvec *crbb_vec,
+		uint8_t *uclen_crbb,  /* Uncompressed bitmap len in CRBB */
+		uint8_t  max_bits)     /* max remaining bits */
+{
+	bool run_len_bit;
+	int buflen = urbb_vec->cur_bit;
+	int total_bits = urbb_vec->cur_bit;
+	uint16_t rlen;
+	uint16_t temprl = 0;
+	uint16_t cbmap = 0;     /* Compressed code word */
+	int16_t nbits;          /* Length of code word */
+	uint16_t uclen = 0;
+	int16_t clen = 0;
+	bool start;		/* Starting color code see 9.1.10, 3GPP 44.060 */
+	urbb_vec->cur_bit = 0;
+	run_len_bit = (urbb_vec->data[0] & 0x80)>>7;
+	while (buflen > 0) {
+		temprl = 0;
+		/* Find Run length */
+		if (run_len_bit == 1)
+			rlen = bitvec_rl_curbit(urbb_vec, true, total_bits);
+		else
+			rlen = bitvec_rl_curbit(urbb_vec, false, total_bits);
+		buflen = buflen - rlen;
+		/* if rlen > 64 need Makeup code word */
+		/*Compress the bits */
+		if (run_len_bit == 0) {
+			start = 0;
+			if (rlen >= 64) {
+				temprl = (rlen/64)*64;
+				compress_bitmap(&temprl, &cbmap, &nbits,
+						crbb_vec, start);
+				clen = clen + nbits;
+			}
+			temprl = MOD64(rlen);
+			compress_bitmap(&temprl, &cbmap, &nbits,
+						crbb_vec, start);
+			/* next time the run length will be Ones */
+			run_len_bit = 1;
+		} else {
+			start = 1;
+			if (rlen >= 64) {
+				temprl = (rlen/64)*64;
+				compress_bitmap(&temprl, &cbmap, &nbits,
+						crbb_vec, start);
+				clen = clen + nbits;
+			}
+			temprl = MOD64(rlen);
+			compress_bitmap(&temprl, &cbmap, &nbits,
+						crbb_vec, start);
+
+			/* next time the run length will be Zeros */
+			run_len_bit = 0;
+		}
+		uclen = uclen + rlen;
+		clen = clen + nbits;
+		/*compressed bitmap exceeds the buffer space */
+		if (clen > max_bits) {
+			uclen = uclen - rlen;
+			clen = clen - nbits;
+			break;
+		}
+	}
+	crbb_vec->cur_bit = clen;
+	*uclen_crbb = uclen;
+	if (clen >= uclen)
+		/* No Gain is observed, So no need to compress */
+		return 0;
+	else
+		LOGP(DRLCMACUL, LOGL_DEBUG, "CRBB bitmap = %s\n", osmo_hexdump(crbb_vec->data, (crbb_vec->cur_bit+7)/8));
+		/* Add compressed bitmap to final buffer */
+		return 1;
+}
diff --git a/src/egprs_rlc_compression.h b/src/egprs_rlc_compression.h
index c5f0f1a..4d2501b 100644
--- a/src/egprs_rlc_compression.h
+++ b/src/egprs_rlc_compression.h
@@ -5,6 +5,7 @@
 #pragma once
 
 struct egprs_compress_node;
+#define	 MOD64(X)	(((X) + 64) & 0x3F)
 
 /* Singleton to manage the EGPRS compression algorithm. */
 class egprs_compress
@@ -14,6 +15,9 @@
 		bool start, const uint8_t *orig_buf,
 		bitvec *dest);
 	egprs_compress();
+	int osmo_t4_compress(struct bitvec *bv);
+	static int compress_rbb(struct bitvec *urbb_vec, struct bitvec *crbb_vec,
+		uint8_t *uclen_crbb, uint8_t  max_bits);
 
 private:
 	egprs_compress_node *ones_list;
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 8fa4bf6..ea38b77 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -24,6 +24,7 @@
 #include <bts.h>
 #include <tbf.h>
 #include <gprs_debug.h>
+#include <egprs_rlc_compression.h>
 
 extern "C" {
 #include <osmocom/gprs/protocol/gsm_04_60.h>
@@ -699,20 +700,44 @@
 
 static void write_packet_ack_nack_desc_egprs(
 	struct gprs_rlcmac_bts *bts, bitvec * dest, unsigned& wp,
-	gprs_rlc_ul_window *window, bool is_final)
+	gprs_rlc_ul_window *window, bool is_final, unsigned& rest_bits)
 {
-	int urbb_len = 0;
-	int len;
+	unsigned int urbb_len = 0;
+	uint8_t crbb_len = 0;
+	uint8_t len;
 	bool bow = true;
 	bool eow = true;
 	int ssn = window->mod_sns(window->v_q() + 1);
-	int num_blocks = window->mod_sns(window->v_r() - window->v_q());
+	unsigned int num_blocks = window->mod_sns(window->v_r() - window->v_q());
 	int esn_crbb = window->mod_sns(ssn - 1);
-	/* Bit 0 at the end is mandatory Table 11.2.28.1 in 44.060 */
-	int rest_bits = dest->data_len * 8 - wp - 1;
+	static  uint8_t rbb[RLC_EGPRS_MAX_WS] = {'\0'};
+	uint8_t iter = 0;
 	int is_compressed = 0;
+	bool try_compression = false;
+	uint8_t ucmp_bmplen;
+	uint8_t crbb_bitmap[23] = {'\0'};
+	bitvec ucmp_vec;
+	bitvec crbb_vec;
+	uint8_t uclen_crbb = 0;
 	bool len_coded = true;
+	uint8_t crbb_start_clr_code;
 	uint8_t i;
+#if 0
+	/* static size of 16 bits*/
+	 ..0. .... = ACKNACK:  (Union)
+        Desc
+
+            ...0 .... = FINAL_ACK_INDICATION: False
+
+            .... 1... = BEGINNING_OF_WINDOW: 1
+
+            .... .1.. = END_OF_WINDOW: 1
+
+            .... ..10  0101 0001  1... .... = STARTING_SEQUENCE_NUMBER: 1187
+
+            .0.. .... = CRBB Exist: 0
+#endif
+	rest_bits -= 16;
 
 	if (num_blocks > 0)
 		/* V(Q) is NACK and omitted -> SSN = V(Q) + 1 */
@@ -720,27 +745,67 @@
 
 	if (num_blocks > window->ws())
 		num_blocks = window->ws();
-	/* TODO Compression support */
-	if (is_compressed == 0) {
-		/* Union bit takes 1 bit */
-		/* Other fields in descr for uncompresed bitmap takes 15 bits*/
+	/* Try Compression  as number of blocks does not fit */
+	if (num_blocks > rest_bits) {
+		try_compression = true;
+	}
+	if (try_compression == true) {
+		ucmp_bmplen = window->update_egprs_rbb(rbb);
+		ucmp_vec.data = rbb;
+		ucmp_vec.cur_bit = ucmp_bmplen;
+		ucmp_vec.data_len = 127;
+		crbb_vec.data = crbb_bitmap;
+		crbb_vec.cur_bit = 0;
+		crbb_vec.data_len = 127;
+		LOGP(DRLCMACUL, LOGL_DEBUG,
+		"rest_bits=%d uncompressed len %d and uncompressed bitmap = %s\n",
+		 rest_bits, ucmp_bmplen,
+		osmo_hexdump(ucmp_vec.data, (ucmp_bmplen+7)/8));
 
-		if (num_blocks > rest_bits - 15 - 1) {
+		is_compressed = egprs_compress::compress_rbb(&ucmp_vec, /* Uncompressed bitmap*/
+			&crbb_vec, /*Compressed bitmap vector */
+			&uclen_crbb,
+			(rest_bits - 16));/* CRBBlength:7 colourcode:1 dissector length:8*/
+		LOGP(DRLCMACUL, LOGL_DEBUG,
+		"the ucmp len=%d uclen_crbb=%d num_blocks=%d crbb length %d, "
+		"and the CRBB bitmap  = %s\n",
+		ucmp_bmplen, uclen_crbb, num_blocks, crbb_vec.cur_bit,
+		osmo_hexdump(crbb_bitmap, (crbb_vec.cur_bit+7)/8));
+		crbb_len = crbb_vec.cur_bit;
+	}
+
+	if (is_compressed == 0) {
+		/* length field takes 8 bits*/
+		if (num_blocks > rest_bits - 8) {
 			eow = false;
-			urbb_len = rest_bits - 15 - 1;
+			urbb_len = rest_bits;
 			len_coded = false;
-		} else if (num_blocks == rest_bits - 15 - 1) {
-			urbb_len = rest_bits - 15 - 1;
+		} else if (num_blocks == rest_bits) {
+			urbb_len = rest_bits;
 			len_coded = false;
-		/* Union bit takes 1 bit length field takes 8 bits*/
-		} else if (num_blocks > rest_bits - 15 - 9) {
-			eow = false;
-			urbb_len = rest_bits - 15 - 9;
 		} else
 			urbb_len = num_blocks;
+
 		len = urbb_len + 15;
 	} else {
-		/* TODO Compressed bitmap */
+		if (num_blocks > uclen_crbb) {
+			eow = false;
+			urbb_len = num_blocks - uclen_crbb;
+		}
+		/* Union bit takes 1 bit */
+		/* Other fields in descr of compresed bitmap takes 23 bits
+		 * -8 = CRBB_STARTING_COLOR_CODE + CRBB_LENGTH */
+		if (urbb_len > (rest_bits - crbb_len - 8)) {
+			eow = false;
+			len_coded = false;
+			urbb_len = rest_bits - crbb_len - 8;
+		/* -16 =  ACKNACK Dissector length + CRBB_STARTING_COLOR_CODE + CRBB_LENGTH */
+		} else if (urbb_len > (rest_bits - crbb_len - 16)) {
+			eow = false;
+			len_coded = false;
+			urbb_len = rest_bits - crbb_len - 16;
+		}
+		len = urbb_len + crbb_len + 23;
 	}
 
 	/* EGPRS Ack/Nack Description IE */
@@ -756,14 +821,32 @@
 	bitvec_write_field(dest, wp, eow, 1); // END_OF_WINDOW
 	bitvec_write_field(dest, wp, ssn, 11); // STARTING_SEQUENCE_NUMBER
 	if (is_compressed) {
-		/* TODO Add CRBB support */
-	} else
+		bitvec_write_field(dest, wp, 1, 1); // CRBB_Exist
+		bitvec_write_field(dest, wp, crbb_len, 7); // CRBB_LENGTH
+		crbb_start_clr_code = (0x80 & ucmp_vec.data[0])>>7;
+		bitvec_write_field(dest, wp, crbb_start_clr_code, 1); // CRBB_clr_code
+		LOGP(DRLCMACUL, LOGL_DEBUG,
+			"EGPRS CRBB, crbb_len = %d, crbb_start_clr_code = %d\n",
+			crbb_len, crbb_start_clr_code);
+		while (crbb_len != 0) {
+			if (crbb_len > 8) {
+				bitvec_write_field(dest, wp, crbb_bitmap[iter], 8);
+				crbb_len = crbb_len - 8;
+				iter++;
+			} else {
+				bitvec_write_field(dest, wp, crbb_bitmap[iter], crbb_len);
+				crbb_len = 0;
+			}
+		}
+		esn_crbb = window->mod_sns(esn_crbb + uclen_crbb);
+	} else {
 		bitvec_write_field(dest, wp, 0, 1); // CRBB_Exist
+	}
 	LOGP(DRLCMACUL, LOGL_DEBUG,
 		"EGPRS URBB, urbb len = %d, SSN = %d, ESN_CRBB = %d, "
 		"len present = %s,desc len = %d, "
 		"SNS = %d, WS = %d, V(Q) = %d, V(R) = %d%s%s\n",
-		urbb_len, ssn, esn_crbb, len_coded ? "yes" : "No", len,
+		urbb_len, ssn, esn_crbb, len_coded ? "yes" : "No" , len,
 		window->sns(), window->ws(), window->v_q(), window->v_r(),
 		bow ? ", BOW" : "", eow ? ", EOW" : "");
 
@@ -795,7 +878,9 @@
 	bitvec_write_field(dest, wp, 0, 1); // 0: don't have Power Control Parameters
 	bitvec_write_field(dest, wp, 0, 1); // 0: don't have Extension Bits
 
-	write_packet_ack_nack_desc_egprs(bts, dest, wp, &tbf->m_window, is_final);
+	/* -2 for last bit 0 mandatory and REL5 not supported */
+	unsigned bits_ack_nack = dest->data_len * 8 - wp - 2;
+	write_packet_ack_nack_desc_egprs(bts, dest, wp, &tbf->m_window, is_final, bits_ack_nack);
 
 	bitvec_write_field(dest, wp, 0, 1); // fixed 0
 	bitvec_write_field(dest, wp, 0, 1); // 0: don't have REL 5
diff --git a/src/rlc.cpp b/src/rlc.cpp
index 2bffccb..d13045e 100644
--- a/src/rlc.cpp
+++ b/src/rlc.cpp
@@ -83,6 +83,32 @@
 	return resend;
 }
 
+/* Update the receive block bitmap */
+uint16_t gprs_rlc_ul_window::update_egprs_rbb(uint8_t *rbb)
+{
+	int i;
+	uint16_t bsn;
+	uint16_t bitmask = 0x80;
+	int8_t pos = 0;
+	int8_t bit_pos = 0;
+	for (i = 0, bsn = (v_q()+1); ((bsn < (v_r())) && (i < ws())); i++,
+					bsn = this->mod_sns(bsn + 1)) {
+		if (m_v_n.is_received(bsn)) {
+			rbb[pos] = rbb[pos] | bitmask;
+		} else {
+			rbb[pos] = rbb[pos] & (~bitmask);
+		}
+		bitmask = bitmask >> 1;
+		bit_pos++;
+		bit_pos = bit_pos % 8;
+		if (bit_pos == 0) {
+			pos++;
+			bitmask = 0x80;
+		}
+	}
+	return i;
+}
+
 int gprs_rlc_dl_window::count_unacked()
 {
 	uint16_t unacked = 0;
@@ -219,6 +245,8 @@
 
 void gprs_rlc_window::set_ws(uint16_t ws)
 {
+	LOGP(DRLCMAC, LOGL_INFO, "ws(%d)\n",
+		ws);
 	OSMO_ASSERT(ws >= RLC_GPRS_SNS/2);
 	OSMO_ASSERT(ws <= RLC_MAX_SNS/2);
 	m_ws = ws;
diff --git a/src/rlc.h b/src/rlc.h
index b2fcd95..7db205d 100644
--- a/src/rlc.h
+++ b/src/rlc.h
@@ -347,6 +347,7 @@
 	bool is_received(uint16_t bsn) const;
 
 	void update_rbb(char *rbb);
+	uint16_t update_egprs_rbb(uint8_t *rbb);
 	void raise_v_r_to(int moves);
 	void raise_v_r(const uint16_t bsn);
 	uint16_t raise_v_q();
diff --git a/src/tbf.cpp b/src/tbf.cpp
index 657255d..33d94a8 100644
--- a/src/tbf.cpp
+++ b/src/tbf.cpp
@@ -827,14 +827,16 @@
 	if (egprs_ms_class > 0 && bts->egprs_enabled) {
 		tbf->enable_egprs();
 		tbf->m_window.set_sns(RLC_EGPRS_SNS);
-		/* TODO: Allow bigger UL windows when CRBB encoding is supported */
-		tbf->m_window.set_ws(RLC_EGPRS_MIN_WS);
 		setup_egprs_mode(bts, ms);
 		LOGP(DRLCMAC, LOGL_INFO, "Enabled EGPRS for %s, mode %s\n",
 			tbf->name(), GprsCodingScheme::modeName(ms->mode()));
 	}
 
 	rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot);
+
+	if (tbf->is_egprs_enabled())
+		tbf->egprs_calc_ulwindow_size();
+
 	/* if no resource */
 	if (rc < 0) {
 		talloc_free(tbf);
diff --git a/src/tbf.h b/src/tbf.h
index adb7dcc..0389595 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -523,6 +523,8 @@
 		struct gprs_rlc_data *block,
 		uint8_t *data, const uint8_t block_idx);
 
+	void egprs_calc_ulwindow_size();
+
 	void update_coding_scheme_counter_ul(const GprsCodingScheme cs);
 
 	/* Please note that all variables here will be reset when changing
diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index 0de0127..2598174 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -29,6 +29,8 @@
 #include <decoding.h>
 #include <pcu_l1_if.h>
 
+#include "pcu_utils.h"
+
 extern "C" {
 #include <osmocom/core/msgb.h>
 #include <osmocom/core/talloc.h>
@@ -587,3 +589,22 @@
 		}
 	}
 }
+
+void gprs_rlcmac_ul_tbf::egprs_calc_ulwindow_size()
+{
+	struct gprs_rlcmac_bts *bts_data = bts->bts_data();
+	unsigned int num_pdch = pcu_bitcount(ul_slots());
+	unsigned int ws = bts_data->ws_base + num_pdch * bts_data->ws_pdch;
+	ws = (ws / 32) * 32;
+	ws = OSMO_MAX(64, ws);
+
+	if (num_pdch == 1)
+		ws = OSMO_MIN(192, ws);
+	else
+		ws = OSMO_MIN(128 * num_pdch, ws);
+
+	LOGP(DRLCMAC, LOGL_INFO, "%s: Setting EGPRS window size to %d, base(%d) slots(%d) ws_pdch(%d)\n",
+		name(), ws, bts_data->ws_base, num_pdch, bts_data->ws_pdch);
+
+	m_window.set_ws(ws);
+}
diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err
index 38d85d9..5f5456b 100644
--- a/tests/tbf/TbfTest.err
+++ b/tests/tbf/TbfTest.err
@@ -3342,6 +3342,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 3c
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 384
+ws(384)
 DL TBF slots: 0x3c, N: 4, WS: 384
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) free
@@ -3386,6 +3387,8 @@
 - Setting Control TS 7
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00
+TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0)
+ws(64)
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169.
 Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
@@ -3438,6 +3441,7 @@
 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI: 0xf1223344 confirmed
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START
 Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344'
@@ -3479,6 +3483,8 @@
 - Setting Control TS 7
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00
+TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0)
+ws(64)
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169.
 Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
@@ -3694,6 +3700,7 @@
 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI: 0xf1223344 confirmed
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START
 Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344'
@@ -3723,6 +3730,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -4057,6 +4065,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -4336,6 +4345,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -4574,6 +4584,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -4776,6 +4787,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -4956,6 +4968,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5117,6 +5130,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5274,6 +5288,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5418,6 +5433,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5563,6 +5579,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5614,6 +5631,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5665,6 +5683,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5716,6 +5735,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5786,6 +5806,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5856,6 +5877,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5926,6 +5948,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -5996,6 +6019,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -6053,6 +6077,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -6110,6 +6135,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -6167,6 +6193,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
@@ -6242,6 +6269,8 @@
 - Setting Control TS 7
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00
+TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0)
+ws(64)
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169.
 Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
@@ -6324,6 +6353,7 @@
 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI: 0xf1223344 confirmed
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START
 Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344'
@@ -6355,6 +6385,7 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 192
+ws(192)
 DL TBF slots: 0x10, N: 1, WS: 192
 ********** TBF update **********
 PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000.
@@ -6371,6 +6402,7 @@
 - Assigning DL TS 5
 PDCH(TS 5, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001.
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 384
+ws(384)
 DL TBF slots: 0x3c, N: 4, WS: 384
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) free
@@ -6415,6 +6447,8 @@
 - Setting Control TS 7
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00
+TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0)
+ws(64)
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN
 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169.
 Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed
@@ -6485,6 +6519,7 @@
 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI: 0xf1223344 confirmed
 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START
 Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344'
@@ -6514,9 +6549,11 @@
 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS)
 Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64
+ws(64)
 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0
 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW
 The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed
+ws(480)
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge
 - ack:  (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1287)  R=ACK I=NACK
 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) DL analysis, range=1176:1288, lost=73, recv=39, skipped=0, bsn=1944, info='RRRRRRRRRRRRRRRRRRRRRRRRRRLRRRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRR................................................................................................................................................................................................................................................................................................................................................................................'

-- 
To view, visit https://gerrit.osmocom.org/413
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id2eec4b5eb6da0ebd24054b541b09b700b9b40ba
Gerrit-PatchSet: 5
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: prasadkg <Prasad.Kaup at radisys.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: arvind.sirsikar <arvind.sirsikar at radisys.com>
Gerrit-Reviewer: prasadkg <Prasad.Kaup at radisys.com>
Gerrit-Reviewer: pravin <pravin.manoharan at radisys.com>
Gerrit-Reviewer: sivasankari <Sivasankari.Theerthagiri at radisys.com>



More information about the gerrit-log mailing list