| OLD | NEW |
| 1 # QUIC network simulator | 1 # QUIC network simulator |
| 2 | 2 |
| 3 This directory contains a discrete event network simulator which QUIC code uses | 3 This directory contains a discrete event network simulator which QUIC code uses |
| 4 for testing congestion control and other transmission control code that requires | 4 for testing congestion control and other transmission control code that requires |
| 5 a network simulation for tests on QuicConnection level of abstraction. | 5 a network simulation for tests on QuicConnection level of abstraction. |
| 6 | 6 |
| 7 ## Actors | 7 ## Actors |
| 8 | 8 |
| 9 The core of the simulator is the Simulator class, which maintains a virtual | 9 The core of the simulator is the Simulator class, which maintains a virtual |
| 10 clock and an event queue. Any object in a simulation that needs to schedule | 10 clock and an event queue. Any object in a simulation that needs to schedule |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 ```c++ | 24 ```c++ |
| 25 class LogClock : public Actor { | 25 class LogClock : public Actor { |
| 26 public: | 26 public: |
| 27 LogClock(Simulator* simulator, std::string name) : Actor(simulator, name) { | 27 LogClock(Simulator* simulator, std::string name) : Actor(simulator, name) { |
| 28 Schedule(clock_->Now()); | 28 Schedule(clock_->Now()); |
| 29 } | 29 } |
| 30 ~LogClock() override {} | 30 ~LogClock() override {} |
| 31 | 31 |
| 32 void Act() override { | 32 void Act() override { |
| 33 VLOG(1) << "The current time is " << clock_->Now().ToDebuggingValue(); | 33 QUIC_LOG(INFO) << "The current time is " << clock_->Now().ToDebuggingValue()
; |
| 34 Schedule(clock_->Now() + QuicTime::Delta::FromMilliseconds(100)); | 34 Schedule(clock_->Now() + QuicTime::Delta::FromMilliseconds(100)); |
| 35 } | 35 } |
| 36 }; | 36 }; |
| 37 ``` | 37 ``` |
| 38 | 38 |
| 39 A QuicAlarm object can be used to schedule events in the simulation using | 39 A QuicAlarm object can be used to schedule events in the simulation using |
| 40 `Simulator::GetAlarmFactory()`. | 40 `Simulator::GetAlarmFactory()`. |
| 41 | 41 |
| 42 ## Ports | 42 ## Ports |
| 43 | 43 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 Besides `SymmetricLink`, the simulator provides the following objects: | 89 Besides `SymmetricLink`, the simulator provides the following objects: |
| 90 | 90 |
| 91 * `Queue` allows to convert a constrained port into an unconstrained one by | 91 * `Queue` allows to convert a constrained port into an unconstrained one by |
| 92 buffering packets upon arrival. The queue has a finite size, and once the | 92 buffering packets upon arrival. The queue has a finite size, and once the |
| 93 queue is full, the packets are silently dropped. | 93 queue is full, the packets are silently dropped. |
| 94 * `Switch` simulates a multi-port learning switch with a fixed queue for each | 94 * `Switch` simulates a multi-port learning switch with a fixed queue for each |
| 95 output port. | 95 output port. |
| 96 * `QuicEndpoint` allows QuicConnection to be run over the simulated network. | 96 * `QuicEndpoint` allows QuicConnection to be run over the simulated network. |
| 97 * `QuicEndpointMultiplexer` allows multiple connections to share the same | 97 * `QuicEndpointMultiplexer` allows multiple connections to share the same |
| 98 network endpoint. | 98 network endpoint. |
| OLD | NEW |