Simulate network speeds using Fiddler
Asked Answered
P

3

40

I am using Fiddler and want to simulate different network speeds

Is there any published data that I can use to simulate different speeds using the delay value ?

Following is default code of Fiddler to simulate 56kb modem speed.

if (m_SimulateModem) {
    // Delay sends by 300ms per KB uploaded.
    oSession["request-trickle-delay"] = "300"; 
    // Delay receives by 150ms per KB downloaded.
    oSession["response-trickle-delay"] = "150"; 
}

I want the delay values for 256kbps, 512kbps, 1Mbps etc...

Pythagoreanism answered 29/4, 2013 at 10:45 Comment(3)
If you came here looking for throttling in fiddler as I did, note the above JavaScript code can be found by clicking the Rules menu ==> Customize Rules... Then find the text 'm_simulateModem' near line 189. Adjust these values to delay each Kb of data by x milliseconds.Ocher
@Ocher - thanks for the shortcut - another tip for those adjusting these values for throttling - every time you save CustomRules.js Fiddler will turn off the Rules | Performance | Simulate Modem Speeds flag. You need to turn it back on if you want your new upload/download delays to apply.Finely
@Ocher & Drew: Thanks for those comments, that really helped me, as I couldn't work out how to change the speeds and then why they were not taking effect.Guttery
P
48

This is simply a math problem.

Assuming that content is available instantly (e.g. you're playing it back from the AutoResponder) then the only delay is controlled by request-trickle-delay and response-trickle-delay flags.

There are 1000 milliseconds per second.

So, if you want to gate the connection to 1 megabyte per second, you would use a delay of 1 ms. If you want to gate it to 512 kilobyte per second, then use a delay of 2 ms. For 256 kilobytes per second, use a delay of 4 ms.

Keep in mind that bandwidth is often measured in bits per second rather than bytes per second. So if your goal is to measure things in bits-per-second, then multiply each value by 8.

Pasia answered 29/4, 2013 at 15:44 Comment(4)
Thanks Eric. I guess this plugin for Fiddler does the same: logic-worx.com/index.php/tools-and-apps/…Pythagoreanism
Can't beat getting an answer from the man who wrote the software! This is one of the reasons I love SO...Bybidder
Is it possible to set fractional trickle delays? I tried setting to "0.5" to get 2056KBs and it seemed to lock up the connection.Gully
@JarrodSmith: Not today, no; Fiddler interprets the value as an Integer. I expect Fiddler's bandwidth-emulation features to get richer in the future.Pasia
F
38

I made changes to request-trickle-delay and response-trickle-delay that EricLaw Recommended. I used SpeedTest.Net to valaidate the changes I made. They didn't match up perfectly. For example I expected that if I set Trickle Delay values to 8 I would get download speed of 1 Mbps, but actually got 2.05 Mbps. Based on EricLaw's answer at least I was able to identify a pattern. Thanks Eric.

After each change to the Fiddler CustomerRule.js file I re-enabled "Simulate Modem Speed". FYI, when you make a change to the CustomerRule.js file the "Simulate Modem Speed" is disabled. So you must re-enable the setting.

I added a few images of results from SpeedTest.net.

Below are the results for each setting change:

enter image description here

Fiddler Settings

enter image description here

Here I set request-trickle-delay and response-trickle-delay to 16. As you can see I received 1.03 Mbps

enter image description here

Here I set request-trickle-delay and response-trickle-delay to 32. As you can see I received 0.52 Mbps

enter image description here

Forebrain answered 23/1, 2014 at 16:56 Comment(3)
How did you managed to affect speedtest.net using Fiddler? In my case it affect webpages download, images download etc., but not speedtest.netAndy
@Leonid Vasilyev In Firefox you have to set up proxy manually. Automatic detection doen't work.Awe
When experimenting with the script's settings you can change the m_SimulateModem declaration to default to true so it is enabled after the script loads. Just remember to turn it back to false after you're done.Rustication
B
1

Old post but I wanted to add some information here to make Fiddler throttling a little more user friendly. We are going to create a new menu under Rules with a bunch of modem speeds to select.

Click Rules -> Customize Rules option

Customize Rules menu option (CTRL+R)

Search for the declaration of m_SimulateModem which looks like:

public static var m_SimulateModem: Boolean

and replace it with a RulesString.

    // Cause Fiddler Classic to delay HTTP traffic to simulate typical modem conditions
    RulesString("Simulate &Modem Speeds", true) 
    BindPref("fiddlerscript.ephemeral.ModemSpeed")
    RulesStringValue(0,"5&6 kbps", "56")
    RulesStringValue(1,"&128 kbps", "128")
    RulesStringValue(2,"&256 kbps", "256")
    RulesStringValue(3,"&512 kbps", "512")
    RulesStringValue(4,"1 &mbps", "1m")
    var m_SimulateModem: String = null;

Search the rules again for m_SimulateModem, we are looking for the if statement where trickle is applied. Remove the if block and swap it for the following case statement:

switch (m_SimulateModem) {

    case "56": // 56kbps
        oSession["request-trickle-delay"] = "760"; 
        oSession["response-trickle-delay"] = "440";         
        break;
    
    case "128": // 128kbps
        oSession["request-trickle-delay"] = "380"; 
        oSession["response-trickle-delay"] = "220";             
        break;
    
    case "256": // 256kbps
        oSession["request-trickle-delay"] = "190"; 
        oSession["response-trickle-delay"] = "110";         
        break;
    
    case "512": // 512kbps
        oSession["request-trickle-delay"] = "95"; 
        oSession["response-trickle-delay"] = "55";          
        break;
    
    case "1m": // 1 mbps
        oSession["request-trickle-delay"] = "46"; 
        oSession["response-trickle-delay"] = "27";          
        break;
    
    case null:          
    default:
        break;
}

Save your rules file. You will now have an option under Rules -> Simulate modem speeds with various throttling options:

Throttling speeds to 512kbps

The numbers have been massaged using Speed Test to get close to the desired speeds in real life.

Speed Test showing 512kbps throttling

Bonus points: try viewing your favourite internet sites with throttling at 56kbps.

Bunyabunya answered 13/9, 2022 at 9:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.