Skip to content

Commit

Permalink
Make quic knobs available in mobileconfigs
Browse files Browse the repository at this point in the history
Summary:
After discussion with mjoras, it seems a good idea to make a special knob
space for quic's internal uses. This is the first step towards that. I use json
as the serialized format because it's fairly easy to write/parse, and probably more
reliable than implementing our own special syntax. ~~Currently we should use
numbers only, but we can make it easier for config writers by reserving a
predefined map<string, int> for commonly used knob spaces and knob ids.~~

~~For example, for d6d's blackhole detection threshold we could have it as
`{"quic_transport": { "d6d_blackhole_detection_threshold":  5 }}`. And we can store
the mapping somewhere convenient for mobile clients (perhaps another string  in
mobile config?).~~
```
"quic_knob_spaces": {
  "quic_transport" : {
     "space_id" : 0,
     "knob_ids" : {
        "d6d_blackhole_detection_threshold" : 0,
        ...
     }
  }
}
```

Reviewed By: mjoras

Differential Revision: D23822004

fbshipit-source-id: ddb60b86c3a8eb54ae0a011a2e041e096e14cb9e
  • Loading branch information
xttjsn authored and facebook-github-bot committed Sep 24, 2020
1 parent 4c3a765 commit 1d75cbf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions quic/QuicConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ constexpr uint64_t kDefaultBufferSpaceAvailable =
constexpr std::chrono::microseconds kDefaultMinRtt =
std::chrono::microseconds::max();

// Default knob space for transport knobs
constexpr uint64_t kDefaultQuicTransportKnobSpace = 0xfaceb001;

// Default knob id for transport knobs
constexpr uint64_t kDefaultQuicTransportKnobId = 1;

enum class FrameType : uint64_t {
PADDING = 0x00,
PING = 0x01,
Expand Down
9 changes: 9 additions & 0 deletions quic/state/TransportSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ struct D6DConfig {
ProbeSizeRaiserType raiserType{ProbeSizeRaiserType::ConstantStep};
};

// JSON-serialized transoprt knobs
struct SerializedKnob {
uint64_t space;
uint64_t id;
folly::StringPiece blob;
};

struct TransportSettings {
// The initial connection window advertised to the peer.
uint64_t advertisedInitialConnectionWindowSize{kDefaultConnectionWindowSize};
Expand Down Expand Up @@ -237,6 +244,8 @@ struct TransportSettings {
bool orderedReadCallbacks{false};
// Config struct for D6D
D6DConfig d6dConfig;
// Quic knobs
std::vector<SerializedKnob> knobs;
};

} // namespace quic

0 comments on commit 1d75cbf

Please sign in to comment.