fnss.netconfig.buffers.set_buffer_sizes_bw_delay_prod¶
-
set_buffer_sizes_bw_delay_prod
(topology, buffer_unit='bytes', packet_size=1500)[source]¶ Assign a buffer sizes proportionally to the product of link bandwidth and average network RTT. This is a rule of thumb according to which the buffers of Internet routers are generally configured.
Parameters: - topology : Topology or DirectedTopology
The topology on which delays are applied.
- buffer_unit : string
The unit of buffer sizes. Supported units are: bytes and packets
- packet_size : int, optional
The average packet size (in bytes). It used only if packets is selected as buffer size to properly calculate buffer sizes given bandwidth and delay values.
Examples
>>> import fnss >>> topology = fnss.erdos_renyi_topology(50, 0.2) >>> fnss.set_capacities_constant(topology, 10, 'Mbps') >>> fnss.set_delays_constant(topology, 2, 'ms') >>> fnss.set_buffer_sizes_bw_delay_prod(topology)