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

📄 c.t

📁 早期freebsd实现
💻 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..\".\"	@(#)c.t	8.1 (Berkeley) 6/8/93.\".nr H2 1.\".ds RH "Buffering and congestion control.br.ne 2i.NH\s+2Buffering and congestion control\s0.PPOne of the major factors in the performance of a protocol isthe buffering policy used.  Lack of a proper buffering policycan force packets to be dropped, cause falsified windowinginformation to be emitted by protocols, fragment host memory,degrade the overall host performance, etc.  Due to problemssuch as these, most systems allocate a fixed pool of memoryto the networking system and imposea policy optimized for ``normal'' network operation.  .PPThe networking system developed for UNIX is little different in thisrespect.  At boot time a fixed amount of memory is allocated bythe networking system.  At later times more system memorymay be requested as the need arises, but at no time ismemory ever returned to the system.  It is possible togarbage collect memory from the network, but difficult.  Inorder to perform this garbage collection properly, someportion of the network will have to be ``turned off'' asdata structures are updated.  The interval over which thisoccurs must kept small compared to the average inter-packetarrival time, or too much traffic maybe lost, impacting other hosts on the network, as well asincreasing load on the interconnecting mediums.  In ourenvironment we have not experienced a need for such compaction,and thus have left the problem unresolved..PPThe mbuf structure was introduced in chapter 5.  In thissection a brief description will be given of the allocationmechanisms, and policies used by the protocols in performingconnection level buffering..NH 2Memory management.PPThe basic memory allocation routines manage a private page map,the size of which determines the maximum amount of memorythat may be allocated by the network.A small amount of memory is allocated at boot timeto initialize the mbuf and mbuf page cluster free lists.When the free lists are exhausted, more memory is requestedfrom the system memory allocator if space remains in the map.If memory cannot be allocated,callers may block awaiting free memory,or the failure may be reflected to the caller immediately.The allocator will not block awaiting free map entries, however,as exhaustion of the page map usually indicates that buffers have been lostdue to a ``leak.''The private page table is used by the network buffer managementroutines in remapping pages tobe logically contiguous as the need arises.  In addition, anarray of reference counts parallels the page table and is usedwhen multiple references to a page are present..PPMbufs are 128 byte structures, 8 fitting in a 1Kbytepage of memory.  When data is placed in mbufs,it is copied or remapped into logically contiguous pages ofmemory from the network page pool if possible.Data smaller than half of the sizeof a page is copied into one or more 112 byte mbuf data areas. .NH 2Protocol buffering policies.PPProtocols reserve fixed amounts ofbuffering for send and receive queues at socket creation time.  Theseamounts define the high and low water marks used by the socket routinesin deciding when to block and unblock a process.  The reservationof space does not currentlyresult in any action by the memory managementroutines..PPProtocols which provide connection level flow control do thisbased on the amount of space in the associated socket queues.  Thatis, send windows are calculated based on the amount of free spacein the socket's receive queue, while receive windows are adjustedbased on the amount of data awaiting transmission in the send queue.Care has been taken to avoid the ``silly window syndrome'' describedin [Clark82] at both the sending and receiving ends..NH 2Queue limiting.PPIncoming packets from the network are always received unlessmemory allocation fails.  However, each Level 1 protocolinput queuehas an upper bound on the queue's length, and any packetsexceeding that bound are discarded.  It is possible for a host to beoverwhelmed by excessive network traffic (for instance a hostacting as a gateway from a high bandwidth network to a low bandwidthnetwork).  As a ``defensive'' mechanism the queue limits may beadjusted to throttle network traffic load on a host.Consider a host willing to devote some percentage ofits machine to handling network traffic. If the cost of handling anincoming packet can be calculated so that an acceptable``packet handling rate''can be determined, then input queue lengths may be dynamicallyadjusted based on a host's network load and the number of packetsawaiting processing.  Obviously, discarding packets isnot a satisfactory solution to a problem such as this(simply dropping packets is likely to increase the load on a network);the queue lengths were incorporated mainly as a safeguard mechanism..NH 2Packet forwarding.PPWhen packets can not be forwarded because of memory limitations,the system attempts to generate a ``source quench'' message.  In addition,any other problems encountered during packet forwarding are alsoreflected back to the sender in the form of ICMP packets.  Thishelps hosts avoid unneeded retransmissions..PPBroadcast packets are never forwarded due to possible direconsequences.  In an early stage of network development, broadcastpackets were forwarded and a ``routing loop'' resulted in networksaturation and every host on the network crashing.

⌨️ 快捷键说明

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