Traffic Shaping Guide

Traffic classes

cFosSpeed has two built-in traffic classes: “default” and “drop”. All traffic that isn’t matched by anything else goes to “default”. Its implicit priority is 0.

You can use “drop” to delete a packet and don’t send it at all. This allows you to do your own little firewalling with it (only for outbound traffic). “Drop” has no priority.

Used to order classes, “priority” is entered as an integer. To avoid confusion, no two classes should be assigned the same priority value. Packets of a traffic class with higher priority are sent prior to packets belonging to a traffic class with lower priority.

“Priority” is usually a positive value for regular classes. However, you can specify “low prio” classes with a negative priority value. Packets in low prio classes are only sent out if there is no high and no default class traffic ready for transmission.

This concept is exactly the opposite of high prio class. With high prio classes, you can mark specific packets to be sent out in front of other data. With low prio classes, you can mark specific packets to be sent out after other data. Beware that specifying rules for low classes can easily lead to “starving” connections, because all other data would then take precedence.

In addition, all traffic classes can be assigned a speed setting. The speed setting determines up to how many bytes/second the class priority will remain in effect. Beyond that, packets are treated as being in the default class. That way, for instance, you could prioritize traffic, but only if it does not exceed, say, 1000 bytes/second. Once that speed is exceeded, the traffic would not be prioritized any more.

The speed settings can done in percent as well, where 100% denotes the total speed of the connection. Specifying “-speed 20%” and “-speed 20perc” means the same. Speed settings of low classes must have a priority value that is used in case the speed is exceeded. It looks like this: “-speed 20%,-10”.

As an example take the setting “-prio 0 -speed 20%,-10”. Traffic in this class is sent out with priority 0 (i.e., default) if it’s slower than 20% of the maximum speed and with priority -10 otherwise.

Standard configuration

cFosSpeed comes preconfigured with five different traffic classes (in addition to the two built-in classes):

highest -prio 100 -weight 400
Only special cFosSpeed traffic sent out to measure latency is assigned to this class. This must not be changed and there must be no other traffic going into class highest but the -highest traffic nor must there be a class with higher or same prio. If there was, cfosspeed shaping would degrade in quality. Also see -highest rule.
higher -prio 90 -weight 400 -speed 40%,0
This class encompasses all TCP ACK packets. See -higher rule for more. The -speed setting is to ensure that if there is a flood of TCP ACKs other packets get their share of the bandwidth as well.
high -prio 80 -weight 400 -speed 40%,0
This class includes different kinds of traffic that are by default prioritized; see -high rule. The -speed setting is in for the same reason than in -higher.
low -prio 0 -speed 20%,-10 -weight 25
This class will get FTP data and SMTP (i.e., mail) uploads. We want these types of data to be sent out only if there is no other traffic that is most likely interactive.
lowest -prio 0 -speed 20%,-30 -weight 6
This class gets P2P traffic and other traffic that is sent out all the time in the background. We want it to give way to ANY other traffic that is sent.

Traffic Shaping for Filesharing (P2P)

Thanks to cFosSpeed Traffic Shaping, you can finally use the full upstream bandwidth (with eMule, Kazaa or BitTorrent etc.) and make it available to other filenet users – without adversely affecting other Internet applications.

The problems with filesharing software

Running filesharing programs (like eMule, Kazaa or BitTorrent) will usually take up most if not all upstream channel bandwidth, which leaves the connection prone to high ping times. Not only does this mean filesharing communication itself will run slowly (source requests may take a full 1 or 2 seconds rather than just a few milliseconds), but it will also choke other Internet applications to a crawl. By the same token, download rates may plummet, since TCP ACKs are not being sent out in time. The browser will also become noticeably less responsive while surfing the Net.

A popular workaround offered by many filesharing programs is to put an artificial cap on the upload rate.

However, if you are simultaneously running a mail upload in addition to a filesharing upload, both will compete for available upstream bandwidth. How much bandwidth each of these uploads will eventually receive is basically left to happenstance. In some cases, this may even lead to termination of all TCP connections (TCP connection starving).

The priority scheme integrated in cFos and cFosSpeed (re)organizes data packets in a manner that ensures maximum download rates for filesharing programs. In addition, cFos and cFosSpeed deprioritize filesharing data transfer. Now, this should not be taken to mean such traffic is artificially slowed or even altogether stalled. What it does mean, however, is that such data will be briefly delayed when more important data is being transmitted. Only this priority scheme makes it possible to have filesharing programs run at maximum transfer rates while still using the same connection for other applications at the same time.

For instance, if you have a filesharing program running in the background when surfing the Net, there will only be a brief, minimal slowdown in P2P traffic while a new page is being loaded. Likewise, when sending out longer e-mails, P2P upload rates may briefly drop somewhat while the mail is being transmitted. Once the mail is sent, all uploads will continue at full speed again. The only alternatives would be to postpone transmission of the mail “forever” or artificially limit transfer bandwidth for filesharing somehow. But this would also mean a loss of bandwidth even when no other application is using the same connection.

cFosSpeed is thus optimized for use with filesharing (p2p) software, allowing users to have such a program run in the background without noticing its regular Internet activity.

Therefore, we suggest setting Kazaa etc. to “unlimited upload” while deactivating the “speed sense” option, since cFosSpeed will already optimize Internet traffic anyway.

Icon skin

Since most users have their filesharing programs run 24 hours a day, cFosSpeed comes with its own icon skin for this, making it possible to keep track of the connection without needing to have a separate status window open at all times.

Prioritization:

Quite a few users have one PC set aside specifically for filesharing and route P2P traffic (e.g., via Internet Connection Sharing) through a main computer directly hooked up to the Internet. In this case, the Layer-7 Protocol Detection integrated in cFos and cFosSpeed permits prioritization of the most important P2P networks like BitTorrent, eDonkey 2000 (eMule, etc.), Kazaa, Gnutella(2), Kademlia, and Direct Connect.

Prioritizing Programs:

cFos and cFosSpeed also permit prioritizing programs by their name. Many of the most important programs have already been included in our program setting list. This way of prioritizing is especially useful when the Layer-7 detection cannot recognize and assign data properly (as would, for instance, be the case with encrypted P2P traffic).

Optimizing Connection Settings:

You can specify exactly what transfer medium you use under Connection Settings. The more information about a connection is available to cFos or cFosSpeed, the better ping times will be. Default is “Adaptive”. But if you were for instance using a DSL connection, you should select the appropriate DSL standard or protocol as your medium.

Traffic Shaping

How does Traffic Shaping work?

cFosSpeed uses Traffic Shaping to reorder Internet data packets in such a way that urgent traffic is transferred first and the rest of the data later. This results in significant reduction of latency (lag) and typically also results in connection speed up.

Internet Tuning / Traffic Shaping
  • If ACKs are not sent fast enough, downloads may be slow during uploads (the classic Traffic Shaping).
  • Windows TCP Auto-Tuning may result in too slow downloads. cFosSpeed’s RWIN expansion can increase the speed. cFosSpeed can also accelerate downloads for certain applications (see test results).
  • cFosSpeed keeps the overall ping time low, even during heavy uploads and downloads.
Prioritization – Your important streams first
  • With the cFosSpeed prioritization scheme you can always give all your programs full bandwidth, because cFosSpeed decides which streams must be prioritized.
  • For example Game-Traffic, VoIP, or Audio/Video content will be prioritized higher than uploads / downloads.
  • Your filesharing may use unlimited speed of your Internet connection, but it will be slowed down when you have important traffic.
  • The whole prioritization scheme is configurable and you can change the prioritization on-the-fly.

Benefits

  • Full download rate during upload
  • Consistently quick response time of your Internet even under heavy load
  • Substantially less lag in online games
  • Improved VoIP speech quality
  • Nice status window (with skins), so you always see what’s going on

cFosSpeed under the hood

Packet flow through the various modules of cFosSpeed

Mouse over/tap each box for further explanations.

More on Traffic Shaping

Traffic Shaping:

How Traffic Shaping works is explained here: Internet Acceleration with Traffic Shaping

There can only be one Traffic Shaper. Several Traffic Shapers after one another have disadvantages for the transfer speed. Therefore deactivate Traffic Shaping in your router. Also deactivate ACK prioritization.

In addition cFos / cFosSpeed offers RX shaping. This provides good ping times for downloads. It is activated by default.

Deactivate with:

spd gset rx_shape 0 -save

Activate with:

spd gset rx_shape 1 -save

Layer 7 protocol analysis:

cFos and cFosSpeed can analyze the data of the connections and recognize the most important protocols used in the Internet. This also works for protocols which don’t use the default ports. In addition it allows to prioritize data of PCs which are connected to your PC via Internet Connection Sharing or other routing software.

The following protocols are supported:

   Standard:          HTTP, FTP, POP3, SMTP, IMAP4
   VoIP:              RTP, RTCP, SIP
   Special:           Telnet, SSH, SSL, IRC, DNS, (S)NTP, RPC
   Filesharing (P2P): eDonkey, Kazaa, Bittorrent, Kademlia, Gnutella(2), Direct Connect
   Streaming Media:   HTTP-Streams with various players, as well as RTSP
 

The analyzer can distinguish between client and server mode. The dialog under “options” -> “settings”, “protocols” allows a precise prioritization of each protocol. In addition there is a dialog for program prioritization, if the layer-7 analysis doesn’t recognize some other protocol.

to support the analysis there is a logging mode, too. cFosSpeed creates log files of connections in the installation directory. The maximum file size is 100k, but you can to max. size X by the command.

   spd gset max_session_dump_size X
    activate logging:    spd gset dump_sessions X; gset dump_tcp_data 1
    deactivate logging:  spd gset dump_sessions 0

Values for X are:

    0=don't log connections.
    2=log, but delete automatically if no data except TCP SYN has beed transferred.
    3=log, like 2, but delete automatically if the proccol was recognized by the layer-7 analysis
    4=log, never delete

Program prioritization:

If cfos / cFosSpeed cannot recognize the protocol with layer-7 analisys, it tries to dermine the name of the program, which created this connection (XP or later). In the dialog for program prioritization under “options” -> “settings” you can assign each program one of five priorities. If your program is not in the list you can add it in the respective category. We also appreciate suggestions for other programs which should be in the list. Please report them here:

/traffic-shaping-priority-list/

Here is a list of programs already in the list:

https://atlas-cfosspeed.com/traffic-shaping-priority-list/#priority-list

Tips for the prioritization:

  • Only use high prioritization for a small part of the tranferred data. If you use high prioritization for all data, it is actually the same situation as if you had prioritized nothing.
  • Use low prioritization for filesharing. Then you can disable traffic limits in your filesharing software. This means your filesharing software can now use the whole bandwidth of your internet connections, with disturbing other traffic. Only in the short time, when you, for example, send mail, the P2P traffic is slowed down. This policy gives filesharing software the maximum bandwidth, while allowing use of the internet connection for other applications simultaneously.

VoIP recognition:

cFos / cFosSpeed can recognize VoIP (RTP) by an analysis of the UPD data packets. There is a strict and a relaxed check. the strict check is default and assumes there is a RTCP connection for each RTP connection. If you use VoIP software which has no RTCP connections you can disable (in “options” -> “settings”) the strict RTP check, e.g. for VoIPBuster.

Individual Traffic Shaping rules:

cFos and cFosSpeed have a filter language with rules to prioritize packets. See cFosSpeed Filter Expressions for details.

Traffic Chaping Options

What is Traffic Shaping?

Traffic Shaping prioritizes data transfer on Internet connections in such a way that you can actually use your maximum bandwidth in both directions. In addition, cFos and cFosSpeed control data transfer to ensure ping times always remain minimal. For more information, please refer to our explanation of Traffic Shaping

How can I determine the benefits of cFos Traffic Shaping myself?

You should notice the following effects:

  • Smooth surfing / Web-site loading
  • Maximum download rate while uploading
  • Low ping times during upload, download, and while filesharing
  • Gaming connections remain responsive even during simultaneous data transfer
  • Better line quality for Voice-over-IP (VoIP)

You don’t have to believe this, but you can measure it by yourself: Manual

>What else does Traffic Shaping do?

>cFosSpeed feature list

How do I optimally calibrate cFos / cFosSpeed?
  • Clear the traffic shaping data by clicking on “clear calibration data”
  • Make a short full-speed download. (5-10 seconds)
  • Make a longer full-speed upload (30 sec – 1 min).
    It is important that this upload is as fast as possible, i.e., that the server you’re sending to is near and powerful (like your mail server or some fast FTP server). moreover, it is important that you have no downloads running while you do this upload. with an upstream of 256 kbit/s you need to send some 2 mbyte to the other side.
  • That’s it. The connection is well calibrated if you have a full-blast upload and still have low ping times (both can be watched in the status window).
Watch the video "How to calibrate your Internet connection"

Traffic Shaping Options

Traffic Shaping Mode (Multi-User version)

Not cooperative – There is a machine without cFos TS on your LAN
You use your connection with several other machines simultaneously and at least one of them has no cFos Traffic Shaping.

Net Talk – Broadcast traffic statistics on your LAN
To improve accuracy, send Traffic Shaping statistics to other PCs on your local (home) network. No data is sent to the Internet.

Ping Variance – Use advanced Traffic Shaping to accommodate for varying ping times
Gather ping statistics to accommodate for variation in ping times; especially useful for mobile/wireless connections.

Medium/Protocol

  • Adaptive: cFos/cFosSpeed will adapt to your connection automatically. Use this setting only if you are not sure what your connection type is. Otherwise, select the setting that applies to your connection. The better the chosen setting fits your connection type, the lower ping times should be.
  • DSL (PPPoE): Most widespread DSL protocol (commonly used in the USA, Germany, Eastern Europe, and other major markets).
    PPPoE explanation @ wikipedia.org
  • DSL (PPPoA/Vcmux): Common standard in Great Britain.
    PPPoA explanation @ wikipedia.org
  • DSL (PPPoA/LLC): Occasionally used in Great Britain
    PPPoA explanation @ wikipedia.org
  • DSL (PPTP): Older DSL standard still in use in some parts of France.
    PPTP explanation @ wikipedia.org
  • Cable: Internet via TV cable with bandwidth that may vary slightly according to usage and time of day.
    Cable technique @ wikipedia.org
  • ISDN: 8 or 16 kbytes, bidirectional, PPP in HDLC frames
    ISDN explanation @ wikipedia.org
  • IP over AAL5: IP data transfer via ATM
    ATM Adaptation Layer @ wikipedia.org
  • RFC 1483/2684: DSL over ATM bridging
  • Frame Count: Transfer speed varies with the number of data packets transmitted per time interval. Sometimes used in Greece.
  • Mixed Raw IP/Frame Count: Downstream traffic is handled as in “Frame Count”, upstream traffic as in “Cable”. Used by some cable providers like ish.

Set up the right medium/protocol if you know exactly which transfer medium/protocol is used. If in doubt, use Adaptive.

How do I optimally calibrate cFos / cFosSpeed?
  • Clear the traffic shaping data by clicking on “clear calibration data”
  • Make a short full-speed download. (5-10 seconds)
  • Make a longer full-speed upload (30 sec – 1 min).
    It is important that this upload is as fast as possible, i.e., that the server you’re sending to is near and powerful (like your mail server or some fast FTP server). moreover, it is important that you have no downloads running while you do this upload. with an upstream of 256 kbit/s you need to send some 2 mbyte to the other side.
  • That’s it. The connection is well calibrated if you have a full-blast upload and still have low ping times (both can be watched in the status window).
Watch the video “How to calibrate your Internet connection”

Traffic Shaping Priority List

Suggesting a program and its executable file for Traffic Shaping prioritization

We are looking for users who’d be interested in sending us their standard Traffic Shaping priority settings for programs not already included in our Traffic Shaping Priority List.

This is how you do it:

number1

Right click on the cFosSpeed status window

number2

Select "Options -> Settings"

number3

Click on "Programs"

number4

Click on "Add program"

number5

Select the program from the selection box

number6

If the program isn't currently active, click the "All programs" radio button and select the program from the extended list

number7

Add a description of the program

number8

Click on "Add"

>How prioritization works

Traffic Shaping Priority List

cFos/cFosSpeed can prioritize the traffic of individual programs. This list contains programs, already prioritized by cFos/cFosSpeed.

Traffic Shaping Calibration

More on cFosSpeed Traffic Shaping

Ping times should start out low from the get-go, while the upload rate will first have to be properly aligned with a connection’s maximum specifications. You can switch between having your current ping time displayed either numerically or graphically on the status window.

The cFosSpeed status window contains two important elements which indicate how Traffic Shaping works:

1 The Traffic Shaping indicator. It “blips” whenever cFosSpeed re-orders a packet, ie. whenever a prioritization takes place.

2 The ping time indicates how reactive your Internet connection is during upload/download. The lower the value the better.

Note: To measure the latency Pings will be sent to atlas-cfosspeed.com. However they never reach their destination, since they use only a small hop count (typically TTL 2 or 3). If you prefer another ping destination, you can set the key ping_dest in the file global.ini, section [param].

Additional things you can do
  • Disable other products that try to limit the connection speed, e.g. the Traffic Shaping of the Fritz!Box. These two solutions will interfere with each other.
  • In the context menu, select the correct medium for your connection under Options/Settings/2Traffic Shaping.
    More information
  • If you’re frequently using phones plugged into the router for making Voice-over-IP (VoIP) calls, please select “variable bandwidth” for your connection.
    More information

>How do I optimally calibrate cFos / cFosSpeed?

>What else does Traffic Shaping do?

>How can I determine the benefits of cFos Traffic Shaping myself?

Scroll to Top