aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/hicn
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-10-04 11:20:18 +0200
committermichele papalini <micpapal@cisco.com>2019-10-04 11:20:18 +0200
commitceba475ec9badd75516863b7bec46d5d10f0b957 (patch)
treeb732b6c5dc81d43f245dec3562d3afce5d2ea48d /libtransport/src/hicn
parenteaaff7fa111c821ed6710dec7b6c49c5ecac6ad4 (diff)
[HICN-292] fix inflight interests counting
Change-Id: I1b02b9338e43de27cf90b4a11121c54a00ed428a Signed-off-by: michele papalini <micpapal@cisco.com>
Diffstat (limited to 'libtransport/src/hicn')
-rw-r--r--libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc5
-rw-r--r--libtransport/src/hicn/transport/protocols/rtc.cc39
2 files changed, 25 insertions, 19 deletions
diff --git a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
index 481b42a10..d1e89efdc 100644
--- a/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
+++ b/libtransport/src/hicn/transport/interfaces/rtc_socket_producer.cc
@@ -191,6 +191,11 @@ void RTCProducerSocket::onInterest(Interest::Ptr &&interest) {
return;
}
+ if(interestSeg > HICN_MAX_DATA_SEQ){
+ sendNack(*interest, isActive);
+ return;
+ }
+
uint32_t max_gap = (uint32_t)floor(
(double)((double)((double)lifetime * INTEREST_LIFETIME_REDUCTION_FACTOR /
1000.0) *
diff --git a/libtransport/src/hicn/transport/protocols/rtc.cc b/libtransport/src/hicn/transport/protocols/rtc.cc
index 070ce2c6a..acdf15639 100644
--- a/libtransport/src/hicn/transport/protocols/rtc.cc
+++ b/libtransport/src/hicn/transport/protocols/rtc.cc
@@ -497,7 +497,7 @@ void RTCTransportProtocol::addRetransmissions(uint32_t start, uint32_t stop) {
auto it = interestRetransmissions_.find(i);
if (it == interestRetransmissions_.end()) {
if (lastSegNacked_ <= i) {
- // i must be larger than the last past nack received
+ // it must be larger than the last past nack received
packetLost_++;
interestRetransmissions_[i] = 0;
uint32_t pkt = i & modMask_;
@@ -614,6 +614,12 @@ void RTCTransportProtocol::onTimeout(Interest::Ptr &&interest) {
// packetLost_++;
uint32_t segmentNumber = interest->getName().getSuffix();
+
+ if(segmentNumber >= HICN_MIN_PROBE_SEQ){
+ //this is a timeout on a probe, do nothing
+ return;
+ }
+
uint32_t pkt = segmentNumber & modMask_;
if (inflightInterests_[pkt].state == sent_) {
@@ -746,30 +752,25 @@ void RTCTransportProtocol::onContentObject(
(*callback_content_object)(*socket_, *content_object);
}
- if(segmentNumber == probe_seq_number_){
- if(payload_size == HICN_NACK_HEADER_SIZE){
- if(!received_probe_){
- received_probe_ = true;
+ if(segmentNumber >= HICN_MIN_PROBE_SEQ){
+ if(segmentNumber == probe_seq_number_ && !received_probe_){
+ received_probe_ = true;
- uint32_t pathLabel = content_object->getPathLabel();
- if (pathTable_.find(pathLabel) == pathTable_.end()){
- //if this path does not exists we cannot create a new one so drop
- return;
- }
+ uint32_t pathLabel = content_object->getPathLabel();
+ if (pathTable_.find(pathLabel) == pathTable_.end()){
+ //if this path does not exists we cannot create a new one so drop
+ return;
+ }
- //this is the expected probe, update the RTT and drop the packet
- uint64_t RTT = std::chrono::duration_cast<std::chrono::milliseconds>(
+ //this is the expected probe, update the RTT and drop the packet
+ uint64_t RTT = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now().time_since_epoch())
.count() - time_sent_probe_;
- pathTable_[pathLabel]->insertRttSample(RTT);
- pathTable_[pathLabel]->receivedNack();
- return;
- }
- }else{
- //this should never happen
- //don't know what to do, let's try to process it as normal packet
+ pathTable_[pathLabel]->insertRttSample(RTT);
+ pathTable_[pathLabel]->receivedNack();
}
+ return;
}
if (payload_size == HICN_NACK_HEADER_SIZE) {