Max rate


(Chruker) #1

Hi

I was digging around the Quake source code to locate the 25kbs limit. And the only thing I found was this:

	// if the client is on the same subnet as the server and we aren't running an
	// internet public server, assume they don't need a rate choke
	if ( Sys_IsLANAddress( cl->netchan.remoteAddress ) && com_dedicated->integer != 2 && sv_lanForceRate->integer == 1) {
		cl->rate = 99999;	// lans should not rate limit
	} else {
		val = Info_ValueForKey (cl->userinfo, "rate");
		if (strlen(val)) {
			i = atoi(val);
			cl->rate = i;
			if (cl->rate < 1000) {
				cl->rate = 1000;
			} else if (cl->rate > 90000) {
				cl->rate = 90000;
			}
		} else {
			cl->rate = 3000;
		}
	}

But from that code it seems that the rate is capped at 90000 on non-LANs

Does ET still have this 25 kbs limit?

Ideally I would like to type /rate 100000 and have no dropped packages on a full server, while playing fueldump :slight_smile:


(Shanks) #2

Also from Q3:


rate = trap_Cvar_VariableValue( "rate" );
	if( rate <= 2500 ) {
		networkOptionsInfo.rate.curvalue = 0;
	}
	else if( rate <= 3000 ) {
		networkOptionsInfo.rate.curvalue = 1;
	}
	else if( rate <= 4000 ) {
		networkOptionsInfo.rate.curvalue = 2;
	}
	else if( rate <= 5000 ) {
		networkOptionsInfo.rate.curvalue = 3;
	}
	else {
		networkOptionsInfo.rate.curvalue = 4;
	}

Then

case ID_RATE:
		if( networkOptionsInfo.rate.curvalue == 0 ) {
			trap_Cvar_SetValue( "rate", 2500 );
		}
		else if( networkOptionsInfo.rate.curvalue == 1 ) {
			trap_Cvar_SetValue( "rate", 3000 );
		}
		else if( networkOptionsInfo.rate.curvalue == 2 ) {
			trap_Cvar_SetValue( "rate", 4000 );
		}
		else if( networkOptionsInfo.rate.curvalue == 3 ) {
			trap_Cvar_SetValue( "rate", 5000 );
		}
		else if( networkOptionsInfo.rate.curvalue == 4 ) {
			trap_Cvar_SetValue( "rate", 25000 );
		}
		break;

(Chruker) #3

Yeah, but as far as I see that code - as it is take from ui_network.c - it is just the menu handling. I can’t see how typing /rate 100000 into the console comes in contact with that code.


(SCDS_reyalP) #4

If I’ve understood things correctly, Q3 will still only send up to about ~30k/sec since it only transmits 1500 bytes per message. However, I have only skimmed that code, so I might well be wrong.


(Chruker) #5

I’ve been digging some more, and I can only find some other kind of limiter in the section of code that writes downloads to the client. There it is using a MAX_DOWNLOAD_WINDOW (or something like that) in another calculation about how many windows it should allow per snapshot.

However I’m only able to test this locally. Despite the code to ‘unlimit’ speed on a LAN connection, I can only get a client to download with 20 KB/s.

That said, I don’t know if the pk3 download rate can be an indicator of the maxrate ingame, since the two things appears to be regulated by different pieces of code.


(Chruker) #6

That said, I can’t find any mention of the sv_dl_maxRate cvar in the Quake source code, so that piece of the code may be a lot different in ET.


(SCDS_reyalP) #7

in sv_snapshot.c, SV_SendClientMessages looks like it will only send one ~1500 byte fragment to a given client. SV_SendClientMessages() is only called once per server frame. So given sv_fps 20, you get at most ~30000 bytes per client per frame.


(Chruker) #8

Damn, I think you’re right. The network code has to be rewritten / patched to send multiple datagrams per serverframe. Sadly that is out of Project Bugfix’s league :frowning: (for now :-))

But still 25000, which many big servers run with, could be increased to 30000.