Revision: 450
http://vde.svn.sourceforge.net/vde/?rev=450&view=rev
Author: rd235
Date: 2010-11-23 23:05:44 +0000 (Tue, 23 Nov 2010)
Log Message:
-----------
definition change: "Channel buffer size" instead of "Capacity"
bugfix: discarded packets for channel buffer overflow do not delay the channel
any more.
Modified Paths:
--------------
trunk/vde-2/man/wirefilter.1
trunk/vde-2/src/wirefilter.c
Modified: trunk/vde-2/man/wirefilter.1
===================================================================
--- trunk/vde-2/man/wirefilter.1 2010-11-23 19:47:49 UTC (rev 449)
+++ trunk/vde-2/man/wirefilter.1 2010-11-23 23:05:44 UTC (rev 450)
@@ -11,7 +11,7 @@
[\fB\-D\fI dup\fR]
[\fB\-b\fI bandwidth\fR]
[\fB\-s\fI interface_speed\fR]
-[\fB\-c\fI channel_capacity\fR]
+[\fB\-c\fI channel_bufsize\fR]
[\fB\-n\fI noise_factor\fR]
[\fB\-m\fI mtu_size\fR]
[\fB\-M\fI mgmt socket\fR]
@@ -89,8 +89,8 @@
Interface speed in Bytes/sec. It has the same syntax of -b. Input is blocked
for
the tramission time of the packet, thus the sender is prevented from sending
too fast.
.TP
-.B \-c "\fIcapacity\fP"
-Channel capacity (in Bytes): maximum size of the packet queue. Exceeding
packets
+.B \-c "\fIchannel_bufsize\fP"
+Channel buffer size (in Bytes): maximum size of the packet queue. Exceeding
packets
are discarded.
.TP
.B \-n "\fInoise factor\fP"
Modified: trunk/vde-2/src/wirefilter.c
===================================================================
--- trunk/vde-2/src/wirefilter.c 2010-11-23 19:47:49 UTC (rev 449)
+++ trunk/vde-2/src/wirefilter.c 2010-11-23 23:05:44 UTC (rev 450)
@@ -77,7 +77,7 @@
#define DDUP 3
#define BAND 4
#define SPEED 5
-#define CAPACITY 6
+#define CHANBUFSIZE 6
#define NOISE 7
#define MTU 8
#define NUMVALUES 9
@@ -483,15 +483,6 @@
{
struct timeval v;
- /* CAPACITY */
- /* when bandwidth is limited, packets exceeding capacity are discarded
*/
- if (max_wirevalue(markov_current,CAPACITY,dir) > 0) {
- double capval=compute_wirevalue(CAPACITY,dir);
- if ((delay_bufsize[dir]+size) > capval)
- return;
- }
- /* */
-
struct packpq *new=malloc(sizeof(struct packpq));
if (new==NULL) {
printlog(LOG_WARNING,"malloc elem %s",strerror(errno));
@@ -591,6 +582,14 @@
while (times>0) {
int banddelay=0;
+ /* CHANBUFSIZE */
+ /* when bandwidth is limited, packets exceeding channel bufsize
are discarded */
+ if (max_wirevalue(markov_current,CHANBUFSIZE,dir) > 0) {
+ double capval=compute_wirevalue(CHANBUFSIZE,dir);
+ if ((delay_bufsize[dir]+size) > capval)
+ return;
+ }
+
/* SPEED */
/* speed limit, if packets arrive too fast, delay the sender */
if (max_wirevalue(markov_current,SPEED,dir) > 0) {
@@ -1004,9 +1003,9 @@
return read_wirevalue(s,SPEED);
}
-static int setcapacity(int fd,char *s)
+static int setchanbufsize(int fd,char *s)
{
- return read_wirevalue(s,CAPACITY);
+ return read_wirevalue(s,CHANBUFSIZE);
}
static int setfifo(int fd,char *s)
@@ -1139,7 +1138,7 @@
printoutc(fd, "speed set interface speed bytes/sec");
printoutc(fd, "noise set noise factor bits/Mbyte");
printoutc(fd, "mtu set channel MTU (bytes)");
- printoutc(fd, "capacity set channel capacity (bytes)");
+ printoutc(fd, "chanbufsize set channel buffer size (bytes)");
printoutc(fd, "fifo set channel fifoness");
printoutc(fd, "shutdown shut the channel down");
printoutc(fd, "logout log out from this mgmt session");
@@ -1198,8 +1197,8 @@
min_wirevalue(node,MTU,LR),
min_wirevalue(node,MTU,RL));
printoutc(fd, "Cap. L->R %g+%g%c R->L %g+%g%c",
- WIREVALUE_FIELDS(node,CAPACITY,LR),
- WIREVALUE_FIELDS(node,CAPACITY,RL));
+ WIREVALUE_FIELDS(node,CHANBUFSIZE,LR),
+ WIREVALUE_FIELDS(node,CHANBUFSIZE,RL));
printoutc(fd, "Current Delay Queue size: L->R %d R->L %d
",delay_bufsize[LR],delay_bufsize[RL]);
} else {
printoutc(fd, "Loss %g+%g%c",
@@ -1218,7 +1217,7 @@
WIREVALUE_FIELDS(node,NOISE,0));
printoutc(fd, "MTU %g", min_wirevalue(node,MTU,0));
printoutc(fd, "Cap. %g+%g%c",
- WIREVALUE_FIELDS(node,CAPACITY,0));
+ WIREVALUE_FIELDS(node,CHANBUFSIZE,0));
printoutc(fd, "Current Delay Queue size:
%d",delay_bufsize[0]);
}
printoutc(fd,"Fifoness %s",(nofifo == 0)?"TRUE":"FALSE");
@@ -1268,7 +1267,8 @@
{"bandwidth",setband, 0},
{"band",setband, 0},
{"speed",setspeed, 0},
- {"capacity",setcapacity, 0},
+ {"chanbufsize",setchanbufsize, 0},
+ {"capacity",setchanbufsize, 0},
{"noise",setnoise, 0},
{"mtu",setmtu, 0},
{"fifo",setfifo, 0},
@@ -1400,7 +1400,7 @@
"\t--dup|-D dup_percentage\n"
"\t--band|-b bandwidth(bytes/s)\n"
"\t--speed|-s interface_speed(bytes/s)\n"
- "\t--capacity|-c delay_channel_capacity\n"
+ "\t--chanbufsize|-c channel_bufsize\n"
"\t--noise|-n noise_bits/megabye\n"
"\t--mtu|-m mtu_size\n"
"\t--nofifo|-N\n"
@@ -1431,6 +1431,7 @@
{"dup",1 , 0, 'D'},
{"band",1 , 0, 'b'},
{"speed",1 , 0, 's'},
+ {"chanbufsize",1 , 0, 'c'},
{"capacity",1 , 0, 'c'},
{"noise",1 , 0, 'n'},
{"mtu",1 , 0, 'm'},
@@ -1487,7 +1488,7 @@
read_wirevalue(optarg,SPEED);
break;
case 'c':
- read_wirevalue(optarg,CAPACITY);
+ read_wirevalue(optarg,CHANBUFSIZE);
break;
case 'M':
mgmt=strdup(optarg);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
vde-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vde-users