www.a00.de > tcpgroup > 1994 > msg00119
 

TCP-group 1994


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RTT Storage



one area that might be an improvement is the storage of the smoothed
round trip time in a temporary file.  Every time you shut the NOS down
you have to start over again.  In JNOS the rtt cache has up to 16 entries,
and can be readily stored in a file during shutdown.  Then during reboot,
they can be scooped in again and your system timing is something better than
the defaults.  Limited testing so far, and may need macro defines for other
Operating Sytems that I didn't look into fully - such as "rb" for file open...

In main.c:

	kinit();
	ipinit();
	ioinit();
>	rtt_read();	/* read the tcp smoothed round trip time cache file */
	Cmdpp = mainproc("cmdintrp");

and

void
where_outta_here(resetme)
int resetme;
{
	time_t StopTime;
	FILE *fp;
	char *inbuf,*intmp;
  
>	rtt_store();	/* Write the tcp round trip times to cache file */

Then in files.c:

	/* So NET and NOS can coexist in \net, I will try ftpusers.nos but if it
	 * doesn't exist, we will lop off the .nos.  K5JB */
	char *Userfile  = "/ftpusers.nos";		/* Authorized FTP users and passwords */
	#else
	char *Userfile  = "/ftpusers";		/* Authorized FTP users and passwords */
	#endif
>	char *Rttfile   = "/rttcache";		/* tcp round trip time cache store */
	char *Hostfile  = "/net.rc";			/* hosts and passwords */
	char *Spoolqdir = "/spool";			 /* Spool directory */

and

	Hostfile = rootdircat(Hostfile);
>	Rttfile = rootdircat(Rttfile);
#ifdef SMTPLOG
	Maillog = rootdircat(Maillog);
#endif
	Spoolqdir = rootdircat(Spoolqdir);


And the main change in tcpsubr.c:

	struct tcp_rtt *
	rtt_get(addr)
	int32 addr;
	{
	    register struct tcp_rtt *tp;
	  
	    if(addr == 0)
	        return NULLRTT;
	    tp = &Tcp_rtt[(unsigned short)addr % RTTCACHE];
	    if(tp->addr != addr)
	        return NULLRTT;
	    return tp;
	}

>	void
>	rtt_store(void)
>	{
>		extern char *Rttfile;
>		FILE *stream;
>		struct tcp_rtt *tp;
>		int val;
>	
>		if ((stream = fopen(Rttfile, "wb")) == NULL)
>			return;
>	
>		for (tp = &Tcp_rtt[0]; tp < &Tcp_rtt[RTTCACHE]; tp++)  {
>			if (tp->addr != 0)  {
>				val = fwrite((void *)tp, sizeof(struct tcp_rtt), 1, stream);
>				if (val != 1)
>					break;
>			}
>		}
>	
>		fclose(stream);
>	}
>	
>	void
>	rtt_read(void)
>	{
>		extern char *Rttfile;
>		FILE *stream;
>		struct tcp_rtt *tp;
>		int val;
>	
>		if ((stream = fopen(Rttfile, "rb")) == NULL)
>			return;
>	
>		for (tp = &Tcp_rtt[0]; tp < &Tcp_rtt[RTTCACHE]; tp++)  {
>			val = fread((void *)tp, sizeof(struct tcp_rtt), 1, stream);
>			if (val != 1)
>				break;
>		}
>	
>		fclose(stream);
>	}
>
----

That's about it.

-- 
n5owk




Document URL : http://www.a00.de/tcpgroup/1994/msg00119.php
Ralf D. Kloth, Ludwigsburg, DE (QRQ.software). < hostmaster at a00.de > [don't send spam]
Created 2004-10-04. Last modified 2004-10-04. Your visit 2024-04-25 17:37.44. Page created in 0.0226 sec.
 
[Go to the top of this page]   [... to the index page]