Friday, October 7, 2011

The u32 filter


The u32 filter

Overview

The u32 filter allows you to match on any bit field within a packet, so it is in some ways the most powerful filter provided by the Linux traffic control engine. It is also the most complex, and by far the hardest to use. To explain it I will start with a bit of a tutorial.

Thursday, October 6, 2011

U32 tips tricks

Chaining u32 example

# Root rule, for Gigabit interface
tc class add dev ${IFACE} parent 1: classid 1:2 htb rate 950Mbit ceil 950Mbit quantum 1514

# For "other" mac addresses
tc class add dev ${IFACE} parent 1:2 classid 1:3 htb rate 680Mbit ceil 950Mbit quantum 1514
tc qdisc add dev ${IFACE} handle 3: parent 1:3 bfifo limit 3000000

# For "our" mac address
tc class add dev ${IFACE} parent 1:2 classid 1:10 htb rate 260Mbit ceil 260Mbit quantum 1514
tc qdisc add dev ${IFACE} handle 10: parent 1:10 bfifo limit 3000000

# High priority for specific MAC
tc class add dev ${IFACE} parent 1:10 classid 1:20 htb rate 200Mbit ceil 260Mbit quantum 1514
tc qdisc add dev ${IFACE} handle 20: parent 1:20 bfifo limit 3000000

#Create handle 1:

tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: handle 1: u32 divisor 1

# Filter all traffic to specific MAC to handle 1
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32 ht 800:: match u16 0x0800 0xFFFF at -2 match u32 0x23af02ca 0xFFFFFFFF at -12 match u16 0x0004 0xFFFF at -14 link 1:

# Filter traffic of handle 1 (it means to specific MAC)
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32 ht 1: match ip sport 22 0xff flowid 1:20
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32 ht 1: match ip dport 22 0xff flowid 1:20
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32 ht 1: match ip sport 53 0xff flowid 1:20
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32 ht 1: match ip dport 53 0xff flowid 1:20
tc filter add dev ${IFACE} protocol ip pref 10 parent 1: u32 ht 1: match ip sport 80 0xff flowid 1:20

# Low priority class for specific MAC
tc class add dev ${IFACE} parent 1:10 classid 1:30 htb rate 60Mbit ceil 260Mbit quantum 1514
tc qdisc add dev ${IFACE} handle 30: parent 1:30 bfifo limit 300000
tc filter add dev ${IFACE} protocol ip pref 100 parent 1: u32 ht 1: match ip dst 0.0.0.0/0 flowid 1:30

#DEFAULT FOR ALL REMAINING
tc filter add dev ${IFACE} protocol ip pref 1000 parent 1: u32 match ip dst 0.0.0.0/0 flowid 1:3

traffic shaping with linux

Examples

This is by no means comprehensive. I may add to this when I get more of a chance. There are Wonder Shaper or the ADSL Bandwidth Management HOWTO. (though I feel that they are inadequate or employ the wrong strategies).

tc, qdiscs, classes, filters, oh my!

tc, the traffic control tool, is used to configure the Linux kernel to accomplish the shaping, scheduling, policing, and dropping of packets.
Each interface by default has a root qdisc. By default, it uses pfifo_fast algorhythm (in our case, it will be configured to use HTB). Think of the root qdisc as the main container that everything resides. Inside the root qdisc, we can classify various types of traffic into classes and attach them to the root handle. After the classes have been defined, filters are used to match and redirect the packets into the right classes.

Wednesday, September 28, 2011

Perbedaan Subdomain, Addon Domain, dan Park Domain


Banyak yang sering menanyakan perbedaan antara Subdomain, Addon Domain, dan Park Domain. Perbedaan antara subdomain, Addon Domain, dan Park Domain sangat jelas sehingga tidak akan membingungkan jika sudah mengerti. Subdomain
Subdomain adalah bagian dari domain utama dan bisa dibuat sebebas mungkin tanpa perlu membeli lagi domain.

Subomain sering digunakan untuk membedakan fungsi atau bagian dari web. Kita ambil contoh saja dari web dapurhosting.com. Dapurhosting.com adalah nama domain dan memiliki beberapa subdomain:
  • blog.dapurhosting.com, blog adalah subdomain yang kami gunakan untuk sebagai web blog kami.
  • secure.dapurhosting.com, secure merupakah bagian dari domain dapurhosting.com dimana akses ke sana telah diberikan fitur secure (SSL) dan digunakan untuk member area.
  • faq.dapurhosting.com, digunakan untuk Frequent Ask Question kami.
nama domainNama Domain Murah
Register nama domain murah, .COM hanya Rp 85.000 dan bisa digunakan di Blogspot. Tersedia juga domain perusahaan, sekolah, pemerintahan.

Addon domain
Addon domain adalah domain yang ditambahkan ke hosting domain utama dan diarahkan ke sub-direktori sebuah website sehingga domain tersebut akan menampilkan isi web dari sub-direktori itu.
Addon domain digunakan kalau ingin menampilkan beberapa web dalam satu hosting.  Dengan fitur ini anda hanya perlu membeli nama domain lagi dan ditambahkan ke hosting anda dan anda akan mempunyai 2 web yang aktif dengan isi berbeda.
Parked domain adalah domain yang diparkirkan ke atas domain utama sehingga pada saat domain tersebut diakses akan menampilkan web domain utama.
Diharapkan dengan artikel ini anda dapat membedakan Subdomain, addon Domain, dan Park Domain.

30x Faster WP-Super Cache Site Speed


I haven't had time to post much the past year, so I wanted to make up for that by publishing an article on a topic that would blow your mind and be something that you could actually start using and really get some benefit out of it. This is one of those articles that the majority of web hosting companies would love to see in paperback, so they could burn it. Now ask yourself, if a webhost makes money based on how much memory, bandwidth, and data used by a customer, what would they not want their customers to do? That's right, they do not want their customers to learn how to minimize and drastically reduce these moneymakers. They get giddy when you complain about slow-site-speed, or that it takes a long time for your site to load, because they have exactly the right answer- upgrade your memory, bandwidth, and data by purchasing a more expensive plan.

Using ReiserFS and Linux


 Introduction

In this article, I'll show you how to get ReiserFS running under a typical Linux distribution. I'll also share lots of technical information on a variety of topics, such as performance considerations and more. Since I'll be covering installation first, I recommend that you read this article in its entirety before following the installation instructions. That way, you'll have all the technical notes in the back of your head as you start getting ReiserFS running on your systems, allowing you to make any necessary adjustments along the way.

Reiser file system for linux


2005-11-17: These are just my personal notes on Reiser file system under linux. Sections of this web page:
useful links
loop-mounting ReiserFS on a linux file


Reiser file system links

linkcomments
namesys.com Includes Reiser v4 file system. See also Reiser4 Transaction Design Document. It seems that SuSE linux 9.0 has Reiser version 3.6. This is probably true also for SuSE linux 9.1. (These observations come from the reiserfs kernel module source in each case.)
See also Getting started with Reiser4 (including FTP URLs for kernel and user-space source) and the reiser fs source download.
reiserfs 2005-5-25: Tutorial at linux planet on 2001-1-22.
Reiser structure 2005-5-25: The structure of the Reiser file system by Florian Buchholz. Now this is more like it! This is the kind of detail I was looking for. Unfortunately, it only deals with Reiser version 3.6. See also Florian's Forensics page.