Switch to English
Switch to Russian
NetBilling
Traffic accounting and billing system
Traffic zones

Traffic zones provide a flexible way to classificate clients' traffic. Traffic zone is a set of IP-subnetworks and server ports possibly having an exception flag meaning its subnetwork is excluded from respective traffic zone.

During traffic analysis every IP-packet of every client is passing through traffic zones from first to last, according to the order they defined. When the zone this IP-packet satisfies is found, scanning is stopped and packet is accounted as the one from this zone. So every packet can be accaounted only in one zone. If there is no traffic zone meeting the IP-packet, it is not accounted.

Determination if IP-address belongs to the traffic zone is done by the following steps:

  1. Looking for this IP-packet among the excluded addresses (and respective ports) of the zone. If any of excluded addresses meets the packet, it is declined from this zone and lookup continues within the others.
  2. If no excluded addresses meets the paket, NetBilling is looking for it through the addresses which are not excluded from zone (does not has the exclusion flag). If there is an address and port meeting the packet among them, packet is accepted in the zone. Otherwise, it does not meets the zone (searching continues with the next one).

Every subnetwork can be assigned with a set of server-side port numbers. Only traffic to and from specified ports would meet this subnetwork. Assigning no ports at all means any ports and protocols.

Local-area network zone can be described in the following way:

1. CityNET  
Free city network
Inbound traffic price:0.00 USD
Outbound traffic price:0.00 USD
Addresses in zone:
! 123.234.132.212/255.255.255.255
! 123.234.132.213/255.255.255.255
10.10.0.0/255.255.0.0
123.234.132.0/255.255.255.0

As you can see, our LAN is described by defining a set of complete subnetworks beloning to local-area network and Internet subnetwork, which can be accessed from LAN directly (ISP's network), and excluding of sereval special-rated servers from it. Let's describe them separatly:

2. On-line games servers  
Counter Strike and Ultima Online servers
Inbound traffic price:0.10 USD
Outbound traffic price:0.10 USD
Addresses in zone:
123.234.132.212/255.255.255.255
123.234.132.213/255.255.255.255

Here, "On-line games server" traffic zones described as "Counter Strike and Ultima Online servers" traffic in which is rated as 0.10 USD for both inbound and outbound clients's megabyte. This zone includes two subnetworks with 255.255.255.255 netmask, which means these are not subnetworks but signle hosts. So, we defined the zone containing two servers: 123.234.132.212 and 123.234.132.213.

We defined two traffic zones and at the moment we can do their optimisation. As you know, zones are looked through until the very first occurance of required IP, so the other zones would not be scanned. Look again ato our already defined zones. If we put game servers zone in the first place and LAN zone to the second, the respective game server would be found at the first step of scanning process and the second, LAN, zone would not be scanned. Therefore, after such replacemtn we can remove excluded game servers from LAN zone. This will simplify zones description and improve traffic analysis subsystem performance.

Let us also imagine, that there is some privileged traffic (national traffic, for instance). This traffic has some price discount compared to unprivileged. This is how we can describe the traffic zone for it:

3. Internet with discount  
Privileged networks
Inbound traffic price:2.00 USD
Outbound traffic price:0.10 USD
Addresses in zone:
1.2.1.0/255.255.255.224
13.31.22.51/255.255.255.248
151.58.12.8/255.255.255.240

Suppose, we have special price for email services. So, we should describe traffic zone, which will meet all traffic from clients to server ports 25, 110 and 143. Note, that accessing these ports of our local-area network is covered by the first traffic zone and does not meet this one.

4. Email  
Email services
Inbound traffic price:2.00 USD
Outbound traffic price:1.00 USD
Addresses in zone:
0.0.0.0/0.0.0.0 : 25,110,143

At last, let us describe traffic zone catching all other Internet traffic:

5. Internet  
Internet
Inbound traffic price:3.50 USD
Outbound traffic price:0.00 USD
Addresses in zone:
0.0.0.0/0.0.0.0

This zone is defined just as "any addresses and ports". This trick works because all special traffic is catched be previously defined zones. Simple, isn't it?

You should be very careful when defining your oun traffic zones. Try to keep number of zones and addresses and ports in zones as minimal as posible! Amount of them directly affects the performance of traffic analysis subsystem: more zones and addresses, more time to analyse!

Also note, that traffic in zones with both traffic prices defined as 0.0 is considered to be free and this traffic would not lead to automatic client acount access deactivation.