Abstract:
The invention comprises a method and apparatus for discarding frames in a communications device. In accordance with the method of the invention, a plurality of cells are received representing a plurality of frames wherein each cell comprises a data portion and a header portion including a cell loss priority indicator. At least some of the cells are stored in a buffer. It is determined if the number of cells in the buffer exceeds a first threshold when a first cell including an end of file marker is received. A series of cells received between the first cell and a second cell are discarded if the first threshold was exceeded in the determining step and if the cell loss priority indicator for a cell in the series of cells is set to a first state. The second cell comprises a cell including an end of file marker.

Description:
RELATED APPLICATIONS 
     This application claims the benefit of U.S. provisional application Ser. No. 60/001,498, filed Jul. 19, 1995. 
     TECHNICAL FIELD OF THE INVENTION 
     This invention relates generally to telecommunications and more specifically to a method and apparatus for discarding frames in a communications device. 
     BACKGROUND OF THE INVENTION 
     Communication networks employing asynchronous transfer mode (ATM) cells for communication often are interfaced to devices employing various communications protocols. Because a number of existing communications networks employ communications protocols other than ATM, ATM communications networks are often interfaced to existing communications networks. Examples of communications networks include the telephone network, ISDN networks, frame relay networks, ethernet networks, and/or token ring networks. Some existing communication networks that are interfaced to ATM communication networks use frames of information to communicate. When frames are transported through an ATM communications network, the frames are typically broken up into a series of ATM cells wherein the end of a frame is indicated by information in the header of the ATM cell. 
     To relieve congestion in an ATM communications network, it is sometimes desirable to discard ATM cells at a switching node in the network due to congestion in either that switching node or in the communications network in general. Discarding cells that are pieces of frames traveling through the ATM communications network, however, can cause bandwidth to be used inefficiently. If a single ATM cell that is a piece of a frame comprised of a larger number of ATM cells is discarded, then the entire frame of ATM cells will need to be resent through the communications network. If other ATM cells in this frame are allowed to pass through the network after a cell of the frame has been discarded, then the bandwidth used to transmit the non-discarded cells through the ATM communications network will essentially be wasted. Discarding frames in a congested switching node or network may also be problematic as certain frames may be more important than other frames. 
     SUMMARY OF THE INVENTION 
     The invention comprises a method and apparatus for discarding frames in a communications network using a series of cells for communication. The invention allows frames to be assigned different priorities such that frames having different priorities may be discarded at different levels of congestion. One aspect of the invention is a method for discarding frames in a communications device. A plurality of cells are received representing a plurality of frames wherein each cell comprises a data portion and a header portion including a cell loss priority indicator. At least some of the cells are stored in a buffer. When a first cell including an end of frame marker is received, it is determined if the number of cells in the buffer exceeds a first threshold. If the first threshold was exceeded, then a series of cells received between the first cell and a second cell is discarded if the cell loss priority indicator for a cell in that series of cells is set to a first state. The second cell comprises a cell including an end of frame marker. 
     The invention has several important technical advantages. The invention allows more efficient use of bandwidth in an ATM communications network as an entire frame comprising a series of cells is discarded when congestion occurs, rather than only discarding a portion of the frame. In addition, even if the network becomes congested during the transmission of a frame, the cells in that frame will remain undiscarded unless an overrun condition is detected or the buffer pool limit is exceeded. The invention allows cells of a frame to be marked with multiple priority levels using header information of the ATM cells. This feature of the invention allows frames to be discarded at varying levels of congestion depending upon their priority. A lower priority frame will be discarded at a lower level of congestion. The invention may therefore increase the throughput of high priority frames. 
     With prioritized frame discard, frames may be marked as high priority when they use bandwidth below the committed information rate of the frame based communications network and as low priority when they use bandwidth above the committed information rate of the frame based communications network. An ATM communications network employing the present invention may then first discard frames that were sent above the committed information rate, providing a fairer distribution of bandwidth among users of the frame based communications network. Also, prioritized frame discarding may be used as an input filter in a communications network where the end stations are not flow controlled. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     For a more complete understanding of the present invention and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings in which: 
     FIG. 1 illustrates a block diagram of a communications device constructed in accordance with the teachings of the invention; and 
     FIG. 2 illustrates a flow chart describing the steps of discarding frames in accordance with the invention. 
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     The preferred embodiment of the present invention and its advantages are best understood by referring to FIGS. 1 through 2 of the drawings, like numerals being used for like and corresponding parts of the various drawings. 
     FIG. 1 illustrates a communications device 10 constructed in accordance with the teachings of the invention. In this embodiment, communications device 10 comprises a switching node in an ATM communications network. Communications device 10 could be any type of communications device in a communications network employing a series of cells to pass frames of information through the communications network. 
     Communications device 10 comprises a series of input processors 12 coupled to a switch fabric 14. Each input processor 12 is connected to one or more sources of input data. Input processor 12 processes the input data, discards cells as necessary, and passes non-discarded cells to switch fabric 14. Input processor 12 may also convert varying types of data into a series of ATM cells. 
     Input processor 12 further comprises processor 16, queue pointers 18, and buffer memory 20. Input processor 12 comprises an application specific integrated circuit (ASIC) but could also be any type of electronic circuitry operable to perform the functions described below. 
     Processor 16 controls the discarding of cells in communications device 10. Cells received by input processor 12 that are not discarded by processor 16 are stored in queues in buffer memory 20. In this example, each virtual connection is associated with its own queue in buffer memory 20. Pointers stored in queue pointer memory 18 are used to keep track of the front and back of each queue in buffer memory 20. Each queue associated with a virtual connection may also be referred to as a buffer. Input processor 16 determines a maximum size for a queue associated with a specific virtual connection and stored in buffer memory 20. In addition, processor 16 may assign a buffer associated with a virtual connection to a pool of buffers associated with other virtual connections. Thus, processor 16 may also place a limit on the maximum number of cells that may be contained in a buffer pool besides limiting the number of cells that may be contained in an individual buffer. 
     Processor 16 also maintains counters reflecting the number of cells in a particular buffer associated with a virtual connection. If multiple buffers are associated with a virtual connection, then processor 16 may maintain a counter for each of the multiple buffers. Processor 16 uses the buffer counters to monitor congestion and discard frames if congestion exceeds certain thresholds. 
     In this embodiment, processor 16 maintains two levels of priority for frames and two congestion thresholds corresponding to those levels of priority. Processor 16 could maintain a greater or a lesser number of priority levels without departing from the scope of the invention. In this example, lower priority frames are discarded after a lower threshold of congestion is encountered while higher priority frames are discarded after a higher level of congestion is encountered. 
     This embodiment uses the cell loss priority bit in the header of ATM cells making up a frame to determine the priority of a frame. When the cell loss priority bit has a value of zero, then the frame is considered to be a high priority frame. When the cell loss priority bit is set to one, then the frame is considered to be a low priority frame. This embodiment uses the cell loss priority bit of the first cell of the frame to make a determination of whether a frame should be discarded. Ordinarily, the cell loss priority bit of each cell in a frame will have the same value. Other header information could be used to indicate priority without departing from the scope of the invention. 
     To make efficient use of bandwidth, processor 16 checks for congestion at frame boundaries. If a cell has an end of frame indicator, then processor 16 checks to determine whether either the low congestion threshold or high congestion threshold has been exceeded. If the low congestion threshold has been exceeded, then a state variable is set to indicate that any subsequent frames having low priority (cell loss priority bit equals one) are to be discarded. If the high congestion threshold has been exceeded, then a state variable is set to indicate that any subsequent frame should be discarded. In either case, the end of frame cell is not discarded. If neither congestion threshold was exceeded at a frame boundary, then the state variables are set to a non-discard state so that the subsequent frame will not be discarded. 
     In this embodiment, only user data cells, which are not end of frame cells, are discarded. Due to their importance to system operation, other cells, such as OAM cells, are not discarded unless the pool space has been exceeded or an overrun condition is present as described below. Processor 16 determines whether or not a cell contains user data or other data using the payload type indicator for the cell. The payload type indicator appears in the header of the ATM cell. 
     If the check at the end of a frame reveals that the high congestion threshold has been exceeded, then all of the cells in the subsequent frame are discarded, with the exception of the end of frame cell, and processor 16 again determines the state of congestion at the end of the discarded frame. If it was determined at the end of a frame that the low congestion threshold has been exceeded and the cell loss priority bit of the first cell of the next frame is set to one, then all of the cells in that frame are discarded and processor 16 will again check the level of congestion at the end of the discarded frame. 
     Processor 16 may also discard portions of frames when congestion has become so critical that either a buffer overrun has occurred or the number of cells in a buffer pool has reached the pool limit associated with that buffer pool. 
     Processor 16 causes cells in discarded frames to be discarded before they are placed in buffer memory 20. This aspect of the invention allows easier manipulation of the queue pointers stored in queue pointer memory 18 as rearranging of the queues is unnecessary. 
     More detailed operation of the invention can best be understood by referring to FIG. 2. FIG. 2 illustrates a flow chart describing the method by which input processor 12 of FIG. 1 discards frames. The method illustrated in FIG. 2 employs two state variables to determine whether or not to discard frames. The first state variable, discard frame state, is set when the level of congestion has reached a point at which all frames should be discarded and cleared otherwise. The second state variable, discard CLP1 frame state, is set when the level of congestion is high enough to discard frames having a cell loss priority equal to one (low priority). This variable is cleared otherwise. 
     The method begins in step 22 with initialization. Initially, the state variables are cleared in step 22. In step 24, a cell is received. Then, in step 26 it is determined if the cell is user data or an end of frame cell, if the cell loss priority is equal to one, and if the discard CLP1 frame state is set. A cell is considered to be user data when its payload type indicator equals 0 or 2. A cell is considered to be an end of frame cell when its payload type indicator is equal to 1 or 3. The payload type indicator appears in the header of the ATM cell. If all of the conditions are met in step 26, then the current frame is to be discarded as it has a cell loss priority equal to 1, the level of congestion is sufficiently high to discard frames of that type, and the frame contains user data. Thus, the discard frame state variable is set in step 28. Following step 28 or if all the conditions were not met in step 26, the procedure continues in step 30. Note that step 26 depends upon the state of the discard CLP1 frame state variable which is only altered when processing an end of frame cell at the frame boundary. 
     In step 30, it is determined whether the cell has an end of frame marker. If not, then the process continues in step 44. If so, then a frame boundary has been reached and the congestion in the network should be examined. Accordingly, the process continues in step 32 where it is determined whether the buffer has reached the high congestion threshold. If so, then the discard frame state variable is set in step 42 and the procedure continues in step 44. If not, then the discard frame state variable is cleared in step 34 in case the variable was set for the previous frame. Then, in step 36, it is determined whether the buffer has reached the low congestion threshold. If not, then the discard CLP1 frame state variable is cleared in step 38 in case it had been set for the previous frame. If the low congestion threshold has been reached, then the discard CLP1 frame state variable is set in step 40. 
     Next, in step 44, it is determined whether the pool limit has been exceeded or a buffer overrun condition has occurred. In this embodiment, several virtual connections may share a buffer pool. If the limit of this buffer pool is exceeded, then the current cell should be discarded immediately in step 46 as there is no place to put the cell. Similarly, if a buffer overrun has occurred, the cell should also be discarded in step 46 even though such a discard may occur in the middle of a frame. After step 46, the process continues in step 48 where it is determined if the cell is user data or an end of frame cell. If not, then the procedure returns to step 24 to receive the next cell. If so, then the discard frame state is set in step 50. Setting the discard frame state in step 50 will cause the rest of the frame from which the cell was discarded in step 46 to also be discarded. Because one cell of the frame was already discarded, the rest should also be discarded to avoid wasting bandwidth. As above, the end of frame cell will still be sent if the buffer overrun condition or pool limit overrun condition is no longer present when the end of frame cell is received. 
     Returning to step 44 if neither condition was met, then the procedure continues in step 52. In step 52 it is determined whether the discard frame state variable is set and whether the current cell contains user data. If not, then the procedure returns to step 24 to process the next cell. If so, then the current cell is discarded in step 54 and the procedure then loops back to step 24. 
     The process in FIG. 2 thus checks for congestion at frame boundaries as each end of frame cell is received. If the level of congestion exceeds the predetermined threshold appropriate for the following frame, then the cells of the following frame with the exception of the end of frame cell are discarded. This process thus utilizes network bandwidth more efficiently and allows prioritized discarding of frames. 
     Although the present invention has been described in detail, it should be understood that various changes, substitutions, and alterations can be made hereto without departing from the spirit and scope of the invention as defined by the appended claims.