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

📄 rfc1172.txt

📁 <VC++网络游戏建摸与实现>源代码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     Type      |    Length     |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   Type      7   Length      2   Default      Disabled.Perkins & Hobby                                                [Page 12]RFC 1172                  PPP Initial Options                  July 19902.7.  Address-and-Control-Field-Compression   Description      This Configuration Option provides a way to negotiate the      compression of the Data Link Layer Address and Control fields.  By      default all implementations must transmit frames with Address and      Control fields and must use the hexadecimal values 0xff and 0x03      respectively.  Since these fields have constant values, they are      easily compressed.  this Configuration Option may be used to      inform the remote end that you can receive compressed Address and      Control fields.      Compressed Address and Control fields are formed by simply      omitting them in all non-ambiguous cases.  Ambiguous frames may      not be compressed.  Ambiguous cases result when the two octets      following the Address and Control fields have values that could be      interpreted as valid Address and Control fields (i.e., 0xff,      0x03).  This can happen when Protocol-Field-Compression is enabled      and the Protocol field is compressed to one octet.  If the      Protocol value is 0xff, and the first octet of the Information      field is 0x03, the result is ambiguous and the Address and Control      fields must not be compressed on transmission.      On reception, the Address and Control fields are decompressed by      examining the first two octets.  If they contain the values 0xff      and 0x03, they are assumed to be the Address and Control fields.      If not, it is assumed that the fields were compressed and were not      transmitted.      One additional case in which the Address and Control fields must      never be compressed is when sending any LCP packet.  This rule      guarantees unambiguous recognition of LCP packets.      When the Address and Control fields are compressed, the Data Link      Layer FCS field is calculated on the compressed frame, not the      original uncompressed frame.   A summary of the Address-and-Control-Field-Compression configuration   option format is shown below.  The fields are transmitted from left   to right.    0                   1    0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+   |     Type      |    Length     |   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Perkins & Hobby                                                [Page 13]RFC 1172                  PPP Initial Options                  July 1990   Type      8   Length      2   Default      Not compressed.Perkins & Hobby                                                [Page 14]RFC 1172                  PPP Initial Options                  July 19903.  Link Quality Monitoring   Data communications links are rarely perfect. Packets can be dropped   or corrupted for various reasons (line noise, equipment failure,   buffer overruns, etc.).  Sometimes, it is desirable to determine   when, and how often, the link is dropping data.  Routers, for   example, may want to temporarily allow another route to take   precedence.  An implementation may also have the option of   disconnecting and switching to an alternate link.  The process of   determining data loss is called "Link Quality Monitoring".3.1.  Design Motivation   There are many different ways to measure link quality, and even more   ways to react to it.  Rather than specifying a single scheme, Link   Quality Monitoring is divided into a "mechanism" and a "policy".  PPP   fully specifies the "mechanism" for Link Quality Monitoring by   defining the LCP Link-Quality-Report (LQR) packet and specifying a   procedure for its use.  PPP does NOT specify a Link Quality   Monitoring "policy" -- how to judge link quality or what to do when   it is inadequate.  That is left as an implementation decision, and   can be different at each end of the link.  Implementations are   allowed, and even encouraged, to experiment with various link quality   policies.  The Link Quality Monitoring mechanism specification   insures that two implementations with different policies may   communicate and interoperate.   To allow flexible policies to be implemented, the PPP Link Quality   Monitoring mechanism measures data loss in units of packets, octets,   and Link-Quality-Reports.  Each measurement is made separately for   each half of the link, both inbound and outbound.  All measurements   are communicated to both ends of the link so that each end of the   link can implement its own link quality policy for both its outbound   and inbound links.   Finally, the Link Quality Monitoring protocol is designed to be   implementable on many different kinds of systems. Although it may be   common to implement PPP (and especially Link Quality Monitoring) as a   single software process, multi-process implementations with hardware   support are also envisioned. The PPP Link Quality Monitoring   mechanism provides for this by careful definition of the Link-   Quality-Report packet format, and by specifiying reference points for   all data transmission and reception measurements.3.2.  Design Overview   Each Link Quality Monitoring implementation maintains counts of the   number of packets and octets transmitted and successfully received,Perkins & Hobby                                                [Page 15]RFC 1172                  PPP Initial Options                  July 1990   and periodically transmits this information to its peer in a Link-   Quality-Report packet.  These packets contain three sections: a   Header section, a Counters section, and a Measurements section.   The Header section of the packet consists of the normal LCP Link   Maintenance packet header including Code, Identifier, Length and   Magic-Number fields.   The Counters section of the packet consists of four counters, and   provides the information necessary to measure the quality of the   link.  The LQR transmitter fills in two of these counters: Out-Tx-   Packets-Ctr and Out-Tx-Octets-Ctr (described later).  The LQR   receiver fills in the two remaining counters: In-Rx-Packets-Ctr and   In-Rx-Octets-Ctr (described later).  These counters are similar to   sequence numbers; they are constantly increasing to give a "relative"   indication of the number of packets and octets communicated across   the outbound link.  By comparing the values in successive Link-   Quality-Reports, an LQR receiver can compute the "absolute" number of   packets and octets communicated across its inbound link. Comparing   these absolute numbers then gives an indication of an inbound link's   quality.  Relative numbers, rather than absolute, are transmitted   because they greatly simplify link synchronization; an implementation   merely waits to receive two LQR packets.   The Measurements section of the packet consists of six state   variables: In-Tx-LQRs, Last-In-Id, In-Tx-Packets, In-Tx-Octets, In-   Rx-Packets, and In-Rx-Octets (described later).  This section allows   an implementation to report inbound link quality measurements to its   peer (for which the report will instead indicate outbound link   quality) by transmitting the absolute, rather than relative, number   of LQRs, packets, and octets communicated across the inbound link.   These values are calculated by observing the Counters section of the   Link-Quality-Report packets received on the inbound link.  Absolute   numbers may be used in this section without synchronization problems   because it is necessary to receive only one LQR packet to have valid   information.   Link Quality Monitoring is described in more detail in the following   sections.  First, a description of the processes comprising the Link   Quality Monitoring mechanism is presented.  This is followed by the   packet and byte counters maintained; the measurements, calculations,   and state variables used; the format of the Link-Quality-Report   packet; some policy suggestions; and, finally, an example link   quality calculation.3.3.  Processes   The PPP Link Quality Monitoring mechanism is described using aPerkins & Hobby                                                [Page 16]RFC 1172                  PPP Initial Options                  July 1990   "logical process" model. As shown below, there are five logical   processes duplicated at each end of the duplex link.   +---------+   +-------+   +----+ Outbound   |         |-->|  Mux  |-->| Tx |=========>   | Link-   |   +-------+   +----+   | Manager |   |         |   +-------+   +----+ Inbound   |         |<--| Demux |<--| Rx |<=========   +---------+   +-------+   +----+   Link-Manager      The Link-Manager process transmits and receives Link-Quality-      Reports, and implements the desired link quality policy.  LQR      packets are transmitted at a constant rate, which is negotiated by      the LCP Link-Quality-Monitoring Configuration Option.  The Link-      Manager process fills in only the Header and Measurements sections      of the packet; the Counters section of the packet is filled in by      the Tx and Rx processes.   Mux      The Mux process multiplexes packets from the various protocols      (e.g., LCP, IP, XNS, etc.) into a single, sequential, and      prioritized stream of packets.  Link-Quality-Report packets MUST      be given the highest possible priority to insure that link quality      information is communicated in a timely manner.   Tx      The Tx process maintains the counters Out-Tx-Packets-Ctr and Out-      Tx-Octets-Ctr which are used to measure the amount of data which      is transmitted on the outbound link.  When Tx processes a Link-      Quality-Report packet, it inserts the values of these counters      into the Counters section of the packet.  Because these counters      represent relative, rather than absolute, values, the question of      when to update the counters, before or after they are inserted      into a Link-Quality-Report packet, is left as an implementation      decision. However, an implementation MUST make this decision the      same way every time.  The Tx process MUST follow the Mux process      so that packets are counted in the order transmitted to the link.   Rx      The Rx process maintains the counters In-Rx-Packets-Ctr and In-      Rx-Octets-Ctr which are used to measure the amount of data which      is received by the inbound link.  When Rx processes a Link-Perkins & Hobby                                                [Page 17]RFC 1172                  PPP Initial Options                  July 1990      Quality-Report packet, it inserts the values of these counters      into the Counters section of the packet.  Again, the question of      when to update the counters, before or after they are inserted      into a Link-Quality-Report packet, is left as an implementation      decision which MUST be made consistently the same way.   Demux      The Demux process demultiplexes packets for the various protocols.      The Demux process MUST follow the Rx process so that packets are      counted in the order received from the link.3.4.  Counters   In order to fill in the Counters section of a Link-Quality-Report   packet, Link Quality Monitoring requires the implementation of one   8-bit unsigned, and four 32-bit unsigned, monotonically increasing   counters.  These counters may be reset to any initial value before   the first Link-Quality-Report is transmitted, but MUST NOT be reset   again until LCP has left the Open state.  Counters wrap to zero when   their maximum value is reached (for 32 bit counters: 0xffffffff + 1 =   0).   Out-Identifier-Ctr      Out-Identifier-Ctr is an 8-bit counter maintained by the Link-      Manager process which increases by one for each transmitted Link-      Quality-Report packet.   Out-Tx-Packets-Ctr      Out-Tx-Packets-Ctr is a 32-bit counter maintained by the Tx      process which increases by one for each transmitted Data Link      Layer packet.   Out-Tx-Octets-Ctr      Out-Tx-Octets-Ctr is a 32-bit counter maintained by the Tx process      which increases by one for each octet in a transmitted Data Link      Layer packet.  All octets which are included in the FCS      calculation MUST be counted, as should the FCS octets themselves.      All other octets MUST NOT be counted.

⌨️ 快捷键说明

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