Revision e5653fb6 mininet/link.py

View differences:

mininet/link.py
191 191
            if ( speedup > 0 and
192 192
                 self.node.name[0:1] == 's' ):
193 193
                bw = speedup
194
            # BL: As far as I can discern,
195
            # burst is the max number of bytes we can send in 1 ms, but
196
            # this may not actually be correct!  Why 1 ms?
197 194
            burst = bw * 1e6 / 8 * .001
195
            # This may not be correct - we should look more closely
196
            # at the semantics of burst (and cburst) to make sure we
197
            # are specifying the correct sizes. For now I have used
198
            # the same settings we had in the mininet-hifi code.
198 199
            if use_hfsc:
199 200
                cmds = [ '%s qdisc add dev %s root handle 1:0 hfsc default 1',
200 201
                          '%s class add dev %s parent 1:0 classid 1:1 hfsc sc '
201 202
                          + 'rate %fMbit ul rate %fMbit' % ( bw, bw ) ]
202 203
            elif use_tbf:
203
                # was: latency_us = 10 * 1500 * 8 / bw
204
                latency_us = 1000
204
                latency_us = 10 * 1500 * 8 / bw
205 205
                cmds = ['%s qdisc add dev %s root handle 1: tbf ' +
206
                        'rate %fMbit burst %f latency %fus' %
207
                         ( bw, burst, latency_us ) ]
206
                        'rate %fMbit burst 15000 latency %fus' %
207
                         ( bw, latency_us ) ]
208 208
            else:
209
                # This may not be correct - we should look more closely
210
                # at the semantics of burst and cburst to make sure we
211
                # are specifying the correct sizes.
212 209
                cmds = [ '%s qdisc add dev %s root handle 1:0 htb default 1',
213 210
                         '%s class add dev %s parent 1:0 classid 1:1 htb ' +
214
                         'rate %fMbit burst %f cburst %f' %
215
                         ( bw, burst, burst ) ]
211
                         'rate %fMbit burst 15k' % bw ]
216 212
            parent = ' parent 1:1 '
217 213

  
218 214
            # ECN or RED

Also available in: Unified diff