face: enable congestion marking by default on supported faces
refs #4465
Change-Id: Id545f83763f1ba27ba0d770fd4398948d6f20acf
diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp
index 6430796..ebdce9c 100644
--- a/daemon/face/face-system.cpp
+++ b/daemon/face/face-system.cpp
@@ -95,7 +95,6 @@
for (const auto& pair : *generalSection) {
const std::string& key = pair.first;
if (key == "enable_congestion_marking") {
- // false by default
context.generalConfig.wantCongestionMarking = ConfigFile::parseYesNo(pair, "face_system.general");
}
else {
diff --git a/daemon/face/face-system.hpp b/daemon/face/face-system.hpp
index 1a49fce..87c0fc3 100644
--- a/daemon/face/face-system.hpp
+++ b/daemon/face/face-system.hpp
@@ -84,7 +84,7 @@
*/
struct GeneralConfig
{
- bool wantCongestionMarking = false;
+ bool wantCongestionMarking = true;
};
/** \brief context for processing a config section in ProtocolFactory
diff --git a/docs/manpages.rst b/docs/manpages.rst
index e2e0582..1e14cbf 100644
--- a/docs/manpages.rst
+++ b/docs/manpages.rst
@@ -9,6 +9,7 @@
manpages/nfdc-status
manpages/nfdc-face
manpages/nfdc-route
+ manpages/nfdc-cs
manpages/nfdc-strategy
manpages/nfd-status
schema
diff --git a/docs/manpages/nfdc-face.rst b/docs/manpages/nfdc-face.rst
index f31a24f..37c6c06 100644
--- a/docs/manpages/nfdc-face.rst
+++ b/docs/manpages/nfdc-face.rst
@@ -30,7 +30,8 @@
Reliability is disabled by default.
The send queue congestion detection and signaling feature may be explicitly enabled by specifying
**congestion-marking on** or explicitly disabled by specifying **congestion-marking off**.
-Congestion marking is disabled by default.
+Congestion marking is enabled by default on TCP, UDP, and Unix stream faces and is disabled by
+default on all other face types.
Parameters for this feature can set with the **congestion-marking-interval** option (specified in
milliseconds) and the **default-congestion-threshold** option (specified in bytes).
@@ -117,9 +118,12 @@
nfdc face create remote udp://router.example.net reliability on
Create a face with the specified remote FaceUri and enable NDNLP reliability.
-nfdc face create remote udp://router.example.net congestion-marking on congestion-marking-interval 100 default-congestion-threshold 65536
- Create a face with the specified remote FaceUri and enable congestion marking. Set the base
- congestion marking interval to 100 ms and the default congestion threshold to 65536 bytes.
+nfdc face create remote udp://router.example.net congestion-marking-interval 100 default-congestion-threshold 65536
+ Create a face with the specified remote FaceUri. Set the base congestion marking interval to
+ 100 ms and the default congestion threshold to 65536 bytes.
+
+nfdc face create remote udp://router.example.net congestion-marking off
+ Create a face with the specified remote FaceUri and explicitly disable congestion marking.
nfdc face destroy 300
Destroy the face whose FaceId is 300.
diff --git a/nfd.conf.sample.in b/nfd.conf.sample.in
index 0370cf9..7ac472b 100644
--- a/nfd.conf.sample.in
+++ b/nfd.conf.sample.in
@@ -83,7 +83,7 @@
; This section contains options that apply to multiple face protocols.
general
{
- enable_congestion_marking no ; set to 'yes' to perform congestion marking on supported faces, default 'no'
+ enable_congestion_marking yes ; set to 'no' to disable congestion marking on supported faces, default 'yes'
}
; The unix section contains settings for Unix stream faces and channels.
diff --git a/tests/daemon/mgmt/face-manager-create-face.t.cpp b/tests/daemon/mgmt/face-manager-create-face.t.cpp
index 698a525..87edbe2 100644
--- a/tests/daemon/mgmt/face-manager-create-face.t.cpp
+++ b/tests/daemon/mgmt/face-manager-create-face.t.cpp
@@ -330,14 +330,20 @@
actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED),
actualParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED));
- BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED),
- actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
+ if (expectedParams.hasFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED)) {
+ BOOST_CHECK_EQUAL(expectedParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED),
+ actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
+ }
+ else {
+ BOOST_CHECK(actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
+ }
}
else {
- // local fields are disabled by default
- BOOST_CHECK_EQUAL(actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED), false);
- BOOST_CHECK_EQUAL(actualParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED), false);
- BOOST_CHECK_EQUAL(actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED), false);
+ // local fields and LpReliability are disabled by default, congestion marking is enabled
+ // by default on TCP, UDP, and Unix stream
+ BOOST_CHECK(!actualParams.getFlagBit(ndn::nfd::BIT_LOCAL_FIELDS_ENABLED));
+ BOOST_CHECK(!actualParams.getFlagBit(ndn::nfd::BIT_LP_RELIABILITY_ENABLED));
+ BOOST_CHECK(actualParams.getFlagBit(ndn::nfd::BIT_CONGESTION_MARKING_ENABLED));
}
if (expectedParams.hasBaseCongestionMarkingInterval()) {