Skip to content

Commit 9d62958

Browse files
committed
Basic flow as TcpFLow instance
1 parent 71bbe01 commit 9d62958

13 files changed

Lines changed: 57 additions & 214 deletions

File tree

source/flow/basic_flow.cpp

Lines changed: 0 additions & 129 deletions
This file was deleted.

source/flow/basic_flow.hpp

Lines changed: 0 additions & 59 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
3+
#include "basic_cc.hpp"
4+
#include "flow/tcp/tcp_flow.hpp"
5+
namespace sim {
6+
7+
using BasicFlow = TcpFlow<BasicCC>;
8+
9+
} // namespace sim

source/flow/tcp/basic/basic_cc.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "basic_cc.hpp"
2+
3+
#include <limits>
4+
5+
namespace sim {
6+
7+
bool BasicCC::on_ack(Time rtt, bool ecn_flag) {
8+
(void)rtt;
9+
(void)ecn_flag;
10+
return false;
11+
}
12+
13+
double BasicCC::get_cwnd() const { return std::numeric_limits<double>::max(); }
14+
15+
Time BasicCC::get_pacing_delay() const { return 0; }
16+
17+
} // namespace sim

source/flow/tcp/basic/basic_cc.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
#include "flow/tcp/i_tcp_cc.hpp"
3+
4+
// Represents no congestion control
5+
namespace sim {
6+
class BasicCC : public ITcpCC {
7+
public:
8+
bool on_ack(Time rtt, bool ecn_flag) final;
9+
Time get_pacing_delay() const final;
10+
double get_cwnd() const final;
11+
};
12+
} // namespace sim
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
#include "i_tcp_cc.hpp"
2+
#include "flow/tcp/i_tcp_cc.hpp"
33

44
namespace sim {
55
class TcpTahoeCC : public ITcpCC {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3-
#include "tcp_flow.hpp"
4-
3+
#include "flow/tcp/tcp_flow.hpp"
4+
#include "tcp_tahoe_cc.hpp"
55
namespace sim {
66

77
using TcpTahoeFlow = TcpFlow<TcpTahoeCC>;

source/flow/tcp/tcp_flow.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include "metrics/metrics_collector.hpp"
1010
#include "packet.hpp"
1111
#include "scheduler.hpp"
12-
#include "tcp_tahoe_cc.hpp"
1312
#include "utils/flag_manager.hpp"
1413

1514
namespace sim {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "flow/tcp/basic/basic_cc.hpp"
2+
#include "parse_tcp_flow.hpp"
3+
4+
namespace sim {
5+
template <>
6+
BasicCC IdentifieableParser<TcpFlow<BasicCC>>::parse_tcp_cc(
7+
const YAML::Node& key_node, const YAML::Node& value_node) {
8+
(void)key_node;
9+
(void)value_node;
10+
return BasicCC();
11+
}
12+
13+
} // namespace sim

0 commit comments

Comments
 (0)