aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/hicn')
-rw-r--r--libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc6
-rw-r--r--libtransport/src/hicn/transport/protocols/manifest_indexing_manager.cc18
-rw-r--r--libtransport/src/hicn/transport/protocols/manifest_indexing_manager.h4
-rw-r--r--libtransport/src/hicn/transport/protocols/rtc.cc4
-rw-r--r--libtransport/src/hicn/transport/utils/suffix_strategy.h5
5 files changed, 31 insertions, 6 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
index c1a45ebb7..f1057aa57 100644
--- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
+++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
@@ -150,8 +150,9 @@ void RTCProducerSocket::produce(std::unique_ptr<utils::MemBuf> &&buffer) {
producedBytes_ += (uint32_t)(buffer_size + headerSize_ + TIMESTAMP_LEN);
producedPackets_++;
+ Name n(flowName_);
auto content_object =
- std::make_shared<ContentObject>(flowName_.setSuffix(currentSeg_.load()));
+ std::make_shared<ContentObject>(n.setSuffix(currentSeg_.load()));
auto payload = utils::MemBuf::create(TIMESTAMP_LEN);
memcpy(payload->writableData(), &now, TIMESTAMP_LEN);
@@ -340,8 +341,9 @@ void RTCProducerSocket::sendNack(uint32_t sequence) {
nack_payload->append(NACK_HEADER_SIZE);
ContentObject nack;
+ Name n(flowName_);
nack.appendPayload(std::move(nack_payload));
- nack.setName(flowName_.setSuffix(sequence));
+ nack.setName(n.setSuffix(sequence));
uint32_t *payload_ptr = (uint32_t *)nack.getPayload()->data();
*payload_ptr = currentSeg_.load();
diff --git a/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.cc b/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.cc
index 9af6a5c3a..05cabc60d 100644
--- a/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.cc
+++ b/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.cc
@@ -29,6 +29,7 @@ ManifestIndexManager::ManifestIndexManager(
interface::ConsumerSocket *icn_socket, TransportProtocol *next_interest)
: IncrementalIndexManager(icn_socket),
PacketManager<Interest>(1024),
+ manifests_in_flight_(0),
next_reassembly_segment_(suffix_queue_.end()),
next_to_retrieve_segment_(suffix_queue_.end()),
suffix_manifest_(core::NextSegmentCalculationStrategy::INCREMENTAL, 0),
@@ -86,7 +87,14 @@ bool ManifestIndexManager::onManifest(
// Set the iterators to the beginning of the suffix queue
next_reassembly_segment_ = suffix_queue_.begin();
// Set number of segments in manifests assuming the first one is full
- suffix_manifest_.setNbSegments(std::distance(_it, _end) - 1);
+ suffix_manifest_.setNbSegments(
+ std::distance(manifest->getSuffixList().begin(),
+ manifest->getSuffixList().end()) -
+ 1);
+ suffix_manifest_.setSuffixStrategy(
+ manifest->getNextSegmentCalculationStrategy());
+ } else if (manifests_in_flight_) {
+ manifests_in_flight_--;
}
if (TRANSPORT_EXPECT_FALSE(manifest->isFinalManifest() ||
@@ -110,6 +118,10 @@ bool ManifestIndexManager::onManifest(
// Manifest namespace
Name &name = manifest->getWritableName();
+ if (manifests_in_flight_ >= MAX_MANIFESTS_IN_FLIGHT) {
+ break;
+ }
+
// Send as many manifest as required for filling window.
do {
segment_count += suffix_manifest_.getNbSegments();
@@ -132,8 +144,10 @@ bool ManifestIndexManager::onManifest(
std::placeholders::_1, std::placeholders::_2),
std::bind(&ManifestIndexManager::onManifestTimeout, this,
std::placeholders::_1));
+ manifests_in_flight_++;
} while (segment_count < current_window_size &&
- suffix_manifest_.getSuffix() < final_suffix_);
+ suffix_manifest_.getSuffix() < final_suffix_ &&
+ manifests_in_flight_ < MAX_MANIFESTS_IN_FLIGHT);
break;
}
diff --git a/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.h b/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.h
index 5f74ef0bf..74c86eb60 100644
--- a/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.h
+++ b/libtransport/src/hicn/transport/protocols/manifest_indexing_manager.h
@@ -21,6 +21,9 @@
#include <list>
+/* #define MAX_MANIFESTS_IN_FLIGHT std::numeric_limits<uint32_t>::max() */
+#define MAX_MANIFESTS_IN_FLIGHT 10
+
namespace transport {
namespace protocol {
@@ -57,6 +60,7 @@ class ManifestIndexManager : public IncrementalIndexManager,
void onManifestTimeout(Interest::Ptr &&i);
protected:
+ uint32_t manifests_in_flight_;
SuffixQueue suffix_queue_;
SuffixQueue::iterator next_reassembly_segment_;
SuffixQueue::iterator next_to_retrieve_segment_;
diff --git a/libtransport/src/hicn/transport/protocols/rtc.cc b/libtransport/src/hicn/transport/protocols/rtc.cc
index 1a3511003..aeee48bac 100644
--- a/libtransport/src/hicn/transport/protocols/rtc.cc
+++ b/libtransport/src/hicn/transport/protocols/rtc.cc
@@ -505,7 +505,7 @@ void RTCTransportProtocol::scheduleNextInterests() {
}
void RTCTransportProtocol::sentinelTimer(){
- uint32_t wait = 10;
+ uint32_t wait = 50;
if(pathTable_.find(producerPathLabels_[0]) != pathTable_.end() &&
pathTable_.find(producerPathLabels_[1]) != pathTable_.end()){
@@ -545,7 +545,7 @@ void RTCTransportProtocol::sentinelTimer(){
uint64_t max_waiting_time =
round((pathTable_[producerPathLabels_[1]]->getMinRtt() -
pathTable_[producerPathLabels_[0]]->getMinRtt()) +
- pathTable_[producerPathLabels_[0]]->getInterArrivalGap()) * 2;
+ (pathTable_[producerPathLabels_[0]]->getInterArrivalGap() * 10));
if((currentState_ == HICN_RTC_NORMAL_STATE) &&
(inflightInterestsCount_ >= currentCWin_) &&
diff --git a/libtransport/src/hicn/transport/utils/suffix_strategy.h b/libtransport/src/hicn/transport/utils/suffix_strategy.h
index 99e557380..4358d12f0 100644
--- a/libtransport/src/hicn/transport/utils/suffix_strategy.h
+++ b/libtransport/src/hicn/transport/utils/suffix_strategy.h
@@ -31,6 +31,11 @@ class SuffixStrategy {
return suffix_stragegy_;
}
+ void setSuffixStrategy(
+ transport::core::NextSegmentCalculationStrategy strategy) {
+ suffix_stragegy_ = strategy;
+ }
+
std::uint32_t getSuffix() { return suffix_; }
virtual std::uint32_t getNextSuffix() = 0;