Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ build
install
.*.swp
*.bak
subprojects/.wraplock
subprojects/wrapdb.json
14 changes: 13 additions & 1 deletion src/mbstf/Context.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: App context class
******************************************************************************
* Copyright: (C)2024 British Broadcasting Corporation
* Copyright: (C)2024-2026 British Broadcasting Corporation
* Author(s): David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
Expand Down Expand Up @@ -47,6 +47,7 @@ Context::Context()
,cacheControl({60, 60})
,totalMaxBitRateSoftLimit(100)
,consecutiveIngestFailuresBeforeDeactivate(5)
,packetModeSchedulingQueueSize(128*1024) // 128KB queue for rate smoothing
{
}

Expand Down Expand Up @@ -125,6 +126,17 @@ bool Context::parseConfig()
} else {
throw std::out_of_range("Bad configuration node at mbstf.consecutiveIngestFailuresBeforeDeactivate");
}
} else if (mbstf_key == "packetModeSchedulingQueueSize") {
if (mbstf_iter.type() == YAML_MAPPING_NODE) {
std::string num_val(mbstf_iter.value());
size_t idx = 0;
packetModeSchedulingQueueSize = std::stoi(num_val, &idx);
if (idx != num_val.size()) {
throw std::out_of_range("Bad configuration value at mbstf.packetModeSchedulingQueueSize");
}
} else {
throw std::out_of_range("Bad configuration node at mbstf.packetModeSchedulingQueueSize");
}
} else {
ogs_warn("Unknown key `mbstf.%s` in configuration", mbstf_key.c_str());
}
Expand Down
3 changes: 2 additions & 1 deletion src/mbstf/Context.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: MBSTF Context
******************************************************************************
* Copyright: (C)2024 British Broadcasting Corporation
* Copyright: (C)2024-2026 British Broadcasting Corporation
* Author(s): David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
Expand Down Expand Up @@ -72,6 +72,7 @@ public:
} cacheControl;
int totalMaxBitRateSoftLimit; // total maximum bit rate this MBSTF ought to asked to handle
int consecutiveIngestFailuresBeforeDeactivate; // The number of consecutive ingest failures allowed before the session aborts
size_t packetModeSchedulingQueueSize; // The maximum queue size for packet mode scheduling per DistSession

private:
void parseCacheControl(Open5GSYamlIter &iter);
Expand Down
11 changes: 9 additions & 2 deletions src/mbstf/DistributionSession.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,13 @@ uint64_t DistributionSession::getTSI() const
return static_cast<uint32_t>(tsi.value());
}

const std::optional<std::shared_ptr<TunnelAddress>> &DistributionSession::getTunnel() const
{
std::shared_ptr<CreateReqData> create_req_data = distributionSessionReqData();
std::shared_ptr<DistSession> dist_session = create_req_data->getDistSession();
return dist_session->getMbUpfTunAddr();
}

const std::optional<std::string> &DistributionSession::getTunnelAddr() const
{
std::shared_ptr<CreateReqData> create_req_data = distributionSessionReqData();
Expand Down Expand Up @@ -1053,10 +1060,10 @@ void DistributionSession::_apiSessionCreate(Open5GSSBIStream &stream, Open5GSSBI
return;
} catch (std::exception &err) {
ogs_error("Error while populating MBSTF Distribution Session: %s", err.what());
char *error = ogs_msprintf("Invalid ObjDistributionData parameters [%s]", err.what());
char *error = ogs_msprintf("Invalid ObjDistributionData or PktDistributionData parameters [%s]", err.what());
ogs_error("%s", error);
ogs_assert(true == NfServer::sendError(stream, ProblemCause::INVALID_MSG_FORMAT, 1, message, app_meta, api,
"Invalid ObjDistributionData parameters", error));
"Invalid ObjDistributionData or PktDistributionData parameters", error));
ogs_free(error);
return;
}
Expand Down
5 changes: 4 additions & 1 deletion src/mbstf/DistributionSession.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: Distribution Session class
******************************************************************************
* Copyright: (C)2024-2025 British Broadcasting Corporation
* Copyright: (C)2024-2026 British Broadcasting Corporation
* Author(s): Dev Audsin <dev.audsin@bbc.co.uk>
* David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
* Licensed under the License terms and conditions for use, reproduction, and
Expand Down Expand Up @@ -42,6 +43,7 @@ namespace reftools::mbstf {
class CreateReqData;
class DistSessionSubscription;
class ObjDistributionData;
class TunnelAddress;
}

MBSTF_NAMESPACE_START
Expand Down Expand Up @@ -86,6 +88,7 @@ public:
const std::string &getObjectDistributionOperatingMode() const;
const SsmPort getSsmPort() const;
uint64_t getTSI() const;
const std::optional<std::shared_ptr<reftools::mbstf::TunnelAddress>> &getTunnel() const;
const std::optional<std::string> &getTunnelAddr() const;
in_port_t getTunnelPortNumber() const;
uint32_t getRateLimit() const;
Expand Down
2 changes: 1 addition & 1 deletion src/mbstf/ObjectCarouselController.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void ObjectCarouselController::setObjectPackager()
const std::optional<std::string> &tunnel_addr = distributionSession().getTunnelAddr();
uint32_t rate_limit = distributionSession().getRateLimit();
in_port_t tunnel_port = distributionSession().getTunnelPortNumber();
unsigned short mtu = get_tunnelled_path_mtu(ssm_port, tunnel_addr, tunnel_port) - GTP_HEADER_SIZE;
unsigned short mtu = get_tunnelled_path_mtu(ssm_port, tunnel_addr, tunnel_port, GET_MTU_ETHERNET_PAYLOAD) - GTP_HEADER_SIZE;
packager(new ObjectCarouselPackager(objectStore(), *this, ssm_port, rate_limit, mtu, tunnel_addr, tunnel_port));
auto pkgr = getObjectCarouselPackager();
subscribeToService(*pkgr);
Expand Down
5 changes: 3 additions & 2 deletions src/mbstf/ObjectListController.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: ObjectListController class
******************************************************************************
* Copyright: (C)2025 British Broadcasting Corporation
* Copyright: (C)2025-2026 British Broadcasting Corporation
* Author(s): Dev Audsin <dev.audsin@bbc.co.uk>
* David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
* For full license terms please see the LICENSE file distributed with this
Expand Down Expand Up @@ -74,7 +75,7 @@ void ObjectListController::setObjectPackager() {
std::optional<std::string> tunnel_addr = distributionSession().getTunnelAddr();
uint32_t rate_limit = distributionSession().getRateLimit();
in_port_t tunnel_port = distributionSession().getTunnelPortNumber();
unsigned short mtu = get_tunnelled_path_mtu(ssm_port, tunnel_addr, tunnel_port) - GTP_HEADER_SIZE;
unsigned short mtu = get_tunnelled_path_mtu(ssm_port, tunnel_addr, tunnel_port, GET_MTU_ETHERNET_PAYLOAD) - GTP_HEADER_SIZE;
const auto &obj_list = objectStore().getObjects();
packager(new ObjectListPackager(objectStore(), *this, ssm_port, rate_limit, mtu, tunnel_addr, tunnel_port));
// Send all objects that are in the ObjectStore
Expand Down
3 changes: 2 additions & 1 deletion src/mbstf/ObjectListController.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: Object List Controller class
******************************************************************************
* Copyright: (C)2025 British Broadcasting Corporation
* Copyright: (C)2025-2026 British Broadcasting Corporation
* Author(s): Dev Audsin <dev.audsin@bbc.co.uk>
* David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
* For full license terms please see the LICENSE file distributed with this
Expand Down
5 changes: 3 additions & 2 deletions src/mbstf/ObjectStreamingController.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: ObjectStreamingController class
******************************************************************************
* Copyright: (C)2025 British Broadcasting Corporation
* Copyright: (C)2025-2026 British Broadcasting Corporation
* Author(s): Dev Audsin <dev.audsin@bbc.co.uk>
* David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
* For full license terms please see the LICENSE file distributed with this
Expand Down Expand Up @@ -72,7 +73,7 @@ void ObjectStreamingController::setObjectPackager()
const std::optional<std::string> &tunnel_addr = distributionSession().getTunnelAddr();
uint32_t rate_limit = distributionSession().getRateLimit();
in_port_t tunnel_port = distributionSession().getTunnelPortNumber();
unsigned short mtu = get_tunnelled_path_mtu(ssm_port, tunnel_addr, tunnel_port) - GTP_HEADER_SIZE;
unsigned short mtu = get_tunnelled_path_mtu(ssm_port, tunnel_addr, tunnel_port, GET_MTU_ETHERNET_PAYLOAD) - GTP_HEADER_SIZE;
packager(new ObjectListPackager(objectStore(), *this, ssm_port, rate_limit, mtu, tunnel_addr, tunnel_port));
auto pkgr = getObjectListPackager();
subscribeToService(*pkgr);
Expand Down
3 changes: 2 additions & 1 deletion src/mbstf/ObjectStreamingController.hh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
/******************************************************************************
* 5G-MAG Reference Tools: MBS Transport Function: Object Streaming Controller class
******************************************************************************
* Copyright: (C)2025 British Broadcasting Corporation
* Copyright: (C)2025-2026 British Broadcasting Corporation
* Author(s): Dev Audsin <dev.audsin@bbc.co.uk>
* David Waring <david.waring2@bbc.co.uk>
* License: 5G-MAG Public License v1
*
* For full license terms please see the LICENSE file distributed with this
Expand Down
Loading
Loading