Somewhat theoretical QoS question

Posted on 2012-04-05
Last Modified: 2012-06-21
I'm trying to wrap my head around networking and setting up QoS. I think I figured out why it wasn't behaving the way I thought it would on my network and I fixed the problem, but I'm interested in knowing if the way I think it is working is the way it is ACTUALLY working.

Lets say, for argument sake because it is simple, that I was trying to provide high priority to basic web browsing (HTTP, port 80).

If I understand this right here's how the communication would unfold:            
Computer-------------------------Router--------------------------Web Server

                               HTTP REQUEST (2-3kb)
port 17623>>>>>------------------------------------------->>>>>port 80

                               HTTP RESPONSE (1000-2000kb)
port 17623<<<<<-------------------------------------------<<<<<port 80

So basically:

Computer ( connects to
      Computer's port:  17682 (random)
      Google's port:  80

Computer uploads an HTTP request to Google
Computer downloads the HTTP response from Google

Open in new window

So what just happened here was the computer UPLOADED data to Google on port 80. Then Google sent data to the computer (the computer DOWNLOADED that data). The downloaded packets were destined for the computer on a randomized local port that was used for that one session. The router opened a hole in its firewall and did the appropriate NAT translation to make this communication possible.

So two data streams are happening here:

1.    Data going outbound to Google on Port 80
2.    Data coming inbound to a computer on Port 17682

My router has the ability to specify "Priority-based" QoS by specifying:
        1. Port range and protocol (TCP or UDP)
        2. "Upstream" or "Downstream"
        3. "High", "Medium" or "Low" priority

This means if I wanted to prioritize the UPLOADING, I could create a rule:
        Port 80,     Upstream,  TCP,   High priority

But to prioritize the DOWNLOADING, it would be much more difficult. The port that is used is random every time.

This makes it quite difficult to do QoS optimization for downloads based on port-number alone. Right?

I was having issues where my QoS "prioritization" rules seemed to have no effect. In my case it was a VoIP PBX I was prioritizing but I ended up solving the issue by setting up IP-based prioritization instead (all traffic to one IP is prioritized over all other traffic), which appears to be working. I was wondering if this was the reason why.
Question by:Frosty555
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 39

Expert Comment

by:Aaron Tomosky
ID: 37815075
I think the other way is only possible with layer 7 (think that's right) application layer traffic. So the router knows its a VoIP packet when it comes in and can tag it with a priority. I've done this with meraki gear once but mostly just use port based tagging for VoIP phones on their own switch port. So anything to that port gets tagged. I jus assumed it worked for the way back... Maybe not.
LVL 57

Accepted Solution

giltjr earned 500 total points
ID: 37815724
Not knowing your router it is totally possible that it can tag based on the either the source or destination ports.  This is typically how it is done.  When the response, the source port is 80 (http), so you router should tag it.

However, you do realize that QoS settings are ignored within the public Internet.  So once the outbound traffic leaves your router there is no QoS.
LVL 31

Author Comment

ID: 37816629
My router is an RV042, it's "QoS" is pretty primitive, indeed it was only added in a recent firmware update. It does not support application layer QoS, the only options it has are:

"Interface" - WAN1, or WAN2 (it's a dual WAN router)
"Service" - A selection of TCP/UDP, and a Port Range. No mention of whether it is source or destination
"Direction" - Either "upstream" or "downstream"
"IP Range" - local network IP, not the remote network.
Minimum Rate - a Minimum guaranteed kbps
Maximum Rate - a Maximum guaranteed kbps, or "0" for unlimited
"Enabled" - a flag to enable or disable the rule.

I guess the problem here is that the router doesn't indicate source vs. destination port. So either it can tag packets as high priority based on:

1. The source port only (upstream = port 17683, downstream = port 80)
2. The destination port only (upstream = port 80, downstream = port 17683)
3. Try to pick one or the other intelligently based on the "Direction" that was specified
4. Both ports, prioritizing if either one of them matches.

I guess #4 makes the most sense but I have no idea if that is what the router is actually doing or not.

>However, you do realize that QoS settings are ignored within the public Internet.  So once the outbound traffic leaves your router there is no QoS.
I understand. This QoS is just for contention on the Internet by various devices on my local network (e.g. my VoIP server is trying to handle a call, but in the next room somebody is downloading a big file). In general my internet is good enough to handle VoIP on its own.
LVL 57

Expert Comment

ID: 37816972
--> I guess #4 makes the most sense but I have no idea if that is what the router is actually doing or not.

Unless the programmer that wrote the code is, umm how do I say this kindly, not too bright, he is going to tag the packet based on either the src or dst port matching.  So if you setup tcp port 80, it will look at both src or dst port for a match.

I will have to read up on the RV042, I thought that its "QoS" was more bandwidth control, which based on your description above makes sense.  That is, it does not tag the IP frames with QoS priority, but just makes sure that if you set max. bandwidth that type of traffic never exceeds that bandwidth usage or if you set min. bandwidth, that type of traffic will always get at least that.

Featured Post

Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSL is a very common protocol used these days when browsing the web.  The purpose is to provide security to communication, but how does it do it?  There are several pieces at work that have to be setup before SSL will even work and it requires both …
There are two basic ways to configure a static route for Cisco IOS devices. I've written this article to highlight a case study comparing the configuration of a static route using the next-hop IP and the configuration of a static route using an outg…
After creating this article (, I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question