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