proxygen
Main.cpp File Reference

Go to the source code of this file.

Functions

 DEFINE_string (input,"","File containing requests")
 
 DEFINE_string (scheme,"qpack","Scheme: <qpack|qmin|hpack>")
 
 DEFINE_int32 (rtt, 100,"Simulated RTT")
 
 DEFINE_double (lossp, 0.0,"Loss Probability")
 
 DEFINE_double (delayp, 0.05,"Delay Probability")
 
 DEFINE_int32 (delay, 100,"Max extra delay")
 
 DEFINE_int32 (ooo_thresh, 0,"First seqn to allow ooo")
 
 DEFINE_int32 (table_size, 4096,"HPACK dynamic table size")
 
 DEFINE_int64 (seed, 0,"RNG seed")
 
 DEFINE_bool (blend, true,"Blend all facebook.com and fbcdn.net domains")
 
 DEFINE_int32 (max_blocking, 100,"Maximum number of vulnerable/blocking header blocks")
 
 DEFINE_bool (same_packet_compression, true,"Allow QPACK to compress across ""headers the same packet")
 
int main (int argc, char *argv[])
 

Function Documentation

DEFINE_bool ( blend  ,
true  ,
"Blend all facebook.com and fbcdn.net domains"   
)
DEFINE_bool ( same_packet_compression  ,
true  ,
"Allow QPACK to compress across ""headers the same packet"   
)
DEFINE_double ( lossp  ,
0.  0,
"Loss Probability"   
)
DEFINE_double ( delayp  ,
0.  05,
"Delay Probability"   
)
DEFINE_int32 ( rtt  ,
100  ,
"Simulated RTT  
)
DEFINE_int32 ( delay  ,
100  ,
"Max extra delay"   
)
DEFINE_int32 ( ooo_thresh  ,
,
"First seqn to allow ooo"   
)
DEFINE_int32 ( table_size  ,
4096  ,
"HPACK dynamic table size"   
)
DEFINE_int32 ( max_blocking  ,
100  ,
"Maximum number of vulnerable/blocking header blocks"   
)
DEFINE_int64 ( seed  ,
,
"RNG seed  
)
DEFINE_string ( input  ,
""  ,
"File containing requests  
)
DEFINE_string ( scheme  ,
"qpack"  ,
"Scheme: <qpack|qmin|hpack>"   
)
int main ( int  argc,
char *  argv[] 
)

Definition at line 39 of file Main.cpp.

References proxygen::compress::HPACK, folly::init(), proxygen::compress::QMIN, proxygen::compress::QPACK, folly::Random::rand64(), proxygen::compress::CompressionSimulator::readInputFromFileAndSchedule(), proxygen::compress::CompressionSimulator::run(), folly::pushmi::detail::t, uint16_t, and uint32_t.

39  {
40  folly::init(&argc, &argv, true);
41  if (FLAGS_same_packet_compression) {
42  LOG(WARNING) << "Same packet compression no longer supported";
43  }
44 
45  if (FLAGS_input.empty()) {
46  LOG(ERROR) << "Must supply a filename";
47  return 1;
48  }
49 
50  SchemeType t = SchemeType::QPACK;
51  if (FLAGS_scheme == "qpack") {
52  LOG(INFO) << "Using QPACK";
53  t = SchemeType::QPACK;
54  } else if (FLAGS_scheme == "qmin") {
55  LOG(INFO) << "Using QMIN";
56  t = SchemeType::QMIN;
57  } else if (FLAGS_scheme == "hpack") {
58  LOG(INFO) << "Using HPACK with table size=" << FLAGS_table_size;
59  t = SchemeType::HPACK;
60  } else {
61  LOG(ERROR) << "Unsupported scheme";
62  return 1;
63  }
64 
65  if (FLAGS_seed == 0) {
66  FLAGS_seed = folly::Random::rand64();
67  std::cout << "Seed: " << FLAGS_seed << std::endl;
68  }
69  SimParams p{t,
70  FLAGS_seed,
71  std::chrono::milliseconds(FLAGS_rtt),
72  FLAGS_lossp,
73  FLAGS_delayp,
74  std::chrono::milliseconds(FLAGS_delay),
75  uint16_t(FLAGS_ooo_thresh),
76  FLAGS_blend,
77  FLAGS_same_packet_compression,
78  uint32_t(FLAGS_table_size),
79  uint32_t(FLAGS_max_blocking)};
80  CompressionSimulator sim(p);
81  if (sim.readInputFromFileAndSchedule(FLAGS_input)) {
82  sim.run();
83  }
84 
85  return 0;
86 }
void init(int *argc, char ***argv, bool removeFlags)
Definition: Init.cpp:34
char ** argv
static uint64_t rand64()
Definition: Random.h:263