📄 e.t
字号:
.\" Copyright (c) 1983, 1986, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)e.t 8.1 (Berkeley) 6/8/93.\".nr H2 1.\".ds RH "Trailer protocols.br.ne 2i.NH\s+2Trailer protocols\s0.PPCore to core copies can be expensive.Consequently, a great deal of effort was spentin minimizing such operations. The VAX architectureprovides virtual memory hardware organized inpage units. To cut down on copy operations, datais kept in page-sized units on page-alignedboundaries whenever possible. This allows datato be moved in memory simply by remapping the pageinstead of copying. The mbuf and networkinterface routines perform page table manipulationswhere needed, hiding the complexities of the VAXvirtual memory hardware from higher level code. .PPData enters the system in two ways: from the user,or from the network (hardware interface). When datais copied from the user's address spaceinto the system it is deposited in pages (if sufficientdata is present).This encourages the user to transmit information inmessages which are a multiple of the system page size..PPUnfortunately, performing a similar operation when takingdata from the network is very difficult.Consider the format of an incoming packet. A packetusually contains a local network header followed byone or more headers used by the high level protocols. Finally, the data, if any, follows these headers. Sincethe header information may be variable length, DMA'ing the eventualdata for the user into a page aligned area ofmemory is impossible without\fIa priori\fP knowledge of the format (e.g., by supportingonly a single protocol header format)..PPTo allow variable length header information tobe present and still ensure page alignment of data,a special local network encapsulation may be used.This encapsulation, termed a \fItrailer protocol\fP [Leffler84],places the variable length header information afterthe data. A fixed size local networkheader is then prepended to the resultant packet. The local network header contains the size of thedata portion (in units of 512 bytes), and a new \fItrailer protocolheader\fP, inserted before the variable lengthinformation, contains the size of the variable lengthheader information. The following trailerprotocol header is used to store informationregarding the variable length protocol header:.DS._fstruct { short protocol; /* original protocol no. */ short length; /* length of trailer */};.DE.PPThe processing of the trailer protocol is verysimple. On output, the local network header indicates thata trailer encapsulation is being used.The header also includes an indicationof the number of data pages present before the trailerprotocol header. The trailer protocol header isinitialized to contain the actual protocol identifier and thevariable length header size, and is appended to the dataalong with the variable length header information..PPOn input, the interface routines identify thetrailer encapsulationby the protocol type stored in the local network header,then calculate the number ofpages of data to find the beginning of the trailer. The trailing information is copied into a separatembuf and linked to the front of the resultant packet..PPClearly, trailer protocols require cooperation betweensource and destination. In addition, they are normallycost effective only when sizable packets are used. Thecurrent scheme works because the local network encapsulationheader is a fixed size, allowing DMA operationsto be performed at a known offset from the first data pagebeing received. Should the local network header bevariable length this scheme fails. .PPStatistics collected indicate that as much as 200Kb/scan be gained by using a trailer protocol with1Kbyte packets. The average size of the variablelength header was 40 bytes (the size of aminimal TCP/IP packet header). If hardwaresupports larger sized packets, even greater gainsmay be realized.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -