1*7c478bd9Sstevel@tonic-gate# ident "%Z%%M% %I% %E% SMI" 2*7c478bd9Sstevel@tonic-gate# 3*7c478bd9Sstevel@tonic-gate# Copyright 2005 Sun Microsystems, Inc. All rights reserved. 4*7c478bd9Sstevel@tonic-gate# Use is subject to license terms. 5*7c478bd9Sstevel@tonic-gate# 6*7c478bd9Sstevel@tonic-gate# CDDL HEADER START 7*7c478bd9Sstevel@tonic-gate# 8*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the 9*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only 10*7c478bd9Sstevel@tonic-gate# (the "License"). You may not use this file except in compliance 11*7c478bd9Sstevel@tonic-gate# with the License. 12*7c478bd9Sstevel@tonic-gate# 13*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 14*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing. 15*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions 16*7c478bd9Sstevel@tonic-gate# and limitations under the License. 17*7c478bd9Sstevel@tonic-gate# 18*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each 19*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE. 20*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the 21*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying 22*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner] 23*7c478bd9Sstevel@tonic-gate# 24*7c478bd9Sstevel@tonic-gate# CDDL HEADER END 25*7c478bd9Sstevel@tonic-gate# 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate# Mandatory file format version identifier. 28*7c478bd9Sstevel@tonic-gatefmt_version 1.0 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate# Meter traffic from application (identified by source port myport) to 31*7c478bd9Sstevel@tonic-gate# somehost.somedomain, where somehost.somedomain is a valid hostname/IP address. 32*7c478bd9Sstevel@tonic-gate# Mark a packet with AF11 if it does not exceed the committed burst, AF12 if it 33*7c478bd9Sstevel@tonic-gate# exceeds committed burst, but not excess burst and AF13 if it exceeds the 34*7c478bd9Sstevel@tonic-gate# excess burst. 35*7c478bd9Sstevel@tonic-gate# For information on AF PHBs refer to the IPQoS Administration Guide or the 36*7c478bd9Sstevel@tonic-gate# RFC 2597. 37*7c478bd9Sstevel@tonic-gate# 38*7c478bd9Sstevel@tonic-gate# Before this example configuration file can be applied the sport and daddr 39*7c478bd9Sstevel@tonic-gate# parameter values in the ipgpc filter myfilter need to be given actual values. 40*7c478bd9Sstevel@tonic-gate 41*7c478bd9Sstevel@tonic-gateaction { 42*7c478bd9Sstevel@tonic-gate module ipgpc 43*7c478bd9Sstevel@tonic-gate # Name must be ipgpc.classify for ipgpc action. 44*7c478bd9Sstevel@tonic-gate name ipgpc.classify 45*7c478bd9Sstevel@tonic-gate 46*7c478bd9Sstevel@tonic-gate filter { 47*7c478bd9Sstevel@tonic-gate name myfilter 48*7c478bd9Sstevel@tonic-gate class meter_myapp 49*7c478bd9Sstevel@tonic-gate sport myport 50*7c478bd9Sstevel@tonic-gate daddr somehost.somedomain 51*7c478bd9Sstevel@tonic-gate } 52*7c478bd9Sstevel@tonic-gate class { 53*7c478bd9Sstevel@tonic-gate name meter_myapp 54*7c478bd9Sstevel@tonic-gate next_action meter5mbps 55*7c478bd9Sstevel@tonic-gate enable_stats true 56*7c478bd9Sstevel@tonic-gate } 57*7c478bd9Sstevel@tonic-gate params { 58*7c478bd9Sstevel@tonic-gate global_stats true 59*7c478bd9Sstevel@tonic-gate } 60*7c478bd9Sstevel@tonic-gate} 61*7c478bd9Sstevel@tonic-gate 62*7c478bd9Sstevel@tonic-gate# meter5mbps invokes action af11 for a packet that does not exceed the 63*7c478bd9Sstevel@tonic-gate# committed burst, af12 if it exceeds committed burst, but not excess burst 64*7c478bd9Sstevel@tonic-gate# and af13 if it exceeds excess burst. 65*7c478bd9Sstevel@tonic-gateaction { 66*7c478bd9Sstevel@tonic-gate module tokenmt 67*7c478bd9Sstevel@tonic-gate name meter5mbps 68*7c478bd9Sstevel@tonic-gate params { 69*7c478bd9Sstevel@tonic-gate # Committed rate of 5 Mbps. 70*7c478bd9Sstevel@tonic-gate committed_rate 5000000 71*7c478bd9Sstevel@tonic-gate # Committed burst of 5 Mb. 72*7c478bd9Sstevel@tonic-gate committed_burst 5000000 73*7c478bd9Sstevel@tonic-gate # Excess Burst of 10 Mb. 74*7c478bd9Sstevel@tonic-gate peak_burst 10000000 75*7c478bd9Sstevel@tonic-gate # Action global stats enabled. 76*7c478bd9Sstevel@tonic-gate global_stats true 77*7c478bd9Sstevel@tonic-gate # RED action, mark DSCP with AF13. 78*7c478bd9Sstevel@tonic-gate red_action_name af13 79*7c478bd9Sstevel@tonic-gate # YELLOW action, mark DSCP with AF12. 80*7c478bd9Sstevel@tonic-gate yellow_action_name af12 81*7c478bd9Sstevel@tonic-gate # GREEN action, mark DSCP with AF13. 82*7c478bd9Sstevel@tonic-gate green_action_name af11 83*7c478bd9Sstevel@tonic-gate # Not color aware. 84*7c478bd9Sstevel@tonic-gate color_aware false 85*7c478bd9Sstevel@tonic-gate } 86*7c478bd9Sstevel@tonic-gate} 87*7c478bd9Sstevel@tonic-gate 88*7c478bd9Sstevel@tonic-gate# Mark the DSCP with code point AF13, 001110 = 14. 89*7c478bd9Sstevel@tonic-gateaction { 90*7c478bd9Sstevel@tonic-gate module dscpmk 91*7c478bd9Sstevel@tonic-gate name af13 92*7c478bd9Sstevel@tonic-gate params { 93*7c478bd9Sstevel@tonic-gate # Enable global stats for action. 94*7c478bd9Sstevel@tonic-gate global_stats true 95*7c478bd9Sstevel@tonic-gate next_action acct_classaf1 96*7c478bd9Sstevel@tonic-gate # Set all 64 entries of dscp_map to 14 decimal. 97*7c478bd9Sstevel@tonic-gate dscp_map {0-63:14} 98*7c478bd9Sstevel@tonic-gate } 99*7c478bd9Sstevel@tonic-gate} 100*7c478bd9Sstevel@tonic-gate 101*7c478bd9Sstevel@tonic-gate# Mark the DSCP with code point AF12, 001100 = 12. 102*7c478bd9Sstevel@tonic-gateaction { 103*7c478bd9Sstevel@tonic-gate module dscpmk 104*7c478bd9Sstevel@tonic-gate name af12 105*7c478bd9Sstevel@tonic-gate params { 106*7c478bd9Sstevel@tonic-gate global_stats true 107*7c478bd9Sstevel@tonic-gate next_action acct_classaf1 108*7c478bd9Sstevel@tonic-gate dscp_map {0-63:12} 109*7c478bd9Sstevel@tonic-gate } 110*7c478bd9Sstevel@tonic-gate} 111*7c478bd9Sstevel@tonic-gate 112*7c478bd9Sstevel@tonic-gate# Mark the DSCP with code point AF11, 001010 = 10. 113*7c478bd9Sstevel@tonic-gateaction { 114*7c478bd9Sstevel@tonic-gate module dscpmk 115*7c478bd9Sstevel@tonic-gate name af11 116*7c478bd9Sstevel@tonic-gate params { 117*7c478bd9Sstevel@tonic-gate global_stats true 118*7c478bd9Sstevel@tonic-gate next_action acct_classaf1 119*7c478bd9Sstevel@tonic-gate dscp_map {0-63:10} 120*7c478bd9Sstevel@tonic-gate } 121*7c478bd9Sstevel@tonic-gate} 122*7c478bd9Sstevel@tonic-gate 123*7c478bd9Sstevel@tonic-gate# Account packets for class AF1* (AF11, AF12 and AF13). 124*7c478bd9Sstevel@tonic-gateaction { 125*7c478bd9Sstevel@tonic-gate module flowacct 126*7c478bd9Sstevel@tonic-gate name acct_classaf1 127*7c478bd9Sstevel@tonic-gate params { 128*7c478bd9Sstevel@tonic-gate global_stats true 129*7c478bd9Sstevel@tonic-gate next_action continue 130*7c478bd9Sstevel@tonic-gate # Timeout flows if packets not seen for at least 60 secs. 131*7c478bd9Sstevel@tonic-gate timeout 60000 132*7c478bd9Sstevel@tonic-gate # Scan the flow table every 15 secs for removing timed out flows. 133*7c478bd9Sstevel@tonic-gate timer 15000 134*7c478bd9Sstevel@tonic-gate # Limit number of flow records in the table to 2K. 135*7c478bd9Sstevel@tonic-gate max_limit 2048 136*7c478bd9Sstevel@tonic-gate } 137*7c478bd9Sstevel@tonic-gate} 138