⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 trans_design.nr

📁 早期freebsd实现
💻 NR
📖 第 1 页 / 共 4 页
字号:
tab(%);l l l l..\" The next line sets the spacing for the table: 1+3 17+3 17+3 13+3.\"456789 123456789- 123456789 123456-789 123456789 1234567890.\".T&l l l s. %%/* log2(the negotiated max size) */% .T&l l l l. %int%tp_l_tpdusize;%/* # bytes */.\" ***************************************  %struct timeval%tp_rtt;% .T&l l l s. % %/* smoothed avg round-trip time */%  %struct timeval%tp_rtv;%  % %/* std deviation of round-trip time */% %struct timeval%tp_rttemit[ TP_RTT_NUM + 1 ];%%%/* times that the last TP_RTT_NUM %%% * DT_TPDUs were transmitted %%% */%.\" ***************************************  %unsigned % % %  tp_sendfcc:1,%/* shall next ack %% %include flow control conf. param? */%.\" *************************************** .T&l l l s. %  tp_trace:1,%/* is this pcb being traced?% %% * (not used yet) %%% */%.\" *************************************** %  tp_perf_on:1,%/* statistics being kept? */% .\" *************************************** %  tp_reneged:1,%/* have we reneged on credit%%% * since the last AK TPDU was sent? %%% */%%  tp_decbit:4,%/* congestion experienced? */%%  tp_flags:8,%/* see #defines below */%.\" *************************************** %  tp_unused:16;%%.T&l s s l.#define  TPF_XPD_PRESENT%TPFLAG_XPD_PRESENT#define  TPF_NLQOS_PDN%TPFLAG_NLQOS_PDN#define  TPF_PEER_ON_SAMENET%TPFLAG_PEER_ON_SAMENET%%%.\" *************************************** .T&l l l l. %struct tp_pmeas%*tp_p_meas;% .T&l l l s. % %/* ptr to mbuf to hold the perf.% %% * statistics structure %%% */%.\" *************************************** };.TE\fR.\".\" end of tpcb structure (thank you).\".)b.fi.sh 1 "Sequence Number Arithmetic".ppSequence numbers in TP can be either 7 bits (\*(lqnormal format\*(rq)or 31 bits(\*(lqextended format\*(rq).Sequence numbers are unsigned integers,regardless of their format.Three fields are kept in the pcb to manage the sequencenumber arithmetic:.(b\fC.TStab(+);l l l l. +u_int+tp_seqmask;+/* mask for seq space */ +u_int+tp_seqbit;+/* bit for seq # wraparound */ +u_int+tp_seqhalf;+/* half the seq space */.TE\fR.)b.lp\fITp_seqmask\fR is a bit mask indicating which bits are legitimate for a sequence number of either format.It takes the value 0x7f if 7-bit sequence numbers are in use,and 0x7fffffff if 31-bit sequence numbers are in use.\fITp_seqbit\fR is the bit that becomes set when a sequence number wraps aroundwhile being incremented.Its value is 0x80 for normal format, 0x80000000 for extended format.\fITp_seqhalf\fR takes the value which is in the middle of the sequence space,0x40 for normal format,and0x40000000 for extended format..(b.nfThe macro .fi\fC.TStab(+);l l l l.     SEQ(tpcb, x).TE\fR.)b.lpextracts a sequence number from the locationin which it is stored..ppThe macros.(b\fC.TStab(+);l l s s l. +SEQ_GT(tpcb, seq, t)+is seq > t? +SEQ_GEQ(tpcb, seq, t)+is seq >= t? +SEQ_LT(tpcb, seq, t)+is seq < t? +SEQ_LEQ(tpcb, seq, t)+is seq <= t? +SEQ_INC(tpcb, seq)+seq\+\+ +SEQ_DEC(tpcb, seq)+seq-- +SEQ_SUB(tpcb, seq, amt)+seq -= amt +SEQ_ADD(tpcb, seq, amt)+seq \+= amt.TE\fR.)b.lpperform the indicated comparisons and arithmeticon their arguments..ppAn example of how these macrosare used is as follows.To determine if a sequencenumber \fIseq\fR is in a receive windowbounded by\fIlwe\fR and \fIuwe\fR,we define themacro.(b\fC.TStab(+);l l.#define+IN_RWINDOW(tpcb, seq, lwe, uwe)\\+( SEQ_GEQ(tpcb, seq, lwe) && SEQ_LT(tpcb, seq, uwe) ).TE\fR.)b.sh 1 "TP Implementation Options".ppThe transport protocol specification leaves severalthings to the discretion of the implementor,some of which may affect the performanceof individual connections andaggregate performance.Wherever different strategies are likely to favorthe performance ofindividual connections to the detriment of aggregate performanceor vice versa, thevarious strategies are under the control of options via the\fIgetsockopt()\fR and\fIsetsockopt()\fR system calls (see the manual pages\fIgetsockopt(2)\fR,\fIsetsockopt(2)\fR  and\fItp(4p)\fR  for details).In some cases the preferred strategies differ for the differentsubnetworks, so the strategies chosen will be determinedby the subnetwork in use..sh 2 "TPDU size".ppThe limitation of the maximum TPDU size to a power of two isunfortunate in the LAN environment.For example, if the maximum NSDU size is around 1500, as in the case of anEthernet,using a maximum TPDU size of 1024 reducesthe possible throughput by approximately 30%.TP negotiates a maximum TPDU size of 2048 andgenerates TPDUs of size around 1500.Obviously this works well only when the peer is known to be using the same scheme (so that the peerdoesn't send TPDUs of size 2048 and cause itsnetwork layer to fragment the TPDUs).This is likely to be the case in a LAN whereall protocol entities are under the same administrativecontrol.The maximum TPDU size negotiated is under the control of the user,soit is possible to prevent this scheme from being usedby defaultwhen the peer is not on the same LAN, bysetting the \fItp.tpdusize\fR parameter in the ARGO directory servicefile tosomething less than the network's maximum transmissionunit..\"***********************************************************.sh 2 "Congestion Window Strategy".ppThe congestion window strategy from theDoD Internet was adapted for use with TP.The strategy is intended to minimize the adverse effectof transport's retransmission on analready congested network..ppA TP entity keeps two notions of the peer's window:the real window, which is that advertised by the peerin AK TPDUs, and the congestion window, which is a locallycontrolled window.TP uses the smaller of the two windows when transmitting.The congestion window starts small, which keeps anew connection from overloading the network with a suddenburst of packetsimmediately after connection establishement.This is called \fIslow start\fR. For each successful acknowledgment received, the congestionwindow grows by one, until eventually the real windowis the one in use.If a retransmission timer expires, the congestion windowis reset to size one..ppThe congestion window strategy is used for class 4 unlessthe transport user requests that it not be used.The slow start strategy is used for traffic over a PDNunlessthe transport user requests that it not be used.Slow start is not used for traffic over a LAN unlessits use is requested by the transport user..\"***********************************************************.sh 2 "Retransmission strategies".ppA retransmission timer is invoked for each set of DT TPDUssent in one send operation (call to \fItp_send()\fR).This set of packets is called the \fIsend window\fR for the purposeof this discusssion..ppThe number of TPDUs in a send windowdepends on the remote credit and the amount of datain the local send buffers.When a retransmission timer goes off, the lowerwindow edge is reevaluated but the upper window edge is not reevaluated..ppThere are several retransmission strategies implemented inARGO TP.The choice of strategies is the user's, and is made with the \fIsetsockopt()\fR system call.The strategies are summarized here:.ip "Retransmit LWE TPDU only:" 5Only the TPDU representing the new lower window edge is retransmitted.This is the default retransmission strategy..ip "Retransmit whole send window:" 5Retransmission begins with the new lower window edgeand continues up to the old upper window edge..ppThe value of the data retransmission timeradapts to the average round trip time and the standard deviation ofthe round trip time.A round trip time is the time that passes betweenthe moment of a packet's first transmission and the moment it is first acknowledged.The average round trip timeis kept by the sending side of TP, usinga formula for smoothing the average:.(b\fC.TStab(+);l l l l.#define+TP_RTT_ALPHA+3#define+TP_RTV_ALPHA+2+++#define+SMOOTH(alpha, old, new) \\+(((new-old) >> alpha ) \+ (old) ).TE\fR.)b.lpThe times included in the average are chosen as follows.The time of each packet's initial transmission is kept (for the last\fIN\fR packets, where \fIN\fR is a defined constant).When an AK TPDU arrives, ARGO TP subtracts the initial transmissiontime for the lowest unacknowledged sequence number that wasacknowledged by this AK TPDU from the current time,and apply the resulting time to the average.Hence, not all packets are included in this average,which is as it should be sincethe purpose of this measurement is to find a good value for the retransmission timer..ppEach time part of a window is retransmitted,the retransmission timer for that window is increased.This does not affect the retransmission timers for other windows..\"***********************************************************.sh 2 "Acknowledgment strategies".ppThe transport protocol specificationrequires acknowledgments to be sent immediatelyupon receiptof  CC TPDUs (in class 4), XPD TPDUs, and DT TPDUs containing anEOT marker, and at other times as required for flow control,otherwise acknowledgments may be delayed.In addition to the times when an acknowledgment is required,ARGO TP transmits an AK TPDU whenever the user receives some data,thereby increasing the size of the window.For those times whenimmediate acknowledgment is optional,ARGO TP offers two acknowledgment strategies:.ip "     Acknowledge each TPDU" 10Upon receipt of a DT TPDU and AK TPDU is sent..ip "     Acknowledge full window" 10Acknowledgment is issuedupon receipt of enough data toconsume the last advertised credit..ppThe latter strategyrequires a timer to trigger an acknowledgmentin case the peer doesn't send the entire window quickly.This timer is called the\fIsendack timer\fR.The upper bound on the value of this timer is called the \fIlocal acknowledgment time\fR.The local acknowledgment time may be "advertised" to the peer during connection establishment, and thepeer may choose to use this value toadjust its retransmission timers.The ARGO TP entity advertises its local acknowledgment timeon a CR TPDU, but it is not constrained by the remote acknowledge time, should the peer advertise it.Instead,ARGO TP adapts its sendack timerto the behavior of the connection..ppUnder the assumption that the round trip time isoften symmetric,and lacking a method to measurethe round trip time in the other direction,ARGO TP uses the measured average round trip timeto adjust the the sendack timer..ppThe choice of strategies is made with the\fIsetsockopt()\fR system call.The default strategy istodelay acknowledgments until the most recently advertised window is filled.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -