Beruflich Dokumente
Kultur Dokumente
IP Flow
Routing, Mangle and QoS
Introduction
Name: Valens Riyadi Country: Indonesia Graduated as Architect 1998 Work at Citraweb (Citranet)
ISP, Web Developer, Mikrotik Reseller
Photographer
Administrator of www.fotografer.net
Head of Security Dept, Indonesian ISP Association Volunteer for Airputih Foundation, IT Emergency Task Force Steering Committee for ID-SIRTII
Indonesia Security Incident Response Team on Information Infrastructure
00-2
6/16/2008
My Company
Citraweb Nusa Infomedia
Web Developer (since 2000) Small ISP (since 2001) Mikrotik Reseller (since 2002) Mikrotik Certified Training Partner (2005)
00-3
6/16/2008
Yogyakarta City
3,4 million of population
Tourism City Student City
Almost 50% of population are students from other cities.
00-4
6/16/2008
Overview
IP Flow Mangle
Mark connection, mark packet, mark route
Multiple Gateways with NAT Network QoS -> Queue Tree We will NOT discuss about :
Simple Queue, Queue Type Load balance
00-5
6/16/2008
IP Flow
Diagram that show how each packet process from input interface (or local process) to output interface (or local process) For each traffic, we should know source and destination.
00-6
6/16/2008
Destination
Local Process Output Interface
00-7
6/16/2008
PRE ROUTING
FORWARD
POST ROUTING
OUTPUT INTERFACE
INPUT
LOCAL PROCESS
OUTPUT
PREROUTING Hotspot Input Conn-Tracking Mangle Dst-NAT Global-In Queue Global-Total Queue
00-8
6/16/2008
IP Flow
BRIDGE DST-NAT
Bridge Decision
BRIDGE FORWARD
Broute?
+ -
PRE ROUTING
+
INPUT is Bridged?
INPUT
Routing Decision
OUTPUT is Bridged?
Bridge Decision
+
IPsec Policy
LOCAL PROCESS-IN
PREROUTING Hotspot Input Conn-Tracking Mangle Dst-NAT Global-In Queue Global-Total Queue
IPSEC ENCRYPTION
IPsec Policy
00-9
Chain Position
From Outside To Router / Local process Outside Mangle Prerouting Input Output Postrouting Outside Prerouting Forward Postrouting Forward Input Output Firewall Queue Global-in Global-Total Global-Out Global-Total Interface Global-in Global-out Global-total Interface
00-10
Mikrotik Indonesia http://www.mikrotik.co.id
6/16/2008
00-11
6/16/2008
mangle
00-12
6/16/2008
00-13
6/16/2008
00-14
6/16/2008
Constrain
In previous case, we use interface queue for uplink and downlink. But now we have more than 1 interface for uplink. We can use global-in for uplink
00-15
6/16/2008
00-16
6/16/2008
00-17
6/16/2008
Static Route
/ip route add comment="" disabled=no distance=1 dstaddress=0.0.0.0/0 gateway=172.16.20.1 \ routing-mark=route2 add comment="" disabled=no distance=1 dstaddress=0.0.0.0/0 gateway=172.16.10.1 \ routing-mark=route1 add comment="" disabled=no distance=1 dstaddress=0.0.0.0/0 gateway=172.16.20.1
00-18
6/16/2008
00-19
6/16/2008
Queue Tree
/queue tree print Flags: X- disabled, I - invalid 0 name="total d - ownload" parent=ether1- local packet m a rk=packet client1 dwnload limit - o at=512000 queue=default priority=8 max limit=512000 burst limit=0 burst threshold=0 burst time=0s 1 name="total u - pload" parent=global in packet mark=packet c - upload limit a - lient1 - t=256000 queue=default priority=8 max limit=256000 burst limit=0 burst threshold=0 burst tme=0s - i
00-20
Mikrotik Indonesia http://www.mikrotik.co.id
6/16/2008
00-21
6/16/2008
00-22
6/16/2008
Constrain
Previous Configuration:
Will not load balance uplink traffic from proxy Will not limit downlink connection from proxy to client
00-23
6/16/2008
SRC-NAT
INTERNET
00-24
6/16/2008
00-25
6/16/2008
How to do
Load Balance Uplink traffic from proxy
Make new rules in mangle chain output, to do nth (mark-connection and mark-packet)
00-26
6/16/2008
00-28
6/16/2008
Mangle Configuration
00-29
6/16/2008
00-30
6/16/2008
How to
We can differentiate hit and miss traffic using TOS / DSCP parameter. On proxy, we set Cache Hit DSCP (Differentiated Services Code Point)/ToS (Type of Services) = 4 We make new mangle and new queue tree to mange hit traffic
00-31
Mikrotik Indonesia http://www.mikrotik.co.id
6/16/2008
00-32
6/16/2008
Queue Tree
0 name="total-download" parent=ether1-local packetmark=packet-client1-download limit-at=512000 queue=default priority=8 max-limit=512000 burst-limit=0 burst-threshold=0 burst-time=0s 1 name="total-upload" parent=global-in packet-mark=packetclient1-upload limit-at=256000 queue=default priority=8 maxlimit=256000 burst-limit=0 burst-threshold=0 burst-time=0s 2 name="total-download-hit" parent=ether1-local packetmark=packet-client1-hit-download limit-at=1000000 queue=default priority=8 max-limit=1000000 burst-limit=0 burst-threshold=0 burst-time=0s
00-33
6/16/2008
00-34
6/16/2008
Thank You!
info@mikrotik.co.id