- 1 Overview
- 2 Alternatives
- 3 How to flash Tomato
- 4 How to configure Tomato
- 5 Additional thoughts
The following figures are referred to in this article.
For a full description of Tomato's features, see the Tomato's Wikibook.
For general information about QoS, see the main QoS How-To.
For information about alternatives, see the main QoS How-To.
How to flash Tomato
This article does not cover the process of flashing your router. You are encouraged to fully understand how to flash before doing it. If done carelessly, you can "brick your router" (make it unusable). The following suggestions are provided as a starting point:
- For questions (before and after flashing), see the Tomato support forum.
- If you need to buy a router to use with Tomato, this poll of which router is most commonly used with Tomato may help you guage which router is "best" (simply based upon popularity).
How to configure Tomato
After flashing your router with Tomato, open a web browser to your router's IP address, most likely http://192.168.1.1. This is Tomato's Administration UI. The default login is user = root, password = admin.
Step 1: Basic Settings -- Outbound
- Refer to Figure 1.
- Navigate to QoS and Basic Settings.
- Make the top of your page look like Figure 1.
However, the Max Bandwidth should be changed to reflect your maximum upload bandwidth. You can go to speedtest.net and run some tests to determine your speed.
Be sure to Save your changes.
Note: Max Bandwidth should be a conservative value. For example, if your speed varies throughout the day, you should use the slowest speed you regularly experience. If you use cable internet, and it has "speed boost" (a temporary increase in bandwidth), you should take that into consideration too.
The importance of this speed being accurate (and conservative) is that Tomato not only prioritizes packets according to the rules you specify (see Step 3), but it will also throttle the speed at which it sends them. If you set your Max Bandwidth too aggressively, Tomato will send packets too fast, causing congestion which will diminish the benefits of prioritization.
Starting with version 1.23, Tomato includes a new feature called TCP Vegas. You will see it at the bottom of the page. This is an outbound congestion avoidance algorithm built into the Linux kernel. For some people this may work better than QoS. For others, it may improve QoS by reducing the problems associated with variable bandwidth speeds, and specifying your Max Bandwidth to the minimum. The theory is that you could set your Max Bandwidth to represent your actual maximum, and TCP Vegas will avoid congestion due to sending packets faster than the actual maximum at any particular moment. (This is new and results are mixed. Whatever you do should be compared to following the QoS instructions in this document, without TCP Vegas enabled.).
Step 2: Basic Settings -- Inbound
- Refer to Figure 2.
- Navigate to QoS and Basic Settings.
- Scroll down, and make the bottom of your page look like Figure 2.
However, as described in Step 1, the Max Bandwidth should reflect your max bandwidth.
Be sure to Save your changes.
Note: Step 1's caution about the conservative accuracy of Max Bandwidth applies here too.
If you read the novice introduction to QoS, you will have learned that some controversy exists over inbound QoS. Tomato's inbound QoS is not true "traffic shaping." It involves trickery, such as delaying acknowledgments, discarding packets, etc., to (hopefully) cause the sender to slow down, retry, etc.
In the experience of the author of this How-To, whatever Tomato is doing, it's very effective. Others have suggested that setting the outbound Max Bandwidth to a maximum value (all 9s) works better. This may depend on the speed of your internet connection, whether you have a cable provider who uses "speed boost" (or other conditions which cause the speed to vary). The speed of the author of this How-To is a constant 1600kbs down, and he notice's a considerable improvement using Tomato's inbound QoS feature as described in this section.
The Additional thoughts section contains instructions to test the effectiveness of your QoS. This can be used to test different outbound Max Bandwidth values, including unlimited (all 9s).
Step 3: Classification
Navigate to QoS and Classification.
If you use a dedicated computer to run MagicJack only, all you have to do is create the QoS classification rule changing "Any Address" to the Source (Src) MAC Address of the computer's network interface card's (NIC).
After creating that rule, move it to the top of the list so that it's traffic will be caught first, before other rules may catch it. (For example, if you leave it at the bottom, the Bulk Traffic rule would catch all your VOIP traffic, and it would be categorized as Lowest.).
Traditional (mixed use) Computer
- Refer to Figure 3.
- Make your page look like Figure 3.
This is where you define how traffic should be identified and classified. The classes here relate to the percentages specified in the prior two steps.
On this screen you should add the two highlighted rules seen in Figure 3, using the following values:
- MJ SIP signaling
- Any address
- Destination (Dst) port: 5060-5070
- Layer 7: sip
- Class: Highest.
- Description: MJ SIP signaling.
- MJ RTP voice
Move these rules up, above the Bulk Trafic rule (as shown in Figure 3.).
The order of the rules is important. If they are after the Bulk Traffic rule, that rule will apply to the MagicJack traffic before these rules are considered.
Also, there's no reason to move them even higher. These rules apply when a connection is created. You'll probably open more web and DNS (hostname lookup) connections than you will telephone calls. There's no reason for Tomato to even consider applying these rules to those more frequent connections.
Be sure to Save your changes.
IMPORTANT: The Layer 7 rtp filter did not work prior to Tomato v1.23. In v1.23, only the rtp-2 filter works. In future versions, that fix will be moved into the rtp rule (and the rtp-2 rule may disappear).
Step 4: Check the classification
- Refer to Figure 4.
- If your MagicJack is already started, go to the softphone's Menu->Advanced Users->Restart and restart it. Otherwise, connect/start your MagicJack.
- Call the special echo number (which will echo what you say back to you): 909-390-0003.
- Navigate to QoS and View Graphs.
- Click on the slice of the pie that represents Highest.
Note: Refer to the color code on the left side of the screen to understand which slice is Highest. If you place your cursor over a slice of the pie, a bubble-help should tell you which classification it represents.
NOTE: In Internet Explorer, you must install the Adobe SVG plugin to see the graphs.
Step 5: View classification details
- Refer to Figure 5.
- Check Automatically Resolve Addresses.
You should see two items on this page related to "talk4free.com." One is to a host named "proxy1" (the SIP connection). The other is to "vms1" (the RTP connection).
The city name of both hosts is dependent upon on your location.
The "proxy1" connection occurs when you start MagicJack. It is a control connection. The "vms1" connection occurs when you place or receive a call. It is the connection which carries the voice traffic (the bulk of traffic).
If you don't see either of these items, you will have to click on other slices of the pie to see where they were classified. If your rules didn't apply, then it probably fell into the "bulk" rule (which is "lowest"). Depending on the speed of your connection and whether it was the vms1 (RTP) connection, speaking into the special echo number will probably produce unusable results. Especially if you are doing anything else, like browsing the web.
Alternatively, you can navigate to "QoS" and "View Details." This is the same screen you are on when navigating through the pie chart, but it shows all traffic. You can click the headings ("destination" or "class") and it will sort everything. This might help you locate either of those servers if you have trouble locating them by going through the pie chart.
- Remember that the Tomato page contains a link to make a donation. If Tomato is useful, buy the author lunch at McDonald's. (If it's really useful, Super Size it.).
- It's a good idea to perform steps 4 & 5 occasionally to check that it is operating as expected. And, keep them in mind if your voice quality ever deteriorates significantly. QoS is an excellent tool. But, if the rules don't apply as you expect, it can make things much worse.
- WARNING: You have the responsibility to check how the rules are being [mis-]applied before reporting a voice-quality problem to MagicJack support.
- You can use www.speedtest.net to test the effectiveness of your QoS (and any changes you make to the settings suggested by this document). Call the special echo number (see Step 4) and while counting into the phone, start a speed test. The speed test will saturate your connection (down first, then up).
- You can also use this test to compare the difference between QoS enabled and disabled. (You can disable QoS on the QoS->Basic Settings page.).
- BTW: If QoS is operating correctly, you should see about 100kbs difference in speedtest results (with and without QoS).
- Unrelated to QoS (except that unwanted traffic will compete with your voice traffic): By default, Tomato 1.23 has UPnP enabled. The author of this document recommends you navigate to Port Forwarding and UPnP to disable this feature. If you see any ports on that page that have already been opened, delete them (unless you know why they are open). After saving changes to this page, check back to make sure it's still disabled. (Sometimes it takes a couple tries to make the disable take effect.).
- UPnP allows processes to open ports without your approval. In a perfect world, this seems nice. However, it can be a security hole. And, if something opens a lot of ports without your knowledge, you could have a high amount of traffic consuming bandwidth, degrading your voice quality, without you knowing it.
- The basic QoS primer, mentioned on the main QoS How-To page.
- On January 23, 2009 it was noticed that this changed from port range 10000-20000 to 10000-30000. It appears MagicJack is now opening ports in the 20000-30000 range. Setting this port range too narrowly will cause the RTP voice traffic to go to the "Lowest" category, seriously degrading the audio quality.