lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

November 2022

  • 2 participants
  • 2503 discussions
Change in libosmo-netif[master]: osmux: test replay of lot RTP packets when generating osmux batches
by pespin 15 Nov '22

15 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30173 ) Change subject: osmux: test replay of lot RTP packets when generating osmux batches ...................................................................... osmux: test replay of lot RTP packets when generating osmux batches Change-Id: I913c2ccfc3ad4e7ed801344d64e33e166a0817cf --- M tests/osmux/osmux_input_test.c M tests/osmux/osmux_input_test.ok 2 files changed, 98 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/73/30173/1 diff --git a/tests/osmux/osmux_input_test.c b/tests/osmux/osmux_input_test.c index 7a547d9..66335cd 100644 --- a/tests/osmux/osmux_input_test.c +++ b/tests/osmux/osmux_input_test.c @@ -491,6 +491,89 @@ talloc_free(h_input); } +/* Test some scenario where some RTP packets are lost */ +static void test_rtp_pkt_gap_osmux_deliver_cb(struct msgb *batch_msg, void *data) +{ + struct osmux_hdr *osmuxh; + char buf[2048]; + bool *osmux_transmitted = (bool *)data; + + osmux_snprintf(buf, sizeof(buf), batch_msg); + clock_debug("OSMUX message (len=%d): %s\n", batch_msg->len, buf); + + /* We expect 1 batch: */ + osmuxh = osmux_xfrm_output_pull(batch_msg); + /* Check seqnum is the one configured beforehand: */ + OSMO_ASSERT(osmuxh->seq == 123); + /* Check four AMR payloads appear: */ + OSMO_ASSERT(osmuxh->ctr == 3); + + osmuxh = osmux_xfrm_output_pull(batch_msg); + OSMO_ASSERT(osmuxh == NULL); + + msgb_free(batch_msg); + + *osmux_transmitted = true; +} +static void test_rtp_pkt_gap(void) +{ + struct msgb *msg; + int rc; + const uint8_t cid = 33; + bool osmux_transmitted = false; + struct osmux_in_handle *h_input; + + printf("===%s===\n", __func__); + + clock_override_enable(true); + clock_override_set(0, 0); + rtp_init(60, 18000); + + h_input = osmux_xfrm_input_alloc(tall_ctx); + osmux_xfrm_input_set_initial_seqnum(h_input, 123); + osmux_xfrm_input_set_batch_factor(h_input, 4); + osmux_xfrm_input_set_deliver_cb(h_input, + test_rtp_pkt_gap_osmux_deliver_cb, + &osmux_transmitted); + osmux_xfrm_input_open_circuit(h_input, cid, false); + + /* First RTP frame at t=0 */ + clock_debug("1st RTP packet is received"); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + clock_debug("2nd RTP packet is lost"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + msgb_free(msg); + + clock_debug("3rd RTP packet is received"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + clock_debug("4th RTP packet is received"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + msg = rtp_next(); + rtp_append_amr(msg, AMR_FT_2); + rc = osmux_xfrm_input(h_input, msg, cid); + OSMO_ASSERT(rc == 0); + + /* t=80, osmux batch is scheduled to be transmitted: */ + clock_debug("osmux batch transmitted"); + clock_override_add(0, TIME_RTP_PKT_MS*1000); + osmo_select_main(0); + OSMO_ASSERT(osmux_transmitted == true); + + clock_debug("Closing circuit"); + osmux_xfrm_input_close_circuit(h_input, cid); + talloc_free(h_input); +} + int main(int argc, char **argv) { @@ -512,6 +595,7 @@ test_last_amr_cmr_f_q_used(); test_initial_osmux_seqnum(); test_rtp_dup(); + test_rtp_pkt_gap(); fprintf(stdout, "OK: Test passed\n"); return EXIT_SUCCESS; diff --git a/tests/osmux/osmux_input_test.ok b/tests/osmux/osmux_input_test.ok index b5b2f00..d119b62 100644 --- a/tests/osmux/osmux_input_test.ok +++ b/tests/osmux/osmux_input_test.ok @@ -37,4 +37,18 @@ sys={0.040000}, mono={0.040000}: OSMUX message (len=19): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=0 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 12 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] sys={0.040000}, mono={0.040000}: Closing circuit +===test_rtp_pkt_gap=== +sys={0.000000}, mono={0.000000}: clock_override_set +sys={0.000000}, mono={0.000000}: 1st RTP packet is received +sys={0.000000}, mono={0.000000}: 2nd RTP packet is lost +sys={0.020000}, mono={0.020000}: clock_override_add +sys={0.020000}, mono={0.020000}: 3rd RTP packet is received +sys={0.040000}, mono={0.040000}: clock_override_add +sys={0.040000}, mono={0.040000}: 4th RTP packet is received +sys={0.060000}, mono={0.060000}: clock_override_add +sys={0.060000}, mono={0.060000}: osmux batch transmitted +sys={0.080000}, mono={0.080000}: clock_override_add +sys={0.080000}, mono={0.080000}: OSMUX message (len=64): OSMUX seq=123 ccid=033 ft=1 rtp_m=0 ctr=3 amr_f=0 amr_q=1 amr_ft=02 amr_cmr=00 [ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ] + +sys={0.080000}, mono={0.080000}: Closing circuit OK: Test passed -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30173 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I913c2ccfc3ad4e7ed801344d64e33e166a0817cf Gerrit-Change-Number: 30173 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: Handle current to-be-transmitted packet size when creating for...
by pespin 15 Nov '22

15 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30174 ) Change subject: osmux: Handle current to-be-transmitted packet size when creating forged RTP packets to fill holes ...................................................................... osmux: Handle current to-be-transmitted packet size when creating forged RTP packets to fill holes osmux_link_add() is renamed to osmux_link_handle_rtp_req(), and the last part of it is split out and kept as osmux_link_add(). hence osmux_link_handle_rtp_req() does proper input checking (like duplicates, holes, etc.) while osmux_link_add() expects all that to be sorted out. Reuse osmux_link_add() in osmux_replay_lost_packets() to properly update the link state of the to-be-transmitted packet, circuit state, etc. Change-Id: I4ea435bfb2490a375ad3e5068ee926e48b53cf5c --- M src/osmux_input.c 1 file changed, 116 insertions(+), 109 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/74/30174/1 diff --git a/src/osmux_input.c b/src/osmux_input.c index 866588f..bf17a0a 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -353,71 +353,6 @@ } -/* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ -static int osmux_replay_lost_packets(struct osmux_link *link, const struct osmux_in_req *req) -{ - int16_t diff; - struct msgb *last; - struct rtp_hdr *last_rtph, *rtph; - uint16_t last_seq, cur_seq; - int i, rc; - - /* Have we seen any RTP packet in this batch before? */ - if (llist_empty(&req->circuit->msg_list)) - return 0; - - /* Get last RTP packet seen in this batch */ - last = llist_entry(req->circuit->msg_list.prev, struct msgb, list); - last_rtph = osmo_rtp_get_hdr(last); - if (last_rtph == NULL) - return -1; - last_seq = ntohs(last_rtph->sequence); - cur_seq = ntohs(req->rtph->sequence); - diff = cur_seq - last_seq; - - /* If diff between last RTP packet seen and this one is > 1, - * then we lost several RTP packets, let's replay them. - */ - if (diff <= 1) - return 0; - - LOGP(DLMUX, LOGL_INFO, "RTP seq jump detected, recreating %" PRId16 - " lost packets (seq jump: %" PRIu16 " -> %" PRIu16 ")\n", - diff - 1, last_seq, cur_seq); - - /* Lifesaver: make sure bugs don't spawn lots of clones */ - if (diff > 16) - diff = 16; - - rc = 0; - rtph = last_rtph; - for (i = 1; i < diff; i++) { - struct msgb *clone; - - /* Clone last RTP packet seen */ - clone = msgb_copy(last, "RTP clone"); - if (!clone) - continue; - - /* The original RTP message has been already sanity checked. */ - rtph = osmo_rtp_get_hdr(clone); - /* Faking a follow up RTP pkt here, so no Marker bit: */ - rtph->marker = false; - /* Adjust sequence number and timestamp */ - rtph->sequence = htons(ntohs(rtph->sequence) + i); - rtph->timestamp = htonl(ntohl(rtph->timestamp) + - DELTA_RTP_TIMESTAMP); - - /* No more room in this batch, skip padding with more clones */ - rc = osmux_circuit_enqueue(link, req->circuit, clone); - if (rc != 0) { - msgb_free(clone); - return rc; - } - } - return rc; -} - static struct osmux_circuit * osmux_link_find_circuit(struct osmux_link *link, int ccid) { @@ -440,51 +375,10 @@ } /* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ -static int -osmux_link_add(struct osmux_link *link, const struct osmux_in_req *req) +static int osmux_link_add(struct osmux_link *link, const struct osmux_in_req *req) { - struct msgb *cur, *next; - int rc; unsigned int needed_bytes = 0; - - /* We've seen the first RTP message, disable dummy padding */ - if (req->circuit->dummy) { - req->circuit->dummy = 0; - link->ndummy--; - } - - /* Extra validation: check if this message already exists, should not - * happen but make sure we don't propagate duplicated messages. - */ - llist_for_each_entry_safe(cur, next, &req->circuit->msg_list, list) { - struct rtp_hdr *rtph2 = osmo_rtp_get_hdr(cur); - OSMO_ASSERT(rtph2); - - /* Already exists message with this sequence. Let's copy over - * the new RTP, since there's the chance that the existing one may - * be a forged copy we did when we detected a hole. */ - if (rtph2->sequence == req->rtph->sequence) { - if (msgb_length(cur) != msgb_length(req->msg)) { - /* Different packet size, AMR FT may have changed. Let's avoid changing it to - * break accounted size to be written (would need new osmux_hdr, etc.) */ - LOGP(DLMUX, LOGL_NOTICE, "RTP pkt with seq=%u and different len %u != %u already exists, skip it\n", - ntohs(req->rtph->sequence), msgb_length(cur), msgb_length(req->msg)); - return -1; - } - LOGP(DLMUX, LOGL_INFO, "RTP pkt with seq=%u already exists, replace it\n", - ntohs(req->rtph->sequence)); - __llist_add(&req->msg->list, &cur->list, cur->list.next); - llist_del(&cur->list); - msgb_free(cur); - return 0; - } - } - - /* Handle RTP packet loss scenario */ - rc = osmux_replay_lost_packets(link, req); - if (rc != 0) - return rc; - + int rc; /* Init of talkspurt (RTP M marker bit) needs to be in the first AMR slot * of the OSMUX packet, enforce sending previous batch if required: */ @@ -528,6 +422,119 @@ link->nmsgs++; return 0; +}; + +/* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ +static int osmux_replay_lost_packets(struct osmux_link *link, const struct osmux_in_req *req) +{ + int16_t diff; + struct msgb *last; + struct rtp_hdr *last_rtph; + uint16_t last_seq, cur_seq; + int i, rc; + struct osmux_in_req clone_req; + + /* Have we seen any RTP packet in this batch before? */ + if (llist_empty(&req->circuit->msg_list)) + return 0; + + /* Get last RTP packet seen in this batch */ + last = llist_entry(req->circuit->msg_list.prev, struct msgb, list); + last_rtph = osmo_rtp_get_hdr(last); + if (last_rtph == NULL) + return -1; + last_seq = ntohs(last_rtph->sequence); + cur_seq = ntohs(req->rtph->sequence); + diff = cur_seq - last_seq; + + /* If diff between last RTP packet seen and this one is > 1, + * then we lost several RTP packets, let's replay them. + */ + if (diff <= 1) + return 0; + + LOGP(DLMUX, LOGL_INFO, "RTP seq jump detected, recreating %" PRId16 + " lost packets (seq jump: %" PRIu16 " -> %" PRIu16 ")\n", + diff - 1, last_seq, cur_seq); + + /* Lifesaver: make sure bugs don't spawn lots of clones */ + if (diff > 16) + diff = 16; + + rc = 0; + clone_req = *req; + for (i = 1; i < diff; i++) { + /* Clone last RTP packet seen */ + clone_req.msg = msgb_copy(last, "RTP clone"); + if (!clone_req.msg) + continue; + + /* The original RTP message has been already sanity checked. */ + clone_req.rtph = osmo_rtp_get_hdr(clone_req.msg); + clone_req.amrh = osmo_rtp_get_payload(clone_req.rtph, clone_req.msg, &clone_req.rtp_payload_len); + clone_req.amr_payload_len = osmux_rtp_amr_payload_len(clone_req.amrh, clone_req.rtp_payload_len); + + /* Faking a follow up RTP pkt here, so no Marker bit: */ + clone_req.rtph->marker = false; + /* Adjust sequence number and timestamp */ + clone_req.rtph->sequence = htons(ntohs(clone_req.rtph->sequence) + i); + clone_req.rtph->timestamp = htonl(ntohl(clone_req.rtph->timestamp) + + DELTA_RTP_TIMESTAMP); + rc = osmux_link_add(link, &clone_req); + /* No more room in this batch, skip padding with more clones */ + if (rc != 0) { + msgb_free(clone_req.msg); + return rc; + } + } + return rc; +} + +/* returns: 1 if batch is full, 0 if batch still not full, negative on error. */ +static int osmux_link_handle_rtp_req(struct osmux_link *link, struct osmux_in_req *req) +{ + struct msgb *cur, *next; + int rc; + + /* We've seen the first RTP message, disable dummy padding */ + if (req->circuit->dummy) { + req->circuit->dummy = 0; + link->ndummy--; + } + + /* Extra validation: check if this message already exists, should not + * happen but make sure we don't propagate duplicated messages. + */ + llist_for_each_entry_safe(cur, next, &req->circuit->msg_list, list) { + struct rtp_hdr *rtph2 = osmo_rtp_get_hdr(cur); + OSMO_ASSERT(rtph2); + + /* Already exists message with this sequence. Let's copy over + * the new RTP, since there's the chance that the existing one may + * be a forged copy we did when we detected a hole. */ + if (rtph2->sequence == req->rtph->sequence) { + if (msgb_length(cur) != msgb_length(req->msg)) { + /* Different packet size, AMR FT may have changed. Let's avoid changing it to + * break accounted size to be written (would need new osmux_hdr, etc.) */ + LOGP(DLMUX, LOGL_NOTICE, "RTP pkt with seq=%u and different len %u != %u already exists, skip it\n", + ntohs(req->rtph->sequence), msgb_length(cur), msgb_length(req->msg)); + return -1; + } + LOGP(DLMUX, LOGL_INFO, "RTP pkt with seq=%u already exists, replace it\n", + ntohs(req->rtph->sequence)); + __llist_add(&req->msg->list, &cur->list, cur->list.next); + llist_del(&cur->list); + msgb_free(cur); + return 0; + } + } + + /* Handle RTP packet loss scenario */ + rc = osmux_replay_lost_packets(link, req); + if (rc != 0) + return rc; + + return osmux_link_add(link, req); } /** @@ -592,7 +599,7 @@ } /* Add this RTP to the OSMUX batch */ - ret = osmux_link_add(link, &req); + ret = osmux_link_handle_rtp_req(link, &req); if (ret < 0) { /* Cannot put this message into the batch. * Malformed, duplicated, OOM. Drop it and tell -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30174 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I4ea435bfb2490a375ad3e5068ee926e48b53cf5c Gerrit-Change-Number: 30174 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: Use internal struct to cache parsing state of rtp pkt from user
by pespin 15 Nov '22

15 Nov '22
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/30166 to look at the new patch set (#2). Change subject: osmux: Use internal struct to cache parsing state of rtp pkt from user ...................................................................... osmux: Use internal struct to cache parsing state of rtp pkt from user This allows incrementally gathering all the information once and only once. While doing so, this patch tends to move the decoding/parsing of the incoming RTP packet further towards the start of the code, hence detecing errors in the input data early in the process and avoiding touching internal state in this case. Change-Id: I55e0d2772e7054c0d734f5918c6938a5c8a6e781 --- M src/osmux_input.c 1 file changed, 64 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/66/30166/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30166 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I55e0d2772e7054c0d734f5918c6938a5c8a6e781 Gerrit-Change-Number: 30166 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-netif[master]: osmux: Add data[0] field to osmux_hdr
by pespin 15 Nov '22

15 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30172 ) Change subject: osmux: Add data[0] field to osmux_hdr ...................................................................... osmux: Add data[0] field to osmux_hdr This allows easy access to osmux_hdr payload. Change-Id: I27750c38f12d3d84dbaac5beff166d78ffa6c45b --- M TODO-RELEASE M include/osmocom/netif/osmux.h 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/72/30172/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 5629a9c..55371fd 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,4 +9,5 @@ #library what description / commit summary line libosmo-netif osmux new osmux_xfrm_output_* APIs libosmo-netif osmux new osmux_xfrm_input_* APIs +libosmo-netif osmux new struct osmux_hdr->data[0] field libosmo-netif stream new APIs osmo_stream_{cli,srv}_clear_tx_queue() \ No newline at end of file diff --git a/include/osmocom/netif/osmux.h b/include/osmocom/netif/osmux.h index f7a5fd5..b6014d5 100644 --- a/include/osmocom/netif/osmux.h +++ b/include/osmocom/netif/osmux.h @@ -53,6 +53,7 @@ /* auto-generated from the little endian part above (libosmocore/contrib/struct_endianess.py) */ uint8_t amr_ft:4, amr_cmr:4; #endif + uint8_t data[0]; } __attribute__((packed)); /* one to handle all existing RTP flows */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30172 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I27750c38f12d3d84dbaac5beff166d78ffa6c45b Gerrit-Change-Number: 30172 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: library/RLCMAC_Types: add spec. reference for the PTCCHDownlinkMsg
by fixeria 15 Nov '22

15 Nov '22
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30171 ) Change subject: library/RLCMAC_Types: add spec. reference for the PTCCHDownlinkMsg ...................................................................... library/RLCMAC_Types: add spec. reference for the PTCCHDownlinkMsg Change-Id: I799848f3429d6fcfb68a91648d5aaeccd2a77a7f --- M library/RLCMAC_Types.ttcn 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/30171/1 diff --git a/library/RLCMAC_Types.ttcn b/library/RLCMAC_Types.ttcn index fe47231..b01a7e2 100644 --- a/library/RLCMAC_Types.ttcn +++ b/library/RLCMAC_Types.ttcn @@ -372,10 +372,8 @@ external function enc_RlcmacDlBlock(in RlcmacDlBlock si) return octetstring; external function dec_RlcmacDlBlock(in octetstring stream) return RlcmacDlBlock; -/************************ - * PTCCH/D (Packet Timing Advance Control Channel) message. - * TODO: add a spec. reference to the message format definition. - *************************/ + /* PTCCH (Packet Timing Advance Control Channel) downlink block format. + * See 3GPP TS 44.004, section 7.8. */ type record PTCCHTimingAdvanceIE { BIT1 spare ('0'B), uint7_t ta_val -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30171 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I799848f3429d6fcfb68a91648d5aaeccd2a77a7f Gerrit-Change-Number: 30171 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: Drop marker bit in forged RTP packets to fill gaps
by pespin 15 Nov '22

15 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30170 ) Change subject: osmux: Drop marker bit in forged RTP packets to fill gaps ...................................................................... osmux: Drop marker bit in forged RTP packets to fill gaps If the last RTP we received from the user is a Marker bit (which is expected to be the first in the batch), then there's no need to keep marking the forged RTP packets to fill holes also as Marker bit. Change-Id: I5cef6185afbfce748473a096e8ebabd9c9628e12 --- M src/osmux_input.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/70/30170/1 diff --git a/src/osmux_input.c b/src/osmux_input.c index cbb85d0..9e625be 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -402,7 +402,8 @@ /* The original RTP message has been already sanity checked. */ rtph = osmo_rtp_get_hdr(clone); - + /* Faking a follow up RTP pkt here, so no Marker bit: */ + rtph->marker = false; /* Adjust sequence number and timestamp */ rtph->sequence = htons(ntohs(rtph->sequence) + i); rtph->timestamp = htonl(ntohl(rtph->timestamp) + -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30170 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I5cef6185afbfce748473a096e8ebabd9c9628e12 Gerrit-Change-Number: 30170 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: recreate lost RTP pkts before handling newest one
by pespin 15 Nov '22

15 Nov '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30169 ) Change subject: osmux: recreate lost RTP pkts before handling newest one ...................................................................... osmux: recreate lost RTP pkts before handling newest one In the event we need to fill in the batch with intermediate lost RTP packets, we must do so before handling the last one. Change-Id: Ib5dd7b1fa6213c96ece803b781a7ef1cf102a1d4 --- M src/osmux_input.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/69/30169/1 diff --git a/src/osmux_input.c b/src/osmux_input.c index 67c0218..cbb85d0 100644 --- a/src/osmux_input.c +++ b/src/osmux_input.c @@ -479,6 +479,11 @@ } } + /* Handle RTP packet loss scenario */ + rc = osmux_replay_lost_packets(link, req); + if (rc != 0) + return rc; + /* Init of talkspurt (RTP M marker bit) needs to be in the first AMR slot * of the OSMUX packet, enforce sending previous batch if required: */ @@ -499,11 +504,6 @@ if (req->needed_bytes > link->remaining_bytes) return 1; - /* Handle RTP packet loss scenario */ - rc = osmux_replay_lost_packets(link, req); - if (rc != 0) - return rc; - /* This batch is full, force batch delivery */ rc = osmux_circuit_enqueue(link, req->circuit, req->msg); if (rc != 0) -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30169 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: Ib5dd7b1fa6213c96ece803b781a7ef1cf102a1d4 Gerrit-Change-Number: 30169 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-bts[master]: osmux: Rotate over available Osmux CID when allocating a new one
by pespin 15 Nov '22

15 Nov '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/30158 ) Change subject: osmux: Rotate over available Osmux CID when allocating a new one ...................................................................... osmux: Rotate over available Osmux CID when allocating a new one Before this patch, the free CID with the smallest number was always selected to be used. This caused more or less the same subset of CIDs to be used all the time, while the CIDs with bigger numbers were mostly unused. Let's distribute the use so that all CIDs are used roughly the same. This has the advantage, among others, that the same CID will not be re-used immediatelly after being freed if a new call is established. It is useful to leave the CIDs unused for some time since the other end peer may know of the call being tear down with some delay. Hence if a new call is established immediately after the CID was released, the same CID would be allocated and passed at the peer, which would then detect that the old call (in its view still active) would already make use of that remote CID. Related: SYS#6161 Change-Id: I72803fb172accbabfc81923572890f8ecb06cefd --- M src/common/osmux.c 1 file changed, 28 insertions(+), 8 deletions(-) Approvals: daniel: Looks good to me, but someone else must approve pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/osmux.c b/src/common/osmux.c index 83730ce..fa0f7cc 100644 --- a/src/common/osmux.c +++ b/src/common/osmux.c @@ -43,26 +43,46 @@ /* Bitmask containing Allocated Osmux circuit ID. +7 to round up to 8 bit boundary. */ static uint8_t osmux_cid_bitmap[OSMO_BYTES_FOR_BITS(OSMUX_CID_MAX + 1)]; -/*! Find and reserve a free OSMUX cid. +/*! Find and reserve a free OSMUX cid. Keep state of last allocated CID to + * rotate allocated CIDs over time. This helps in letting CIDs unused for some + * time after last use. * \returns OSMUX cid */ static int osmux_get_local_cid(void) { - int i, j; + static uint8_t next_free_osmux_cid_lookup = 0; + uint8_t start_i, start_j; + uint8_t i, j, cid; - for (i = 0; i < sizeof(osmux_cid_bitmap); i++) { - for (j = 0; j < 8; j++) { + /* i = octet index, j = bit index inside ith octet */ + start_i = next_free_osmux_cid_lookup >> 3; + start_j = next_free_osmux_cid_lookup & 0x07; + + for (i = start_i; i < sizeof(osmux_cid_bitmap); i++) { + for (j = start_j; j < 8; j++) { if (osmux_cid_bitmap[i] & (1 << j)) continue; + goto found; + } + } - osmux_cid_bitmap[i] |= (1 << j); - LOGP(DOSMUX, LOGL_DEBUG, - "Allocating Osmux CID %u from pool\n", (i * 8) + j); - return (i * 8) + j; + for (i = 0; i <= start_i; i++) { + for (j = 0; j < start_j; j++) { + if (osmux_cid_bitmap[i] & (1 << j)) + continue; + goto found; } } LOGP(DOSMUX, LOGL_ERROR, "All Osmux circuits are in use!\n"); return -1; + +found: + osmux_cid_bitmap[i] |= (1 << j); + cid = (i << 3) | j; + next_free_osmux_cid_lookup = (cid + 1) & 0xff; + LOGP(DOSMUX, LOGL_DEBUG, + "Allocating Osmux CID %u from pool\n", cid); + return cid; } /*! put back a no longer used OSMUX cid. -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/30158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I72803fb172accbabfc81923572890f8ecb06cefd Gerrit-Change-Number: 30158 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in libosmo-netif[master]: osmux: dup in RTP pkt: Replace potentially internally forged pkt with...
by pespin 15 Nov '22

15 Nov '22
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/30168 to look at the new patch set (#2). Change subject: osmux: dup in RTP pkt: Replace potentially internally forged pkt with incoming one ...................................................................... osmux: dup in RTP pkt: Replace potentially internally forged pkt with incoming one When RTP packet provided by user to osmux layer, it may contain a seq gap, and osmux will refill the packets to avoid losing that information on the other side when it receives the batch. If out of order UDP packets are received, it can happen that we first detect a gap and later on we receive the previous RTP packet, which we is then detected as duplicate because it was previously forged to fill the hole. In that case, let's better keep the incoming packet instead of the potentially internall forged one which doesn't contain the real AMR payload. Related: SYS#6161 Change-Id: I82e11ef3dcd20ffea33c94ed83abcedf0f186871 --- M src/osmux_input.c M tests/osmux/osmux_input_test.c M tests/osmux/osmux_input_test.ok 3 files changed, 106 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/68/30168/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30168 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I82e11ef3dcd20ffea33c94ed83abcedf0f186871 Gerrit-Change-Number: 30168 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-bts[master]: osmux: Rotate over available Osmux CID when allocating a new one
by pespin 15 Nov '22

15 Nov '22
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bts/+/30158 ) Change subject: osmux: Rotate over available Osmux CID when allocating a new one ...................................................................... Patch Set 3: Code-Review+2 (1 comment) Patchset: PS3: Readding osmith's +1. -- To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/30158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Change-Id: I72803fb172accbabfc81923572890f8ecb06cefd Gerrit-Change-Number: 30158 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 15 Nov 2022 17:23:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • ...
  • 251
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.