📄 debug.nr
字号:
are used.The program \fItpdiscard\fR or a simple file transferis run with various windowand maximum TPDU sizes, various acknoledgment strategies, andvarious retransmission strategies,and the activity is observed with the trace.The debug option\fBT.reneg\fRmust be used to fake a reneging of credit, sincethe ARGO transport entity does not renege its advertised creditunder normal operation.At the beginning of a connection a closed window may almost alwaysbe observed.The receiving user process may be stopped to force a window to shut down.The interesting statistics are.(b.nf\fIn\fR times local cdt reneged (receiving)\fIn\fR foreign window closed (sending)\fIn\fR faked reneging of cdt\fIn\fR DT TPDUs (sent)\fIn\fR DT TPDUs (received)\fIn\fR AK TPDUs (sent)\fIn\fR AK TPDUs (received)ACK reasons:\fIn\fR not acked immediately\fIn\fR strategy==each\fIn\fR strategy==fullwindow\fIn\fR duplicate DT\fIn\fR EOTSDU\fIn\fR reordered\fIn\fR user rcvd\fIn\fR fcc reqd.fi.)b.sh 4 "Retransmission and retention until acknowledgment:".ppTo observe that the sender retains TPDUs until they areacknowledged, one needs only to use the\fBT.drop\fRdebug option to cause TPDUs to be dropped by the receiving side.They are then retransmitted by the senderand finally dropped when the acknowledgment arrives.That the buffers used to hold retained TPDUs are freed can be observed by running \fInetstat(8)\fR with the -m optionon a quiescent system to observe the number of mbufs in use,thenrunning a test with the \fBT.drop\fR debug option on to cause retransmission,and finallyrunning netstat -m again after the test is over,to see that all the mbufs have been freed by TP.The actual retransmission activity can be observed in a tracewith the\fBT.ndata, \fR\fBT.emit\fR and \fBT.input\fR trace options.The retransmission strategy to be used is controlled by theARGO directory service.The statistics.(b.nf\fIn\fR DT (retransmissions)\fIn\fR XPD (retransmissions)\fIn\fR CR (retransmissions)\fIn\fR CC (retransmissions)\fIn\fR DR (retransmissions).fi.)b.lpindicate the number of retransmissions that actually occurred..sh 4 "Timers:".ppThe debug and trace option\fBT.timer\fRdumps information about the timers as they are set,as they are cancelled, and as they expire.The statistics.(b.nf\fIn\fR ticks \fIn\fR timers set \fIn\fR timers expired \fIn\fR timers cancelled\fIn\fR inactive timers cancelled\fIn\fR connections dropped due to retrans limit\fIn\fR CCs sent to zero dref.fi.)b.lpare printed for both the E-type timers and for the C-type timers.The effect of timers can be seen by observing retransmissions.Two simple ways to force retransmissions are:.npto use the \fBT.zdref\fR debug option,which causes CCs to contain a zero destination reference,so that connection establishment will time out, and.npto attempt to open a connection to a transport selector on whichno process is listening.Either of these actions, along with the \fBT.connect\fRtrace or debug option will permitobservation of the timeout facilities..sh 4 "TPDU creation and parsing:".ppTPDUs are created for output in \fItp_emit()\fR.The \fBT.emit\fRtraceoption dumps TPDUs as they are transmitted.\fITp_input()\fR parses TPDUs on input.The \fBT.input\fRtraceoption dumps TPDUs as they are received.The debug options \fBT.emit\fR and \fBT.input\fR dump a lot of excess informationto the console, and are used primarily for debuggingextremely pathological behavior..ppBy tracing the execution of \fItpdiscard\fR or a simple file transfer,with a variety protocol and service options,using the \fBT.connect,\fR\fBT.emit,\fR\fBT.input,\fR\fBT.ndata,\fR\fBT.aks,\fR\fBT.akr,\fRand \fBT.xpd\fRoptions,one can verify the correct placement of TPDU optionson all types of TPDUs.The interesting statistics are.(b.nf\fIn\fR variable parameters ignored \fIn\fR invalid parameter codes\fIn\fR invalid parameter values\fIn\fR invalid dutypes\fIn\fR invalid negotiation failures\fIn\fR invalid destinagion referencess\fIn\fR invalid suffix parameters\fIn\fR invalid checksums\fIn\fR connections used extended format\fIn\fR connections allowed transport XPD\fIn\fR connections turned off checksumming\fIn\fR TP 4 connections \fIn\fR TP 0 connections .fi.)b.sh 4 "Separation and concatenation:".ppConcatenation is not supported by this implementation.Separation is supported, however, and to test separation,some sort of concatenated TPDUs had to be created.The code for this is no longer supported.After testing locally with some temporary code to create concatenatedTPDUs,the ARGO transport implementation was tested with another transportimplementation that does generate concatenated TPDUs.The interesting statistics are:.(b.nf\fIn\fR concatenated TPDUs\fIn\fR TPDUs input.fi.)b.sh 4 "Length limits for TPDUs:".ppSome TPDUs may take user data:the CR, CC, DR, DT, and XPD.All of these but the DT TPDU have limits to the amountof data they may carry.The limits are enforced for CR, CC, and DR TPDUs by\fItp_ctloutput()\fR,the routine that accepts data from the user.The limit for XPD TPDUs is enforced by\fItp_usrreq()\fR, which accepts expediteddata from the user.To test the effectiveness of the checks on output, one may attemptto send expedited data with amounts larger than the limit (16 bytes)..ppOn input the limits are checked in\fItp_input()\fR.To test the effectiveness of the checks on input, it was necessaryto create an illegally large TPDU.The\fBT.badsize\fRdebug optiondoes this - it will turn a legitimateXPD TPDU into a XPD TPDU with 18 bytesof expedited data.The interesting statistics are:.(b.nf\fIn\fR illegally large XPD TPDU\fIn\fR invalid length.fi.)b.sh 4 "Frozen References:".ppThe key issue here is to see that references are not reassigneduntil the reference timer expires.This can be observed by watching the timer activity as describedabove and by observing the reference numbers chosen for socketswith the \fBT.emit\fRor \fBT.input\fR trace options, which trace the TPDU headers..sh 4 "Inactivity Control:".ppInactivity control can be observed by turning on the trace options\fBT.aks\fR, \fBT.akr\fR and \fBT.emit\fRduring a simple file transfer.In the middle of the transfer, if the sender processis stopped, both TP entities continueto send acknowledgments. This can be observed in the trace.If the file tranfer is between machines, taking down one of the machineswill cause the inactivity timer on the other machine to expire.The TP entity will respond to this by sending a DR TPDUto close the connection, which can be observed in the trace.The expiration of the timer can be observed in a trace if the\fBT.driver\fR option is used.This option traces all events and state changes in the TPfinite state machine..sh 4 "Connection establishment:".ppThe process of connection establishment can be observed with the\fBT.connect\fRtrace and debug options, andthe \fBT.driver \fRtrace option.Various states of the connection establishment state machinemay be observed with thethe debug option\fBT.zdref\fR.This optioncauses \fItp_input()\fRto change the foreign reference on an incoming CC TPDU to zero,eventually causing the CC TPDU to be dropped,retransmissions of the CC to occur,and the connection to time out before being established.The statistics of interest are:.(b.nf\fIn\fR CCs sent to zero dref\fIn\fR invalid dest refs\fIn\fR CC (received)\fIn\fR CC (sent)\fIn\fR CC (retransmitted)\fIn\fR (connections) timed out on retrans.fi.)b.sh 4 "Disconnection:".ppVarious states of the connection breakdown part of the state machinemay be observed with thethe trace options\fBT.input\fRor\fBT.emit\fR, \fBT.driver\fRandrunning thediscard or file transfer programs..sh 4 "Association of TPDUs with Transport Connection:".ppThe problem of locating a transport connectiongiven a TPDU is handled in \fItp_input()\fR in one of two ways.For an incoming CR TPDU, the transport suffixis used to locate a transport protocolcontrol block (PCB), to which a transportconnection is made by creating a new socket and PCB.For all other TPDU types, the destination reference is usedto locate the appropriate transport connection.This is done by scanning the list of reference blocks.Debug and trace optionswere used to debug these sections of code but have since beenremoved due to their effect on the readability and maintainability of this code.The trace options\fBT.connect\fRand\fBT.newsock\fRcreates trace records that contain the address of thesocket as well as that of the PCBwhen a socket is opened.When a TPDU arrives for a given socket,the trace records created by the\fBT.input \fRoption will also contain the address of the PCB that is foundin \fItp_input()\fR.These two addresses can be compared in the trace output to observethat the proper association is made..sh 4 "Protocol Errors and the ER TPDU:".ppCertain types of errors are intended to evoke the responsefrom the TP entity of sending an ER or a DR TPDU.The routine\fItp_error_emit()\fRcreates ER and DR TPDUs for this purpose.The debug and trace option\fBT.erroremit\fRdumps information about the activity of this routine.Since ER TPDUs are not generated under normal circumstances,the parsing of ER TPDUs was tested in thisimplementation by code that generated (illegitimate) ER TPDUs,This code was removed because it significantly complicated code maintenance..sh 4 "User Interface:".ppThe debug and trace options\fBT.request\fR, \fBT.params,\fR\fBT.indication\fR and\fBT.syscall\fR anddump information about the user interface.Most of the debugging code added to the socket-layerroutines for debugging has since been removed so thatthe source (which is functionally unchanged from the 4.3 release)would not unnecessarily be changed.\fIRlogin.iso\fR, the TP version of remote login,exercises some of the original BSD data transfer system calls (\fIread()\fR and \fIwrite()\fR)rather than \fIsendv()\fR and \fIrecv()\fR.The interesting statistics are.(b.nf\fIn\fR EOT indications\fIn\fR user rcvd\fIn\fR connections used extended format\fIn\fR connections allowed transport XPD\fIn\fR connections turned off checksumming\fIn\fR TP 4 connections \fIn\fR TP 0 connections .fi.)b
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -