diff --git a/daemon/face/face-system.cpp b/daemon/face/face-system.cpp index 64307962..ebdce9c7 100644 --- a/daemon/face/face-system.cpp +++ b/daemon/face/face-system.cpp @@ -95,7 +95,6 @@ FaceSystem::processConfig(const ConfigSection& configSection, bool isDryRun, con 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 1a49fce1..87c0fc3b 100644 --- a/daemon/face/face-system.hpp +++ b/daemon/face/face-system.hpp @@ -84,7 +84,7 @@ public: */ 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 e2e05821..1e14cbf0 100644 --- a/docs/manpages.rst +++ b/docs/manpages.rst @@ -9,6 +9,7 @@ Manpages 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 f31a24f1..37c6c066 100644 --- a/docs/manpages/nfdc-face.rst +++ b/docs/manpages/nfdc-face.rst @@ -30,7 +30,8 @@ If enabled, this feature must also be enabled on the other endpoint to function 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 ether://[08:00:27:01:01:01] local dev://eth2 persistency 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 0370cf97..7ac472b7 100644 --- a/nfd.conf.sample.in +++ b/nfd.conf.sample.in @@ -83,7 +83,7 @@ face_system ; 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 698a5257..87edbe2e 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 @@ BOOST_FIXTURE_TEST_CASE_TEMPLATE(NewFace, T, TestCases, FaceManagerCommandFixtur 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()) {