Abstract:
In an ATM switch, an input port number, an input VPI and an input VCI are used to generate a header appended to the cell when the cell is transmitted. The input port number and the input VPI are combined to form a pointer to a look-up table (LUT). The LUT entry contains a first portion of a pointer to an Input Translation Table (ITT). An ITT entry provides sufficient information to generate the header. The LUT entry contains also some or all of the bits of a mask to be applied to the input VCI to obtain a second portion of the pointer to the ITT. The number of the mask bits is variable. All the mask bits are 1. The mask bits are separated from the first portion of the ITT pointer by a 0 bit.

Description:
BACKGROUND OF THE INVENTION 
     The present invention relates to electronic devices, and more particularly to two-way translation performed by electronic devices and to cell routing in ATM (Asynchronous Transfer Mode) networks. 
     A cell in an ATM network has a header that includes a Virtual Path Identifier (VPI) and a Virtual Circuit Identifier (VCI). See O. Kyas, &#34;ATM Networks&#34; (1995). An ATM switch determines the VPI and/or the VCI of the incoming cell, inserts new VPI and/or VCI values into the cell&#39;s header, and retransmits the cell. 
     It is desirable to provide fast and simple apparatus and methods for determining the new VPI and VCI. 
     SUMMARY 
     The present invention provides in some embodiments fast and simple apparatus and methods for determining the new VPI and VCI. 
     In some embodiments, two-way translation is used to translate the input VPI and VCI to the new VPI and VCI. More particularly, the input VPI and the input port number are combined to form a pointer to a look-up table (LUT). The entry in the LUT includes information which is combined with the input VCI to get a second pointer. The second pointer points to another table (Input Translation Table or ITT), which stores information allowing to obtain the new VPI and VCI. 
     In the ITT, entries corresponding to the same input VPI and the same input port number but to different input VCI&#39;s are stored as a block of entries adjacent to one another. If due to an error an input VCI is too large, the pointer to the ITT could point to an entry designed for a different combination of an input VPI and an input port number. To prevent the traffic from being affected by such errors, the switch should check that the VCI used to construct a pointer to the ITT is within a certain high bound. 
     The high bound can be stored in the LUT. Storing the high bound should be efficient not to waste the LUT space. If, for example, a predetermined number of bits are allocated for the high bound in every LUT entry, bits can be wasted if the high bound is small and needs fewer bits than are allocated. Therefore, in some embodiments of the invention, a variable number of bits are allocated for the high bound in the LUT entry. Moreover, to further reduce the number of bits allocated, the LUT entry does not store the high bound but rather stores bits of a VCI mask. The VCI mask is applied to the input VCI to test whether the VCI exceeds the high bound. 
     More particularly, in some embodiments, a LUT entry includes a string of zero or more 1&#39;s, followed by a 0 delimiter bit, which is followed by the most significant bits of the ITT pointer. This string of 1&#39;s is a mask field. In some embodiments, the mask field is augmented by two 1&#39;s, or by some other number of 1&#39;s. The mask is inverted and then ANDed with the input VCI. If the result of the AND operation is not zero, the input VCI is too large, and the cell is discarded. The inverter and the AND circuit that perform bound checking operations described above are fast and simple. 
     The ITT pointer is generated by means of ORing the input VCI with the most significant bits provided by the LUT entry. The OR circuit that generates the ITT pointer is also fast and simple. 
     Other features and advantages of the invention are described below. The invention is defined by the appended claims. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a block diagram illustrating data structures and circuitry for translating an input VPI, an input VCI and an input port number to an output VPI and an output VCI according to the present invention. 
     FIG. 2 diagrams an Input Translation Table (ITT) and a pointer to the ITT for the system of FIG. 1. 
     FIG. 3 is a detailed diagram of some data structures and circuitry of FIG. 1. 
     FIG. 4 diagrams a table entry for the system of FIG. 1. 
     FIG. 5 is a block diagram of an ATM switch according to the present invention. 
     FIG. 6 is a timing diagram for the switch of FIG. 5. 
     FIG. 7 diagrams a table entry for the system of FIG. 1. 
     FIG. 8 diagrams two tables of the system of FIG. 1 to illustrate a procedure for changing one of these tables. 
    
    
     DESCRIPTION OF PREFERRED EMBODIMENTS 
     Embodiments described below are illustrative and do not limit the invention. The invention is defined by the appended claims. 
     FIG. 1 illustrates address translation performed by an ATM switch to route an ATM cell. The switch has 32 ports (not shown) each of which is identified by a port number 110. A cell received on such a port includes a header that includes a Virtual Path Identifier (VPI) 114 and a Virtual Channel Identifier (VCI) 120. VCI 120 is also shown as VCIin in FIG. 1. Using the cell&#39;s input port number 110, VPI 114 and VCI 120, the switch locates an entry 130 in Output Translation Table (OTT) 140. Entry 130 specifies an output port on which the cell is to be transmitted. Entry 130 also specifies the VPI and VCI to be inserted into the cell&#39;s header transmitted with the cell. 
     In the embodiment of FIG. 1, input port number 110 occupies 5 bits, and VPI 114 occupies 8 bits. VCI 120 occupies 16 bits. However, the VCI values are sufficiently small to fit into 14 bits. (The VCI values in the incoming cells are set by the switch itself and are transmitted to upstream switches for insertion into the cell&#39;s headers). Therefore, the most significant bits  15:14! of VCIin are 0. 
     As shown in FIG. 1, the switch concatenates input port number 110 and input VPI 114 to obtain 13-bit LUT pointer 150. Pointer 150 identifies an entry 160 in look-up table (LUT) 170. LUT 170 is stored in the switch memory. 
     Subtractor 180 subtracts 32 from VCIin 13:0! and generates the signal VCIin-32. Multiplexer 190 selects VCIin 13:0! or bits  13:0! of VCIin-32 under the control of a CT field in LUT entry 160. The CT field is described below. The 14-bit output VCIin1 of multiplexer 190 is delivered to circuit 200. Circuit 200 receives also information from LUT entry 160 and generates a 15-bit ITT pointer 204. Pointer 204 points to an entry 220 in Input Translation Table (ITT) 210. ITT 210 is stored in the switch memory. 
     ITT entry 220 includes a pointer (&#34;OPT pointer&#34;) 224 to an entry 230 in Output Pointer Table (OPT) 240. Entry 230 is a pointer to OTT entry 130. 
     Before the subtractor 180 subtracts 32, a circuit (not shown) determines if VCIin 13:5!=0. If VCIin 13:5! is zero, then VCIin≦31. In this case, if the CT signal selects VCIin-32 (that is, if the CT signal value is &#34;01&#34; as described below), the cell is not transmitted to the network. 
     In the embodiment of FIG. 1, LUT 170 has a capacity to hold 8K entries of 16 bits each; ITT 210 has a capacity to hold 32K entries of 32 bits each; OPT 240 has a capacity to hold 32K entries of 16 bits each; OTT 140 has a capacity to hold 64K entries of 32 bits each. Other capacities and entry lengths are used in other embodiments. 
     In some embodiments, OPT 240 is omitted; ITT entry 220 includes a pointer to entry 130. In some embodiments, ITT 210 and OPT 240 are omitted; pointer 204 points directly to entry 130. 
     FIG. 2 illustrates a block 244 of ITT entries 220 corresponding to the same input port number 110 and the same VPI 114, and hence to the same LUT entry 160. Different entries correspond to different VCIin values 120. Pointer 204 points to an entry 220.k corresponding to VCIin=k. Pointer 204 includes a field 250 determined by LUT entry 160. This field is called &#34;ITT base address MSBs&#34;. Pointer 204 includes also a field 260 obtained from VCIin 120. Field 250 includes the most significant bits (MSBs) of pointer 204. Field 260 includes the least significant bits. 
     In order not to waste space in 15-bit pointers 204 and in LUT entries storing the pointers&#39; MSBs, the fields 250, 260 have variable sizes determined by entry 160. See FIG. 3. 16-bit entry 160 includes a 2-bit field CT described above in connection with FIG. 1. Entry 160 includes also ITT base address MSBs 250 in bits  13:n+1! where n is a number in the range from 0 to 12 inclusive. Bits  n-1:0!, shown at 310, are all 1&#39;s. These bits, together with two implied 1&#39;s shown at 320, form a VCI mask used to check if VCIin is too large. If VCIin is too large, the cell is discarded. Bits 310 are also used to define the size of field 250 and, therefore, of field 260. If n=0, field 310 is empty, and the VCI mask includes only two 1&#39;s, which are the implied 1&#39;s 320. Field 320 is not stored in the switch. 
     Bit  n! is 0. This bit is a delimiter marking the start of mask field 310. 
     ITT pointer generation circuit 200 (FIG. 1) reads entry 160 and shifts the read out entry right until the delimiter bit 0 is shifted out. At this point, the number &#34;n&#34; is known to circuit 200. Circuit 200 shifts the ITT base address MSBs 250 back by n+2 bits, into the most significant bits of 15-bit signal 330. The n+2 LSBs of signal 330 are 0. 
     Circuit 200 appends the two implied 1&#39;s to field 310 and places the resulting string of 1&#39;s into the LSBs of 16-bit mask 340. The remaining bits of mask 340 are 0. 
     Inverter 344 inverts the mask. AND circuit 350 performs a bitwise AND operation ANDing the bits of the inverted mask and the respective bits of signal VCIin2. Signal VCIin2 is obtained from VCIin1 by appending VCIin 15:14! at the most significant bit positions. Circuit 354 compares the output of AND circuit 350 with zero. If the output is zero, VCIin is greater than the high bound defined by mask field 310. This is an error condition. The cell is discarded. 
     In parallel with circuits 344, 350, and 354, OR circuit 370 bitwise-ORs 14 LSBs of signal 330 with VCIin1. The output of circuit 370 is 14 LSBs of ITT pointer 204. The MSB of signal 330 is the MSB of 15-bit pointer 204. 
     Circuits 344, 350, 354 and 370 are part of circuit 200. 
     Field CT (connection type) in LUT entry 160 has the following meaning: 
     &#34;00&#34; means an invalid entry. 
     &#34;01&#34; means Virtual Circuit Connection with VCIin1=VCIin-32. This CT value can be used to save addressing space where the VCI values from 0 to 31 are reserved for special functions. In such connections, cells with VCIin values from 0 to 31 are not transmitted to the network. 
     &#34;10&#34; means Virtual Circuit Connection with VCIin1=VCIin. 
     &#34;11&#34; means Virtual Path Connection. In this case, the remaining 14 bits of LUT entry 160 provide the ITT base address as shown in FIG. 4. This address is the value of pointer 204; field 260 (FIG. 2) is empty. Due to the size of pointer 204, ITT entries for VP connections reside in the lower 16K entry positions of ITT 210. 
     As is clear from FIG. 3, for VC connections the mask field 310 defines a high bound for VCIin1. This high bound is 2 n+2  -1. Mask field 310 also defines a high bound for VCIin 120. This high bound is 2 n+2  -1 or 2 n+2  +31, depending on the CT value. The high bound is stored in n+1 bits (including the delimiter bit). Therefore, the smaller the high bound value, the fewer bits are used to define the high bound. Hence, memory is not wasted to store small high bounds. 
     As is clear from FIG. 2, block 244 of ITT entries corresponding to a given VPI and a given input port number starts on a 2 n+2  entry boundary. If VCIin1 exceeds its high bound, the cell is discarded as described above. The switch is therefore made safer against errors. At the same time, generating the pointer 204 is fast and simple. 
     In some embodiments, input port number 110 is not used to form LUT pointer 150. 
     FIG. 5 is a block diagram of a switch 410 operating in accordance with FIGS. 1-3. Switch controller 420 performs the address translation illustrated in FIGS. 1 and 3. ITT pointer generation circuit 200 (FIG. 1) is part of controller 420. 16-bit wide memory 430 connected to controller 420 stores LUT 170 and OPT 240. The same address, data and memory control lines are used to access LUT 170 and OPT 240. 32-bit wide memory 440 connected to controller 420 stores ITT 210 and OTT 140. The same address, data and memory control lines are used to access ITT 210 and OTT 140. 
     Controller 420 is connected to 32 full-duplex ports 450, each of which is identified by a 5-bit number such as number 110 (FIG. 1). CPU 460 connected to controller 420 is responsible for initialization, connection setup and statistics gathering. Switch 410 is described, for example, in ATMS2000 User&#39;s Guide, Issue 1.1 (MMC Networks, Inc. of Santa Clara, Calif., January 1996) incorporated herein by reference. See also &#34;ATMS2004B Switch Controller 2 &#39;GRAY&#39;&#34;, Issue 1.0, (MMC Networks, Inc. 1995, Document MMC 95-0004 (incorporated herein by reference) and &#34;ATMS2003B Switch Controller 1 &#39;WHITE&#39;&#34; (Issue 1.0, MMC Networks, Inc. 1995, Document MMC 95-0003 (incorporated herein by reference)). Switch 410 is based on the ATMS2000 chip set available from MMC Networks, Inc. 
     FIG. 6 is a timing diagram of one cycle of switch 410. The switch cycle consists of 68 clock cycles. The first 32 clock cycles, 0-31, form phase 1 of the switch cycle. During each of clock cycles 0-31, switch controller 420 reads LUT 170 for a corresponding one of ports 450. During the next clock cycle, controller 420 reads an ITT entry for the same port, and at the same time, reads a LUT entry for the next port. 
     During the CPU phase, controller 420 communicates with CPU 460. 
     During each clock cycle of phase 2, controller 420 reads OPT 240 for a corresponding one of ports 450. During the next clock cycle, controller 420: 1) reads OTT entries 140 for the same port, and 2) reads OPT 240 for the next port. See &#34;ATMS2000 User&#39;s Guide&#34;, cited above, for more detail. 
     FIG. 7 illustrates the format of OTT entry 130. For a point-to-point connection, pointer 230 points to a single entry 130; for a multicast connection, pointer 230 points to a block of entries 130 such as block 810 in FIG. 8. Entries 130 in the block immediately follow one another. 
     The meaning of the bits in FIG. 7 is as follows. 
     P, Connection Type,  31! 
     &#34;0&#34; means VC Connection. 
     &#34;1&#34; means VP Connection. 
     This field should match the connection type CT in the corresponding LUT entry 160. 
     L, Next to Last,  30! 
     This bit is used to signify that the next entry in the OTT corresponds to the last port in the multicast chain. For a point-to-point connection, L is &#34;don&#39;t care.&#34; 
     &#34;0&#34; means the next OTT entry is NOT the last entry. 
     &#34;1&#34; means the next OTT entry IS the last entry in the chain. 
     Next Port,  28:24! 
     This indicates the output port, which is one of ports 450, to be used for the next entry in the multicast chain. The port for the first entry is specified by the Queue field (not shown) of ITT entry 220. 
     VPI,  23:16! 
     VPI value to be used when this cells is transmitted. 
     VCI,  15:0! 
     VCI value to be used when this cell is transmitted, if this is a VC connection. For a VP connection, the cell is transmitted with VCI=VCIin. 
     T, Tag Marker,  29! 
     This bit is explained in the aforementioned &#34;ATMS2004B Switch Controller 2 &#39;GRAY&#39;&#34;. 
     Common Memory 480 (FIG. 5) connected to switch controller 420 stores cell data (48 bytes per cell) and cell attributes. The attributes are described in the aforementioned documents &#34;ATMS2000 User&#39;s Guide&#34; (at page 13) and &#34;ATMS2004B Switch Controller 2 &#39;GRAY&#39;&#34; (pages 12-13, under &#34;Attributes Table, ATT&#34;). One of the attributes is the value of OPT pointer 224 (FIG. 1) to OPT entry 230. 
     Switch 410 may receive a request to expand a block 810 (FIG. 8) of entries 130 corresponding to a given pointer 230, or to reduce the size of block 810, or to change the entries 130 in the block. To avoid race conditions, switch 410 sets up a different block 820 of new OTT entries while OPT entry 230 continues to point to block 810. When block 820 is set up, the address of block 820 is written to pointer 230. Since the cells in common memory 480 are dispatched based on the OPT pointer 224 to entry 230, the cells will be dispatched in accordance with block 820 even if they were written in memory 480 when the pointer 230 pointed to block 810. 
     The invention is not limited by the embodiments described above. In particular, the invention is not limited by the memory sizes, the number of ports, the length and number of clock cycles, or the length of the VPI, the VCI or any other fields. In some embodiments, the VPI fields are 12 bits long and the VCI fields are 16 bits long. In some embodiments, the implied field 320 is omitted, and the LUT entry stores the entire VCI mask. In some embodiments, the number of bits in the implied field is other than two. Other embodiments and variations are within scope of the invention, as defined by the appended claims.