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

📄 rfc2892.txt

📁 <VC++网络游戏建摸与实现>源代码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
   stripped. Unicast packets are normally stripped by the destination   station or by the source station if the destination station has   failed. Multicast packets are only stripped by the source station. If   both the source and destination stations drop out of the ring while a   unicast packet is in flight, or if the source node drops out while   its multicast packet is in flight, the packet will rotate around the   ring continuously.   The solution to this problem is to have a TTL or Time To Live field   in each packet that is set to at least twice the number of nodes in   the ring. As each node forwards the packet, it decrements the TTL. If   the TTL reaches zero it is stripped off of the ring.Tsiang & Suwala              Informational                     [Page 24]RFC 2892            The Cisco SRP MAC Layer Protocol         August 2000   The ring ID is used to qualify all stripping and receive decisions.   This is necessary to handle the case where packets are being wrapped   by some node in the ring. The sending node may see its packet on the   reverse ring prior to reaching its destination so must not source   strip it.  The exception is if a node is in wrap.  Logically, a node   in wrap "sees" the packet on both rings.  However the usual   implementation is to receive the packet on one ring and to transmit   it on the other ring.  Therefore, a node that is in the wrap state   ignores the ring ID when making stripping and receiving decisions.   A potential optimization would be to allow ring ID independent   destination stripping of unicast packets.  One problem with this is   that packets may be delivered out of order during a transition to a   wrap condition. For this reason, the ring ID should always be used as   a qualifier for all strip and receive decisions.5.  Packet acceptance and stripping   A series of decisions based on the type of packet (mode), source and   destination addresses are made on the MAC incoming packets. Packets   can either be control or data packets.  Control packets are stripped   once the information is extracted. The source and destination   addresses are checked in the case of data packets. The rules for   reception and stripping are given below as well as in the flow chart   in Figure 16.      1. Decrement TTL on receipt of a packet, discard if it gets to         zero; do not forward.      2. Strip unicast packets at the destination station.  Accept and         strip "control" packets.      3. Do not process packets other than for TTL and forwarding if         they have the "wrong" ring_id for the direction in which they         are received unless the node is in wrap.  If the node is in         wrap then ignore the ring_id.      4. Do not process packets other than for TTL and forwarding if the         mode is not supported by the node (e.g. reserved modes, or ATM         cell mode for packet nodes).      5. Packets accepted by the host because of the destination address         should be discarded at the upper level if there is CRC error.      6. Control messages are point to point between neighbors and         should always be accepted and stripped.Tsiang & Suwala              Informational                     [Page 25]RFC 2892            The Cisco SRP MAC Layer Protocol         August 2000      7. Packets whose source address is that of the receiving station         and whose ring_id matches should be stripped.  If a node is in         wrap then ignore the ring_id.   FIGURE 16. SRP Receive Flowchart (Packet node)   if (MODE == 4,5)-------------------------------->[to host]--->|           |                                                     |           v                                                     |   if (MODE == 6)---------------------------------->[strip]----->|           |                                                     |           v                                                     |   if (!WRAPPED                                                  |      & WRONG_RING_ID)-------------------------------------------|--->|           |                                                     |    |           v                                                     |    |   if (MODE == 0,1,2,3)------------------------------------------|--->|           |                                                     |    |           v                                                     |    |   if (DA MATCH)--------------->if !(SA MATCH)----->[to host]--->|    |           |                            |                        |    |           |                            v                        |    |           |                    if (unicast)------->[to host]--->|    |           |                            |                        |    |           |                            v                        |    |   if (SA MATCH)-------------------->[strip]-------------------->|    |           |                                                     |    |           |                                                     |    v           |--------------------------->|<-----------------------|----|                                        |                        |                                        v                        |                                if (ttl < 2)------->[strip]----->|                                        |                        |                                        v                        |                                [decrement ttl]                  |                                        |                        |                                [fwd pkt to tb]                  |                                        |                        v                                        |<-----------------------|                                        v                                  [back to top]   Notes:  Host is responsible for discarding CRC errored packets.           Conditionals (if statements) branch to the right if true           and branch down if false.Tsiang & Suwala              Informational                     [Page 26]RFC 2892            The Cisco SRP MAC Layer Protocol         August 20005.1.  Transmission and forwarding with priority   A node can transmit four types of packets:      1. High priority packets from the high priority transit         buffer.      2. Low priority packets from the low priority transit buffer.      3. High priority packets from the host Tx high priority fifo.      4. Low priority packets from the host Tx low priority fifo.   High priority packets from the transit buffer are always sent first.   High priority packets from the host are sent as long as the low   priority transit buffer is not full.  Low priority packets are sent   as long as the transit buffer has not crossed the low priority   threshold and the SRP-fa rules allow it (my_usage < allowed_usage).   If nothing else can be sent, low priority packets from the low   priority transit buffer are sent.   This decision tree is shown in Figure 17.Tsiang & Suwala              Informational                     [Page 27]RFC 2892            The Cisco SRP MAC Layer Protocol         August 2000   FIGURE 17. SRP transmit flowchart   if (TB_High has pkt)----------->[send pkt from TB_high]-->|           |                                                 |           v                                                 |   if (TB_Low full)------------------------------------------|---->|           |                                                 |     |           v                                                 |     |   if (Tx_High has pkt)----------->[send pkt from Tx_high]-->|     |           |                                                 |     |           v                                                 |     |   if (TB_Low > Hi threshold)--------------------------------|---->|           |                                                 |     |           v                                                 |     |   if (my_usage >= allowed_usage)----------------------------|---->|           |                                                 |     |           v                                                 |     |   if (Tx_Low has pkt)------------>[send pkt from Tx_low]--->|     |           |                                                 |     |           |                                                 |     v           |<------------------------------------------------|-----|           |                                                 |           v                                                 |   if (TB_Low has pkt)------------>[send pkt from TB_low]--->|           |                                                 v           |<------------------------------------------------|           |           v       [Go to Top]   Notes:  Conditionals (if statements) branch to the right if true           and branch down if false.5.2.  Wrapping of Data   Normally, transmitted data is sent on the same ring to the downstream   neighbor.  However, if a node is in the wrapped state, transmitted   data is sent on the opposite ring to the upstream neighbor.6.  SRP-fa Rules Of Operation   The SRP-fa governs access to the ring.  The SRP-fa only applies to   low priority traffic.  High priority traffic does not follow SRP-fa   rules and may be transmitted at any time as long as there is   sufficient transit buffer space.Tsiang & Suwala              Informational                     [Page 28]RFC 2892            The Cisco SRP MAC Layer Protocol         August 2000   The SRP-fa requires three counters which control the traffic   forwarded and sourced on the SRP ring. The counters are my_usage   (tracks the amount of traffic sourced on the ring), forward_rate   (amount of traffic forwarded on to the ring from sources other than   the host) and allowed_usage (the current maximum transmit usage for   that node).   With no congestion all nodes build up allowed usage periodically.   Each node can send up to max_usage.  Max_usage is a per node   parameter than limits the maximum amount of low priority traffic a   node can send.   When a node sees congestion it starts to advertise its my_usage which   has been low pass filtered (lp_my_usage).   Congestion is measured by the transit buffer depth crossing a   congestion threshold.   A node that receives a non-null usage message (rcvd_usage) will set   its allowed usage to the value advertised.  However, if the source of   the rcvd_usage is the same node that received it then the rcvd_usage   shall be treated as a null value.  When comparing the rcvd_usage   source address the ring ID of the usage packet must match the   receiver's ring ID in order to qualify as a valid compare.  The   exception is if the receive node is in the wrap state in which case   the usage packet's ring ID is ignored.   Nodes that are not congested and that receive a non-null rcvd_usage   generally propagate rcvd_usage to their upstream neighbor else   propagate a null value of usage (all 1's).  The exception is when an   opportunity for local reuse is detected. Additional spatial reuse   (local reuse) is achieved by comparing the forwarded rate (low pass   filtered) to allow_usage.  If the forwarded rate is less than the   allowed usage, then a null value is propagated to the upstream   neighbor.   Nodes that are congested propagate the smaller of lp_my_usage and   rcvd_usage.   Convergence is dependent upon number of nodes and distance.   Simulation has shown simulation convergence within 100 msec for rings   of several hundred miles.Tsiang & Suwala              Informational                     [Page 29]RFC 2892            The Cisco SRP MAC Layer Protocol         August 20006.1.  SRP-fa pseudo-code   A more precise definition of the fairness algorithm is shown below:Variables:lo_tb_depth     low priority transit buffer depthmy_usage        count of octets transmitted by hostlp_my_usage     my_usage run through a low pass filtermy_usage_ok     flag indicating that host is allowed to transmitallow_usage     the fair amount each node is allowed to transmitfwd_rate        count of octets forwarded from upstreamlp_fwd_rate     fwd_rate run through a low pass filtercongested       node cannot transmit host traffic without the TB buffer                filling beyond its congestion threshold point.rev_usage       the usage value passed along to the upstream neighborConstants:MAX_ALLOWANCE = configurable value for max allowed usage for this nodeDECAY_INTERVAL = 8000 octet times @ OC-12, 32,000 octet times @ OC-48AGECOEFF = 4    // Aging coeff for my_usage and f

⌨️ 快捷键说明

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