Minggu, 23 Desember 2007

[Mikrotik] Per Connection Queue (PCQ)

Per Connection Queue (PCQ) is a queuing discipline that can be used to dynamically equalize or shape traffic for multiple users, using little administration. It is possible to divide PCQ scenarios into three major groups: equal bandwidth for a number of users, certain bandwidth equal distribution between users, unknown bandwidth equal distribution between users.

Equal Bandwidth for a Number of Users

Use PCQ type queue when you need to equalize the bandwidth [and set max limit] for a number of users. We will set the 64kbps download and 32kbps upload limits.

Image:PCQ.png

There are two ways how to make this: using mangle and queue trees, or, using simple queues.

1. Mark all packets with packet-mark all:

/ip firewall mangle add chain=prerouting action=mark-packet new-packet-mark=all passthrough=no


2. Setup two PCQ queue types - one for download and one for upload. dst-address is classifier for user's download traffic, src-address for upload traffic:

/queue type add name="PCQ_download" kind=pcq pcq-rate=64000 pcq-classifier=dst-address
/queue type add name="PCQ_upload" kind=pcq pcq-rate=32000 pcq-classifier=src-address


3. Finally, two queue rules are required, one for download and one for upload:

/queue tree add parent=global-in queue=PCQ_download packet-mark=all
/queue tree add parent=global-out queue=PCQ_upload packet-mark=all

If you don't like using mangle and queue trees, you can skip step 1, do step 2, and step 3 would be to create one simple queue as shown here:

/queue simple add queue=PCQ_upload/PCQ_download target-addresses=192.168.0.0/24

Sabtu, 22 Desember 2007

[Mikrotik]Transparent Traffic Shaper

We will configure one queue limiting the total throughput to the client and three sub-queues that limit HTTP, P2P and all other traffic separately.

Quick Start for Impatient
Configuration snippet from the MikroTik router:

/ interface bridge
add name="bridge1"
/ interface bridge port
add interface=ether2 bridge=bridge1
add interface=ether3 bridge=bridge1

/ ip firewall mangle
add chain=prerouting protocol=tcp dst-port=80 action=mark-connection \
new-connection-mark=http_conn passthrough=yes
add chain=prerouting connection-mark=http_conn action=mark-packet \
new-packet-mark=http passthrough=no
add chain=prerouting p2p=all-p2p action=mark-connection \
new-connection-mark=p2p_conn passthrough=yes
add chain=prerouting connection-mark=p2p_conn action=mark-packet \
new-packet-mark=p2p passthrough=no
add chain=prerouting action=mark-connection new-connection-mark=other_conn \
passthrough=yes
add chain=prerouting connection-mark=other_conn action=mark-packet \
new-packet-mark=other passthrough=no

/ queue simple
add name="main" target-addresses=10.0.0.12/32 max-limit=256000/512000
add name="http" parent=main packet-marks=http max-limit=240000/500000
add name="p2p" parent=main packet-marks=p2p max-limit=64000/64000
add name="other" parent=main packet-marks=other max-limit=128000/128000
[edit] Explanation
Each piece of code is followed by the explanation of what it actually does.

[edit] Bridge
/ interface bridge
add name="bridge1"
/ interface bridge port
add interface=ether2 bridge=bridge1
add interface=ether3 bridge=bridge1
We create a new bridge interface and assign two ethernet interfaces to it. Thus the prospective traffic shaper will be completely transparent to the client.

[edit] Mangle
/ ip firewall mangle
add chain=prerouting protocol=tcp dst-port=80 action=mark-connection \
new-connection-mark=http_conn passthrough=yes
add chain=prerouting connection-mark=http_conn action=mark-packet \
new-packet-mark=http passthrough=no
All traffic destined to TCP port 80 is likely to be HTTP traffic and therefore is being marked with the packet mark http. Note, that the first rule has passthrough=yes while the second one has passthrough=no. (You can obtain additional information about mangle at http://www.mikrotik.com/docs/ros/2.9/ip/mangle)

/ ip firewall mangle
add chain=prerouting p2p=all-p2p action=mark-connection \
new-connection-mark=p2p_conn passthrough=yes
add chain=prerouting connection-mark=p2p_conn action=mark-packet \
new-packet-mark=p2p passthrough=no
add chain=prerouting action=mark-connection new-connection-mark=other_conn \
passthrough=yes
add chain=prerouting connection-mark=other_conn action=mark-packet \
new-packet-mark=other passthrough=noSame as above, P2P traffic is marked with the packet mark p2p and all other traffic is marked with the packet mark other.

[edit] Queues
/ queue simple
add name="main" target-addresses=10.0.0.12/32 max-limit=256000/512000
We create a queue that limits all the traffic going to/from the client (specified by the target-address) to 256k/512k.

/ queue simple
add name="http" parent=main packet-marks=http max-limit=240000/500000
add name="p2p" parent=main packet-marks=p2p max-limit=64000/64000
add name="other" parent=main packet-marks=other max-limit=128000/128000
All sub-queues have the main queue as the parent, thus the aggregate data rate could not exceed limits specified in the main queue. Note, that http queue has higher priority than other queues, meaning that HTTP downloads are prioritized.

2 Lesser Known Ways To Brainstorm For Internet Home Business Keywords

Search Engine Optimization (SEO) doctrine states that you should always find a keyword that has little to no competition and that has high demand so that you can rise to the top of the search engine results and dominate that particular keyword. The problem with the internet home business area is that many people online are creating new websites with the typical keywords like “work from home” and “home business” so as a result it is almost impossible to rise to the top of the search engines or risking having to pay lots of money for pay per click advertising.

Instead of trying to compete with long established websites in the internet home business niche or high paying pay per click advertisers, this article suggests two ways you can think outside of the box and think of new keywords to promote your internet home business and its products.

Motivations and the internet business opportunity

It has been said that if you figure out someone’s motivations well enough, you can determine what he could do. Instead of hitting the “work at home” keyword when promoting your internet business opportunity, why not instead start thinking of reasons why people would join an internet home business. Reasons such as early retirement, starting part time income, quitting the rat race, getting out of debt come to mind. So if you target the reasons why someone would be interested in an internet business opportunity you are in effect targeting your actual online target audience.

So what you could do is write articles on these topics, optimize your websites to these topics with links to your internet home business which fit in with these motivations rather than the run of the mill work at home business websites.

Another way to generate more internet business signups is to hang out at website forums that discuss such things and offer some constructive advice and have a signature that leads to your internet home business website. If people trust your advice on the forums, they are more likely to trust the internet home business that you promote.

Solve health problems

Many internet home businesses have as their products health supplements. The reason for this is that such products are consumable and can be consumed monthly. As a result of this, nearly every internet home business owner selling vitamins either floods the Google Adwords with ads promoting vitamins or builds websites promoting vitamins.

One way around this problem is to find keywords targeting the problem rather than the solution. E.g. Heart attack if you are trying to promote antioxidants. Do some research into the area you are talking about and then either build a website that tells people more information about their health problems or advertise your product via Google Adwords as the solution to such a problem. Your competition may be significantly lower than if you had targeted “Vitamins” directly. So the lower the competition, the potential more money you might make with regards to product sales.

In conclusion, always aim to find these niches and once you do, spend time on Search Engine Optimization in addition to PayperClick advertising and you will find that in the longer run you will make more money online that you would have dreamed with your internet home business.