1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3 (c) 2005 U.S. Robotics Corporation
7 <title>Add Network Traffic Class</title>
9 <link href="usr_layout.css" type="text/css" rel="stylesheet" /><script src="usr_layout.js" type="text/javascript"></script>
10 <link href="usr_menus_dropdown.css" rel="stylesheet" type="text/css"><script src="usr_menus_dropdown.js" type="text/javascript"></script><script src="usr_menus_build.js" type="text/javascript"></script>
11 <link href="usr_device.css" type="text/css" rel="stylesheet" /><script src="usr_device.js" type="text/javascript"></script><link href="usr_91xx.css" type="text/css" rel="stylesheet" /><script src="usr_91xx.js" type="text/javascript"></script><script src="usr_resources.js" type="text/javascript"></script>
12 <script src="portName.js" type="text/javascript"></script>
14 <meta HTTP-EQUIV='Pragma' CONTENT='no-cache'>
16 <script type="text/javascript" src="util.js"></script>
17 <script type="text/javascript">
20 var glbDisplayPhysicalPort = false;
22 /*if (document.getElementById) onload = function () {
24 for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
25 if ((/SrcMacAddr/i.test(a.id)) ||
26 (/SrcMacMask/i.test(a.id)) ||
27 (/DstMacAddr/i.test(a.id)) ||
28 (/DstMacMask/i.test(a.id)) ||
29 (/DscpMark/i.test(a.id)))
31 a.style.display = "none";
38 function diffServCfgCb (cb) {
40 if (cb.checked == true) {
41 for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
42 if ((/IpPre/i.test(a.id)) ||
43 (/IpTos/i.test(a.id)))
45 a.style.display = "none";
47 if ((/SrcMacAddr/i.test(a.id)) ||
48 (/SrcMacMask/i.test(a.id)) ||
49 (/DstMacAddr/i.test(a.id)) ||
50 (/DstMacMask/i.test(a.id)) ||
51 (/DscpMark/i.test(a.id)))
57 for(i=0; (a = document.getElementsByTagName('tr')[i]); i++) {
58 if ((/SrcMacAddr/i.test(a.id)) ||
59 (/SrcMacMask/i.test(a.id)) ||
60 (/DstMacAddr/i.test(a.id)) ||
61 (/DstMacMask/i.test(a.id)) ||
62 (/DscpMark/i.test(a.id)))
64 a.style.display = "none";
73 var loc = 'qoscls.cmd?action=add';
75 with ( document.forms[0] ) {
76 if ( txtclsname.value == '' )
78 alert('Please enter a Quality of Service class name.');
82 if (!isValidName(txtclsname.value))
84 alert('Please enter valid Quality of Service class name. Special characters are not permitted.');
88 // priority.selected index == 0 is valid value.
90 // Some conditions are specified by default.
92 if (optTraffic[0].checked)
94 if (srcaddr.value != "" && !isValidIpAddress(srcaddr.value))
96 alert('Source address "' + srcaddr.value + '" is an invalid IP address.');
100 if (srcmask.value != "" && !isValidSubnetMask(srcmask.value))
102 alert('Source subnet mask "' + srcmask.value + '" is an invalid subnet mask.');
106 if ( srcaddr.value == "" && srcmask.value != "" ) {
107 alert('Cannot have source subnet mask without source IP address.');
111 if (srcport.value != "" && !isValidPort(srcport.value))
113 alert('Source port "' + srcport.value + '" is an invalid port number or port range.');
117 if (dstaddr.value != "" && !isValidIpAddress(dstaddr.value))
119 alert('Destination address "' + dstaddr.value + '" is invalid IP address.');
123 if (dstmask.value != "" && !isValidSubnetMask(dstmask.value))
125 alert('Destination subnet mask "' + dstmask.value + '" is an invalid subnet mask.');
129 if ( dstaddr.value == "" && dstmask.value != "" ) {
130 alert('Cannot have destination subnet mask without destination IP address.');
134 if (dstport.value != "" && !isValidPort(dstport.value))
136 alert('Destination port "' + dstport.value + '" is invalid port number or port range.');
140 if ( srcmacaddr.value != "" && isValidMacAddress(srcmacaddr.value) == false ) {
141 alert('Source MAC address "' + srcmacaddr.value + '" is invalid MAC address.');
145 if ( srcmacaddr.value == "" && srcmacmask.value != "" ) {
146 alert('Cannot have source MAC mask without source MAC address.');
150 if ( dstmacaddr.value != "" && isValidMacAddress(dstmacaddr.value) == false ) {
151 alert('Destination MAC address "' + dstmacaddr.value + '" is invalid MAC address.');
155 if ( dstmacaddr.value == "" && dstmacmask.value != "" ) {
156 alert('Cannot have destination MAC mask without destination MAC address.');
160 if ( (srcport.value != "" || dstport.value != "") &&
161 (protocol.selectedIndex > 2) )
163 alert("The ports must be entered if the TCP or UDP protocol is selected.");
169 loc += '&clsName=' + encodeUrl(txtclsname.value);
172 var idx = priority.selectedIndex;
173 val = priority.options[idx].value;
174 loc += '&priority=' + val;
176 // IP precedence bits
177 idx = precedence.selectedIndex;
178 val = precedence.options[idx].value;
179 loc += '&precedence=' + val;
181 // IP type of service bits
182 idx = tos.selectedIndex;
183 val = tos.options[idx].value;
184 loc += '&tos=' + val;
186 if (optTraffic[0].checked)
188 // physical lan port ifc name
189 idx = lanIfcName.selectedIndex;
190 val = lanIfcName.options[idx].value;
191 loc += '&lanIfcName=' + val;
194 idx = protocol.selectedIndex;
195 val = protocol.options[idx].value;
196 loc += '&protocol=' + val;
198 // VLAN 802.1p priority
199 loc += '&vlan8021p=-1';
203 // physical lan port ifc name
204 loc += '&lanIfcName=';
207 loc += '&protocol=-1';
209 // VLAN 802.1p priority
210 idx = vlan8021p.selectedIndex;
211 val = vlan8021p.options[idx].value;
212 loc += '&vlan8021p=' + val;
215 // Check if the DiffServ configuration is enabled
216 if (enblDiffServCb.checked == false) {
217 // IP precedence bits
218 idx = precedence.selectedIndex;
219 val = precedence.options[idx].value;
220 loc += '&precedence=' + val;
222 // IP type of service bits
223 idx = tos.selectedIndex;
224 val = tos.options[idx].value;
225 loc += '&tos=' + val;
227 idx = dscp.selectedIndex;
229 loc += '&dscpMark=' + dscp.options[idx].value;
233 // physical lan port ifc name
234 if (glbDisplayPhysicalPort)
235 loc += '&lanIfcName=' + lanIfcName.options[lanIfcName.selectedIndex].value;
237 idx = protocol.selectedIndex;
238 val = protocol.options[idx].value;
239 loc += '&protocol=' + val;
242 if ( srcaddr.value != "" )
243 loc += '&srcAddr=' + srcaddr.value;
245 // source subnet mask
246 if ( srcmask.value != "" )
247 loc += '&srcMask=' + srcmask.value;
250 if ( srcport.value != "" )
251 loc += '&srcPort=' + srcport.value;
253 // destination address
254 if ( dstaddr.value != "" )
255 loc += '&dstAddr=' + dstaddr.value;
257 // destination subnet mask
258 if ( dstaddr.value != "" )
259 loc += '&dstMask=' + dstmask.value;
262 if ( dstport.value != "" )
263 loc += '&dstPort=' + dstport.value;
265 // DiffServ configuration
266 if ( enblDiffServCb.checked == true ) {
267 loc += '&diffServCfg=' + 3;
269 loc += '&diffServCfg=' + 0;
272 // source MAC address
273 if ( srcmacaddr.value != "" )
274 loc += '&srcMacAddr=' + srcmacaddr.value;
276 // destination MAC address
277 if ( dstmacaddr.value != "" )
278 loc += '&dstMacAddr=' + dstmacaddr.value;
281 if ( srcmacmask.value != "" )
282 loc += '&srcMacMask=' + srcmacmask.value;
284 // destination MAC mask
285 if ( dstmacmask.value != "" )
286 loc += '&dstMacMask=' + dstmacmask.value;
288 // Check if DiffServ configuration is enabled
289 //if (enblDiffServCb.checked == false) {
290 // VLAN 802.1p priority
291 idx = vlan8021p.selectedIndex;
292 val = vlan8021p.options[idx].value;
293 loc += '&vlan8021p=' + val;
295 // WAN 802.1p priority
296 idx = wanVlan8021p.selectedIndex;
297 val = wanVlan8021p.options[idx].value;
298 loc += '&wanVlan8021p=' + val;
301 var code = 'location="' + loc + '"';
305 function manageTrafficOptions()
307 with ( document.forms[0] )
309 setVisibility("idIPtraffic", optTraffic[0].checked);
310 setVisibility("id8021p", optTraffic[1].checked);
311 if (optTraffic[1].checked)
319 vlan8021p.selectedIndex = 0;
320 lanIfcName.selectedIndex = 0;
327 <body onload="initMenu(); manageTrafficOptions();">
329 <script type="text/javascript">
330 writeHeader("Add Network Traffic Class");
334 <p>This page creates a traffic class rule to classify the upstream traffic,
335 assign queuing priority, and optionally overwrite the IP header TOS byte. A rule
336 consists of a class name and at least one condition below. All of the specified
337 conditions in this classification rule must be satisfied for the rule to take
338 effect. Press <b>Apply</b> to save and activate the rule.</p>
339 <p><label for="txtclsname">Traffic class name:</label>
340 <input type='text' size="20" name="txtclsname" id="txtclsname"></p>
342 <h4>Class Priority, IP Precedence, and Type of Service</h4>
344 <input type="checkbox" name="enblDiffServCb" id="enblDiffServCb" onClick="diffServCfgCb(this)">
345 <label for="enblDiffServCb">Enable differentiated service configuration</label>
347 <p>If a non-zero value is selected for <b>IP precedence</b> or
348 a value other than "Normal" for <b>IP type of service</b>,
349 the corresponding TOS byte in the IP header of the upstream packet will be
350 overwritten by the selected value.</p>
351 <p><b>Note:</b> If <b>Differentiated service configuration</b> checkbox is selected,
352 you will only need to assign <b>ATM transmit priority</b>. <b>IP Precedence</b> will not
353 be used for classification. IP TOS byte will be used for DSCP mark.</p>
354 <table id="qosCls" border="0">
355 <tr id="tblItmAtmPrio">
356 <td><label>ATM transmit priority:</label></td>
357 <td><select name='priority' id='priority'>
358 <option value="1">Low</option>
359 <option value="2">Medium</option>
360 <option value="3">High</option>
363 <tr id="tblItmDscpMark" style="display: none">
364 <td><label>Differentiated services code point (DSCP):</label></td>
365 <td><select name="dscp" id="dscp">
366 <option value="0" selected>None</option>
367 <option value="0">default(000000)</option>
368 <option value="56">AF13(001110)</option>
369 <option value="48">AF12(001010)</option>
370 <option value="40">AF11(001001)</option>
371 <option value="32">CS1(001000)</option>
372 <option value="88">AF23(010110)</option>
373 <option value="80">AF22(010010)</option>
374 <option value="72">AF21(010001)</option>
375 <option value="64">CS2(010000)</option>
376 <option value="120">AF33(011110)</option>
377 <option value="112">AF32(011010)</option>
378 <option value="104">AF31(011001)</option>
379 <option value="96">CS3(011000)</option>
380 <option value="152">AF43(100110)</option>
381 <option value="144">AF42(100010)</option>
382 <option value="136">AF41(100001)</option>
383 <option value="128">CS4(100000)</option>
384 <option value="184">EF(101110)</option>
385 <option value="160">CS5(101000)</option>
386 <option value="192">CS6(110000)</option>
387 <option value="224">CS7(111000)</option>
390 <tr id="tblItmIpPre">
391 <td><label>IP precedence:</label></td>
392 <td><select name='precedence' id='precedence'>
393 <option value="-1" selected>None</option>
394 <option value="0">0</option>
395 <option value="1">1</option>
396 <option value="2">2</option>
397 <option value="3">3</option>
398 <option value="4">4</option>
399 <option value="5">5</option>
400 <option value="6">6</option>
401 <option value="7">7</option>
404 <tr id="tblItmIpTos">
405 <td><label>IP type of service:</label></td>
406 <td><select name='tos' id='tos'>
407 <option value="-1" selected>None</option>
408 <option value="0">Normal service</option>
409 <option value="2">Minimize cost</option>
410 <option value="4">Maximize reliability</option>
411 <option value="8">Maximize throughput</option>
412 <option value="16">Minimize delay</option>
415 <tr id="tblItmDot1p">
416 <td><label>802.1p (if 802.1q is enabled on WAN):</label></td>
417 <td><select name="wanVlan8021p" id="wanVlan8021p">
418 <option value="-1" selected>None</option>
419 <option value="0">0</option>
420 <option value="1">1</option>
421 <option value="2">2</option>
422 <option value="3">3</option>
423 <option value="4">4</option>
424 <option value="5">5</option>
425 <option value="6">6</option>
426 <option value="7">7</option>
431 <h4>Class Traffic Conditions</h4>
432 <p>Please select a method for controlling the data traffic priority.</p>
435 <input type="radio" name="optTraffic" id="optIP" value="trafficIP" onclick="manageTrafficOptions();" checked /> <label for="optIP">IP traffic</label><br/>
436 <input type="radio" name="optTraffic" id="opt8021p" value="traffic8021p" onclick="manageTrafficOptions();" /> <label for="opt8021p">802.1p priority</label>
439 <table id="idIPtraffic" border="0">
441 <td><label>Physical LAN port:</label></td>
442 <td><select name="lanIfcName" id="lanIfcName">
443 <option value="" selected>None</option>
444 <script type="text/javascript">
448 var interfaceInfo = '';
450 var brdId = '<%ejGetJS(boardID)%>';
452 interfaceInfo = '<%ejGetOther(bridgeInterfaceInfo, all)%>';
453 var interfaces = interfaceInfo.split('|');
455 glbDisplayPhysicalPort = true;
456 for ( i = 0; i < interfaces.length; i++ ) {
457 dispName = getUNameByLName(brdId + '|' + interfaces[i]);
458 if (dispName.indexOf('nas_') != -1)
459 continue; // skip nas_ ifc
460 if (interfaces[i] != '') {
461 document.writeln(" <option value='" + interfaces[i] + "'>" + dispName + "</option>");
471 <td><label>Protocol:</label></td>
472 <td><select name='protocol' id='protocol'>
473 <option value="0">TCP/UDP</option>
474 <option value="1">TCP</option>
475 <option value="2">UDP</option>
476 <option value="3">ICMP</option>
480 <tr><th align="left" colspan="2">Source</td></tr>
482 <td><label for="srcaddr">IP address:</label></td>
483 <td><input type='text' size="20" name="srcaddr" id="srcaddr"></td>
486 <td><label for="srcport">UDP/TCP port(s):</label></td>
487 <td><input type='text' size="20" name="srcport" id="srcport"> <label class="clsNote" for="srcport">(port or port:port)</label></td>
490 <td><label for="srcmask">Subnet mask:</label></td>
491 <td><input type='text' size="20" name="srcmask" id="srcmask"></td>
493 <tr id="tblItmSrcMacAddr" style="display: none">
494 <td><label>Source MAC address:</label></td>
495 <td><input type="text" size="20" name="srcmacaddr" id="srcmacaddr" maxlength="17"></td>
497 <tr id="tblItmSrcMacMask" style="display: none">
498 <td><label>Source MAC mask:</label></td>
499 <td><input type="text" size="20" name="srcmacmask" id="srcmacmask" maxlength="17"></td>
502 <tr><th align="left" colspan="2">Destination</th></tr>
504 <td><label for="dstaddr">IP address:</label></td>
505 <td><input type='text' size="20" name="dstaddr" id="dstaddr"></td>
508 <td><label for="dstport">UDP/TCP port(s):</label></td>
509 <td><input type='text' size="20" name="dstport" id="dstport"> <label class="clsNote" for="dstport">(port or port:port)</label></td>
512 <td><label for="dstmask">Subnet mask:</label></td>
513 <td><input type='text' size="20" name="dstmask" id="dstmask"></td>
515 <tr id="tblItmDstMacAddr" style="display: none">
516 <td><label>Destination MAC address:</label></td>
517 <td><input type="text" size="20" name="dstmacaddr" id="dstmacaddr" maxlength="17"></td>
519 <tr id="tblItmDstMacMask" style="display: none">
520 <td><label>Destination MAC mask:</label></td>
521 <td><input type="text" size="20" name="dstmacmask" id="dstmacmask" maxlength="17"></td>
525 <p id="id8021p"><label>802.1p priority:</label>
526 <select name='vlan8021p' id='vlan8021p'>
527 <option value="0">0</option>
528 <option value="1">1</option>
529 <option value="2">2</option>
530 <option value="3">3</option>
531 <option value="4">4</option>
532 <option value="5">5</option>
533 <option value="6">6</option>
534 <option value="7">7</option>
538 <p><input type='button' onClick='btnApply()' value='Apply'></p>
541 <script type="text/javascript">