88 lines · 1.9 KB · Text
RawDownload
.TH LOOPBACK 3 .SH NAMEloopback \- network link simulation.SH SYNOPSIS.nf.B bind -a #X /net .BI /net/loopback n /[0-1].BI /net/loopback n /[0-1]/data.BI /net/loopback n /[0-1]/ctl.BI /net/loopback n /[0-1]/status.BI /net/loopback n /[0-1]/stats .fi.SH DESCRIPTIONThe loopback interface,.BI /net/loopback n\f1,is a directory containing two subdirectories,one for each end of a simulated network link.The number.I nis the device number of the link, permitting multiple links to be used on a single machine..PPEach directory contains files to control the associated connection,receive and send data,monitor the simulation parameters,and supply statistics..PPThe.B datafiles for the two directories are cross-connected.Writes to one are divided into packets of at most a certain size,typically 32768 bytes,written to a flow-controlled output queue,transferred across the link,and put into an input queue where it is readable from the other.B datafile..PPOptions are set by writing to the.B ctlfile for the receiving end of the link,and are reported in the same format by reading.BR status .The following options are supported..TP.BI delay \ latency\ bytedelayControl the time a packet takes in the link.A packet.B nbytes long takes.I bytedelay.B *.B nnanoseconds to exit the output queue andis available for reading.I latencynanoseconds later..TP.BI droprate \ nRandomly drop approximately one out of.B npackets.If zero drop no packets..TP.BR indrop \ [01]Disallow or allow packets to be dropped if the input queue overflows..TP.BI limit \ nSet the input and output queues to hold at most.I nbytes..TP.B resetClear all of the statistics recorded for the link..PPReading.B statsreturns a list of 4 tagged numbers representing:.EX.ft 1	packets sent to this receiver	bytes sent to this receiver	packets dropped due to droprate	packets dropped due to input queue overflows.EE.SH SOURCE.B /sys/src/9/port/devloopback.c