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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

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

Suggested Solutions

Tired of waiting for your show or movie to load?  Are buffering issues a constant problem with your internet connection?  Check this article out to see if these simple adjustments are the solution for you.
Creating an OSPF network that automatically (dynamically) reroutes network traffic over other connections to prevent network downtime.
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
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…

732 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