A communications device

Abstract: A communications device, particularly but not exclusively for use with a routing circuit is arranged to transmit and receive message packets. It comprises an output buffer (42) which operates to convert data and flow control information into a plurality of bit sequences and to transmit them at a predetermined frequency. An input buffer is operable to decode incoming sequences into data items and flow control information. The input buffer (44) can store the data items and count them and transmit flow control information to the output buffer. A method of encoding the bit sequences as balanced six-bit codes is also described.

Description: This invention relates to a communications device for use in message routing, particularly routing messages in a computer network, and to a routing switch having such a communications device. It is frequently desired to connect processing devices such as microcomputers in a network so that one microcomputer can communicate with others in the network. In such networks it is unduly restrictive if a microcomputer can communication only with its immediate neighbours, i.e. those devices hardwired to it. It is currently known for microcomputers in a network to be capable of executing a process whose function is to route messages through the network. That is, the process would receive a message and execute an instruction the effect of which would be to pass the message to the appropriate neighbouring microcomputer where it might be required to repeat the procedure. This is costly both in terms of process execution time on the microcomputer and in terms of the work required to allocate processes of a program to different microcomputers in a particular network architecture. Message routing devices of various kinds are known. Some are specific to a particular network architecture while others operate by providing switched channels between processing devices connected to the routing device. In many networks, routing devices each input a packet, determine its destination, and then forward the packet to the next device. This is undesirable because it requires storage in each device for transmitted packets and it causes potentially long delays between the output of a packet and its reception. To date, there is not available a flexible, fast and efficient routing device for routing messages in a network. Reference is made to an article entitled "Hop-by-Hop Flow Control on Unreliable Connections", IEEE International Conference on Communications, '87, Communications-Sound to Light, Volume 3, 7-10 July 1987, Seattle, pages 1683-1687. This discusses flow control in segments of a virtual circuit through a computer network. US 4,740,958 describes a data transmission system with a plurality of processing nodes. The aim is to ensure that buffers within the processing nodes do not overflow and to achieve this a system of acknowledgement signals is adopted. The nodes are interconnected by a bundle of six optical fibres, each fibre carrying a Manchester encoded signal. Five of the fibres carry a data digit consisting of four data bits and an associated parity bit. The sixth fibre carries an acknowledgement signal in the reverse direction. The acknowledgement signal is used to control counters which keep a count of messages waiting in the receive buffer for a particular channel. This system requires a dedicated fibre for the acknowledge signal. US 4,380,063 describes a flow control mechanism for block switching nodes. This avoids buffer overflow by each node including a counter for holding an indication of the available buffer capacity at the other end of each outgoing link. Whenever a message is read out of a buffer, a token or acknowledgement signal is sent back over the link and this is used to update the counter to indicate that the available buffer capacity has increased. Tokens are transmitted over dedicated token lines which are thus required as extra interconnections between the nodes. It is an aim of the present invention to provide a flow control system which utilises the links between nodes available for normal message transmission, thereby simplifying the connectivity in a routing network. The present invention is concerned particularly, but not exclusively, with networks of intercommunicating microcomputers with other devices. It is particularly applicable to the communication between devices which are coupled by pairs of unidirectional communication lines along which serial bit packets of one or more formats are transmitted. According to the present invention there is provided a communications device for transmitting and receiving messages and comprising input circuitry having storage means for storing data and a receiving input for receiving input data, a counter for counting the amount of data stored in the storage means, and output circuitry transmitting a flow control code from an output thereof when there is sufficient storage capacity in the storage means for a predetermined amount of data; said output circuitry having a data input for receiving a first stream of data and a flow control request input for receiving flow control information; the input circuitry being coupled to the output circuitry to supply said flow control information via the flow control request input; characterised in that said output circuitry is effective to convert said data of the first stream and said flow control information into a plurality of outgoing codes each of a predetermined bit length and to transmit said outgoing codes as an output stream from said output, said codes being selected from a group of codes, a set of which are designated as data codes and one of which, not in said set, is designated as said flow control code; and in that said input data is in the form of a stream of incoming codes and the input circuitry is effective to decode incoming codes of the input stream into data items stored by said storage circuitry and said flow control information, whereby the output circuitry is caused to transmit said flow control code in said output stream when there is said sufficient storage capacity in the storage means. The invention also provides a communications device providing the combination of input and output circuitry defined above. The codes are bit sequences which can be transmitted serially or in parallel. Serial transmission is mainly discussed herein. Thus, in the present invention one particular serial bit packet (referred to hereinafter as the flow control token) is transmitted on one communication line to control the quantity of other serial bit packets transmitted along the other communications line. It is particularly, but not exclusively, applicable to the communication between devices which transmit sequences of bytes of data as sequences of serial bit packets followed by a particular serial bit packet which is an end of sequence marker. It is particularly applicable to the communication between more than two devices which transmit sequences of bytes of data as sequences of serial bit packets in which the first one or several bytes of each sequence is the header portion. Such communication systems are described in our British Patent Application No. 8915136.9 (Page White & Farrer Ref: 64199). Reference is made to European Application No. 90307110.8, from which the present application is divided. In that application a method of routing messages is described in which the reading of a header portion is carried out prior to receipt of the whole of a packet with subsequent transmittal of the message portion through a routing switch. This is termed herein "wormhole routing". It has the considerable advantage over known routing techniques that in the preferred embodiment buffer space is needed only for the header portion and not for the complete packet. That application also describes the selection of an output of a routing switch for a range of destination node identifications, termed herein "interval labelling". The communications device of the present invention can be provided at each routing switch in a routing network intended to route messages between a first computer device at the source node and a second computer device at the destination node in which each packet output by the source node is acknowledged by the destination node when that packet is received thereby. To this end the packet generating circuitry of the computer devices is capable of generating an acknowledgement packet on receipt of a data packet. In this regard reference is made to our British Application No. 8915136.9 (Page White & Farrer Ref.: 64199), which describes computer devices for forming computer networks to which this invention is particularly applicable. The data packets and acknowledgement packets form the basis of synchronised process to process communication between processes executed by processors on remote computer devices. By synchronised process to process communication is meant that the communicating processes are at corresponding program stages when message transmission is effected. A message could comprise a plurality of the aforementioned data packets. The invention also provides a method for transmitting a plurality of bit sequences from a first communications device to a second communications device, the bit sequences each having the same number of bits and constituting a group, the method comprising: designating one of said group of bit sequences as a flow control code and others of said group of bit sequences as data items; and at the second communications device, counting the number of data items transmitted from the first communications device and stored at the second communications device and, when there is capacity at the second communications device for a predetermined number of data items transmitting said flow control code from the second communications device to the first communications device to authorize transmission of said predetermined number of data items to the second communications device. In the preferred encoding format, each bit sequence is six bits long, each sequence containing three ones and three zeros, sixteen combinations of which are taken to represent different values of four bits of data, one combination is used to represent the end of message packets and one combination is used to control the flow of data codes and end of packet codes in the opposite direction. According to another aspect of the invention there is provided a method of encoding data for transmitting messages through a plurality of routing devices in bit sequences in which method the bit sequences are selected from a finite set of twenty bit sequences, each bit sequence having six bits comprising three ones and three zeros, wherein a first subset of said finite set consisting of sixteen bit sequences is designated for use as data codes and a second subset of said finite set is designated for use as control codes for controlling transmission of said data codes, said second subset consisting of four bit sequences which do not form part of said first subset, wherein a first one of said control codes is designated as a flow control code for controlling the quantity of data codes transmitted between a source device and a destination device; a second one of said control codes is designated as a null code for maintaining continuous transmission when there is no data code to be transmitted; and a third one of said control codes is designated as an end of packet code which identifies the end of a packet including with said end of packet code at least one data code. For a better understanding of the present invention and to show how the same may be carried into effect, reference will now be made, by way of example, to the accompanying drawings, in which:- Figure 1 is a block diagram of a routing switch; Figure 2 is a block diagram of a communications device of the routing switch; Figure 3 is a block diagram of the header portion buffer of the routing switch; Figure 4 is a block diagram of the header reading cicuitry of the routing switch; Figure 5 is a block diagram of the random header generator; Figure 6 is a block diagram of the header deletion circuitry; Figure 7 represents part of the switching circuitry of the routing switch; Figure 8 shows the flow of data through part of the switching circuitry; Figure 9 shows the external connections to one of the switch elements of the switch circuitry; Figure 10 is a block diagram of the structure of a switch element; Figure 11 is an example of a grid computer network; Figure 1 shows the basic constructional features of a routing switch 1 incorporating a communications device in accordance with a preferred embodiment of the invention. In Figure 1, heavy arrows designate data paths while lighter arrows indicate instruction paths. The routing switch includes switch circuitry in the form of a crossbar switch 10 in which any one of a plurality of message inputs 12a .... 12n can be connected to any one of a plurality of message outputs 14a .... 14n. In the preferred embodiment there are 32 inputs and 32 outputs, paired to form 32 message links. The crossbar switch has output link arbitration circuitry 32 which prevents more than one input being connected to each output at any one time. For the sake of clarity only two links are shown, designated La, Ln, indicated by a broken line surrounding the components of the link. The following description relates to link La, but all the other links are identical subject to the possible sharing of some of their components as discussed later. The link La includes a communications device referred to herein as a link module 18 which serves to connect the routing switch to another similar routing switch or to any other device and arranged for receiving and sending message packets to and from the routing switch. This connection is achieved by a bidirectional pair of unidirectional channels 4a, 6a. Each message packet is in a serial data format and includes a header identifying the destination node of the packet. A destination or source node in a computer network is generally but not always a computer device capable of executing processes. Serial Data Format A particularly suitable serial data format for the link modules is clock-with-data encoding. By sending three zero bits and three one bits in each six-bit period, DC-balance is preserved, and the clock signal can be extracted using a phase-locked loop. This technique is called 3-out-of-6 coding. There are 20 distinct 3-out-of-6 codes. In order to transmit bytes of data efficiently, 16 of these codes are assigned to represent the different possible values of a nibble (4 bits). Thus a byte can be sent in two codes. Where transmission must be continuous (for example in a phase-locked loop system), it is necessary to have a single null code which is transmitted when no other code can be transmitted. If a message packet is sent directly from a source device to a destination device it is not necessary for the length of the packet to be represented within the packet; it is only necessary to ensure that the source device and destination device agree on the length. However, where packets pass through routing switches, it must be possible for these routing switches to determine the length of the packet passing through so that the (temporarily connected) route through the switch circuitry 10 can be disconnected as the end of the packet is output. Unless every packet is the same length, this requires that the protocol provides an indication of the packet length, either by a termination marker or an initial length count. The introduction of an initial length count increases the packet delay through the routing switch and also requires logic to count through the packet. A better technique is therefore to reserve a control token as the end-of-packet marker. The complete protocol for a 3-out-of-6 coding system is therefore as shown in the following table. Exactly which bit-patterns correspond to which tokens is entirely arbitrary, and so is not shown. 16 data values 1 flow-control token (FCT) 1 end-of-packet token (EOP) 1 null token (NULL) 1 unassigned It will be appreciated that the 3-out-of-6 coding scheme is only one of many that could be used, provided that the requirements above for an end-of-packet and a "flow-control token" (discussed later) are met. In particular it will be appreciated that there is no necessity for the control codes to have the same format or length as encoded data values, nor for data to be transmitted as a series of four-bit values, provided that a stream of bytes can be transmitted efficiently. The link module is connected to a header buffer 20 by an input data path 36 and an output instruction path 34. The link module is also connected to a header stripper 28 by an output data path 40 and an input instruction path 38. The header buffer 20 can communicate with header reading circuitry in the form of an interval selector 22 via Discard and Select paths 21, 61, and is permanently connected to the interval selector 22 via a Header connection 23. The interval selector 22 reads the header portion of an incoming packet, determines therefrom the output of the switch circuit 10 to which the message should be directed and sets the switch circuitry 10 accordingly. To this end, an instruction Address path 26 permits the interval selector 22 to communicate with the switch circuitry 10. The switch circuitry can transmit instructions to the header buffer via path 19. The header buffer 20 can also communicate with a random header generator 24 via Request and Header paths 25, 27 for a purpose which will be described hereinafter. A message packet is output from the switch via the header stripper 28, the purpose of which will also be described hereinafter. The header stripper via paths 29, 31, 7. Reference numeral 30 designates initialisation circuitry used to set up the routing switch for operation. The operation of each component of the routing switch will now be described. It will be appreciated that the necessity to transmit a packet header before each block of data reduces the effective time available for the transmission of data and hence reduces the effective data bandwidth. Thus it is desirable to make the packet headers as short as possible. However it is also desirable to be able to specify any one of a large number of terminal links of a network in the case that a large network is required. To this end the present invention allows for the size of packet headers to be varied, so that they may be sufficiently large to allow all the terminal links of a large network to be specified, or in the case of a small network may be made smaller to reduce the diminuation of the effective data bandwidth. In the preferred embodiment each routing device contains a flag which determines whether packet headers are one or two bytes in length. One byte is the shortest size of header which does not disturb the view of packets as consisting of a sequence of bytes, and two bytes is sufficient to enable 65,536 terminal links to be distinguished. Link modules and their flow-control mechanism. Each link module 18 accepts requests for data from the header buffer 20 along path 34, and subsequently supplies data along path 36. It also makes requests for data from the header stripper 28 along path 38 and subsequently receives data along path 40. It is important that flow control is maintained between the routing switch and a device connected thereto by the link module. To do this the link module 18 multiplexes flow-control information into data streams between the routing switch and a device connected thereto. To do this without consuming too much of the bandwidth, in order to maximise the rate of transmission of data, the link modules control the flow of data items in batches rather than individually. To this end each link module includes a buffer large enough to hold a complete batch of data items, and is capable of counting how many data items remain both to be sent and to be received. A simple way to regulate the flow of batches of data is to reserve as a flow-control token a particular code from the set of codes which the link module 18 may transmit and receive. A flow-control token is transmitted whenever the link module 18 of the routing switch has sufficient buffer space for an entire batch of data. The link modules regulate the flow of data items without regard to the packets which they may constitute. At any instant, the data items buffered by a link module may form part or all of one or more consecutive packets. Referring now to Figure 2, each link module comprises: an output buffer 42 which converts data items and flow-control information into a serial format used for transmission, and transmits them at a frequency determined by a clock signal o; and an input buffer 44, which decodes the serial format into data items, which it stores, and flow-control information, which it transmits to the output buffer 42. The unit of flow control is a flow control batch. Each batch of data consists of a plurality of codes, where each code represents either four bits of data or is an end-of-packet code. For example, the flow control batch could consist of sixteen codes. Each link module connected to a separate device which has its own link module or similar communicating device maintains a count of the number of data items that it may send to the other link module without receiving any further flow-control information. This count is called the credit. Each link of a connected pair of link modules maintains a count of the number of data items that it may be sent by the other link module without sending any further flow-control information. This count is called the debit. Each link of a connected pair of link modules indicates that it is prepared to receive another batch of data items by sending a flow-control token. When it does so it increases its debit by the number of data items in a batch. When the other link of the pair receives the flow-control token it increases its credit by the number of data items in a batch. The flow-control mechanism of the link modules will now be explained with reference to Figure 2, and assuming a serial data format similar to that described above. It will be appreciated, however, that the flow-control mechanism would work in essentially the same way if a different data format were used, or indeed if data items were sent using parallel signals rather than in a serial format. Whenever the input buffer 44 receives on channel 4 and decodes a flow-control token it signals the output buffer on the path 41 called fct.seen. Whenever the output buffer receives a signal on the path 41 fct.seen it increments its count of the number of codes still to be transmitted (its credit), by the size of the flow-control batch. The input buffer 44 maintains a count of the number of codes to be received before the credit of the connected link module of the separate device is exhausted. This count should be the same as the corresponding credit in the output buffer of the connected link module of the separate device connected to the routing switch, apart from discrepancies caused by codes in transit between the two link modules. The input buffer 44 contains a first-in, first-out buffer (FIFO) which can buffer at least as many codes as are contained in a flow-control batch. Codes other than null codes and flow-control tokens are stored in the buffer, and a count is maintained of the number of codes in the buffer. When a signal is received on the path 34 called request.in the input buffer 44 removes the first element from the FIFO and sends it on the path 36 called data.out, and decrements the count of the number of codes stored in the FIFO, unless there are no codes in the FIFO, in which case it sends the first code it receives, other than null codes and flow-control tokens, directly on the path data.out. Whenever the sum of the number of codes in the input buffer 44 and the number of codes to be received before the current flow-control batch is exhausted (the debit) is less than the difference between the size of the buffer and the size of a flow-control batch, the input buffer 44 signals the output buffer 42 on the path 43 called send.fct. The output buffer then sends a flow-control token at the first opportunity. It will be appreciated that if the size of the input buffer FIFO is exactly equal to the size of the flow-control batch, the input buffer will signal the output buffer to send a flow-control token only when the input buffer FIFO is completely empty and the current flow-control batch is completely exhausted. For this reason it is advantageous to make the input buffer FIFO somewhat larger in capacity than the size of the flow-control batch, in order that the flow of data does not stall. There now follow descriptions of the input and output buffers in the OCCAM 2 language. In these descriptions codes are represented by bytes, and signals are represented by channels carrying boolean values only. The OCCAM language is described in The OCCAM 2 Reference Manual, which is hereby incorporated by reference. In OCCAM 2, the link module 18 is represented by the parallel composition of the input and output buffers 44, 42. The paths leaving and entering the module are assumed to be defined in a wider scope. Then the link module is represented by: CHAN OF BOOL fct.seen, send.fct, fct.sent: PAR OutputBuffer (clock.in, codes.out, data.in, request.out, fct.seen, send.fct, fct.sent) InputBuffer (codes.in, data.out, request.in, fct.seen, send.fct, fct.sent) The input buffer is described by the piece of OCCAM given in Annex 1 and 1A. The FIFO is here implemented as a circular buffer with a capacity of input.buffer.size, with two pointers into it ('first' and 'last'). This would correspond to the use of a small piece of random access memory in the input buffer itself. It will be appreciated that other techniques could be used to implement the FIFO without affecting the flow-control mechanism of the link modules. The input buffer size must be at least as great as the flow control batch size. If the flow-control batch size were 16, the input buffer size would have to be at least 16, and for smooth flow of data it might be somewhat larger, for example 20. The output buffer also contains a short FIFO to smooth the flow of data. There is no restriction on the size of this FIFO imposed by the flow-control mechanism. The output buffer requests data to send by signalling on the path 38 request.out whenever it has space to buffer a code. At any time thereafter it may receive a code to be transmitted on the path 40 data.in. The output buffer maintains a count of the number of codes still to be transmitted before the current flow-control batch is exhausted. Every time it transmits a code other than a null code or a flow-control token it decreases this count by one. The output buffer is represented by the piece of OCCAM given in Annex 2. It contains a FIFO with capacity output.buffer.size, which might be for example 3. This piece of OCCAM (Annex 2) illustrates an alternative implementation of the FIFO, as a linear array whose contents are successively moved down whenever a code is removed from the bottom. It will be appreciated that a similar implementation could have been used for the input buffer, or that the circular buffer implementation used in the input buffer could have been used in the output buffer. It will be appreciated that an equivalent degree of flow-control could be obtained in an alternative system in which the output buffer initialises its 'credit' to the size of a flow-control batch and the input buffer initialises its 'tokens outstanding' to the same value, instead of both being initialised to zero as shown here. In that case a flow control token would only be sent after the first flow-control batch had been transmitted, instead of before, as in the description above. There follows a description of the other components of the routing switch of Figure 1 for the sake of completeness. The Header Buffer The structure of the header buffer 20 of each link La .... Ln is illustrated in Figure 3. The header buffer is controlled by control logic designated generally by block 51. There is a token buffer 50, which can hold one token, which can either be a nibble of data or an end-of-packet token. This token buffer 50 signals when it has received a token along the path 36 which is an end-of-packet token on the wire marked Got.EOP, and signals on the wire marked Got.token.b whenever it receives any other token. It transmits its contents to a switch 52 when it receives a signal from the control logic 51 on Send.t. The switch is controlled by the control logic 51 so that when a signal Set.sl is high the switch 52 transmits its input to a multiplexor 54. When the signal Set.sl is low the switch 52 transmits its input to an output multiplexor 56. The multiplexors 54, 56 are controlled by signals Set.m2 and Set.m1 from the control logic 51. The header buffer 20 also includes a first-in-first-out buffer (FIFO) 58 with sufficient capacity for a 2-byte header (4 tokens). It is permanently connected to the interval selector 22 by the Header connection 23 which is not shown in Figure 3. When the signal Set.m1 is high, the multiplexor 56 transmits the output of the FIFO to the channel DataOut 12a, When the signal Set.m1 is low, the output multiplexor 56 transmits the output of the switch 52 to the path 12a DataOut. When the signal Set.m2 is high, the multiplexor 54 transmits the output of the random header generator 24 (Figure 1) received on path 27 to the FIFO. When the signal Set.m2 is low the multiplexor 54 transmits the output of the switch 52 to the FIFO. Whenever the FIFO 58 receives a token, it signals on the path Got.token.f, unless it is filled by the token, in which case it signals on the path Full. It outputs a token whenever it receives a signal on the path Send.h. If it becomes empty it signals on the path Empty. If it receives an input on the path Reset it discards all its contents, but does not signal on the path Empty. The effective size of the FIFO is controlled by an associated flag 60 which is a packet header length flag. If this flag is set, packet headers are 2 bytes long and the FIFO signals on the path Full only when it contains four tokens. If this flag is not set, packet headers are 1 byte long and the FIFO signals on the path Full only when it contains two tokens. In this case, the upper two tokens of the FIFO are forced to zero. The packet header length flags 60 are set identically in all the links La to Ln, and it will be appreciated that they could be implemented with a single latch whose output is fanned out to all the links. There is also a flag 62 associated with the control logic 51 which is the randomisation flag for the link. If this flag is set, a random header is obtained from the random header generator 24 for each packet arriving through the link. To enable this flag to be set differently for each link, there is a separate latch in each link. The behaviour of the header buffer 20 depends on the setting of this randomisation flag of the link La: if the flag 62 is set, the header buffer 20 signals the random header generator 24, and stores the random header which is returned. As soon as any data arrives from the link module 18, it signals on the path 61 called Select the connected interval selector 22; if the flag 62 is not set, the header buffer is filled with the first data to arrive, and when it contains a header (1 or 2 bytes, depending on the setting of the packet header length) it signals the connected interval selector 22. If the selector 22 signals to the buffer 20 that the header is to be discarded, this is done by resetting the FIFO 58, and the header buffer is refilled from the data stream, and when it contains a header (1 or 2 bytes, depending on the setting of the packet header length) it signals the connected interval selector. The header buffer transmits its contents in response to requests received from the crossbar switch 10. If the randomisation flag of the link is set, the header buffer refills itself from the random header generator, otherwise it refills itself from the data stream, and repeats the cycle after passing on an end of packet token. The Interval Selector The operation of the interval selector 22 will now be explained with reference to Figure 4. The interval selector performs the routing decision for each packet by means of an interval selection algorithm. The contents of the FIFO 58 of the header buffer 20 are presented continuously to a 'ladder' of 33 base and limit comparators 66a .... 66n of which four are shown on the right of the figure. There are 33 comparators because there are 32 links in the described embodiment. Each comparator is connected to a pair of registers 68a .... 68n, except the lowest comparator 66a, whose base is fixed at zero. Each register 68i-1 is connected to the base of one comparator 68i and the limit of another 68i-1, except for the top register 68n which is connected only to the limit of the topmost comparator 66n. In normal use, the registers are programmed with a non-decreasing set of 16-bit values, such that the top of the 'ladder' is not zero. The output of each comparator is connected to a respective 5-bit register 70a .... 70n whose contents are sent to an address gate 72 if the packet header is greater than or equal to the base and less than the limit which are connected to the associated comparator. At the bottom of Figure 4 is shown a single-value 'portal' comparator 74, whose outputs are gated by a Select gate 73 receiving the 'Select' signal from the header buffer 20. When the Select signal is sent by the header buffer the contents of the header buffer FIFO 58 is the packet header, which is connected by header path 23 to the input of the comparator 74. If the packet header is not equal to the contents of a 16-bit register 76 connected to the comparator 74, a 'No' signal is sent to the Select gate 73, which then allows the address which is produced from the 'ladder' of base and limit comparators 60a .... 66n to be sent out to the crossbar switch 10 along path 26. If the packet header is equal to the contents of the 16-bit register 76 connected to the comparator 74, a 'Yes' signal is sent to the header buffer 20 telling it to discard that header via path 21. In this case the output of the ladder of comparators is not sent to the crossbar switch 10. The Random Header Generator The operation of the random header generator will now be described with reference to Figure 5. A random number generator 80 at the top of Figure 5 generates 16-bit pseudo-random numbers using a shift-register with feedback or some other method. When it receives a signal from a remainder unit 82 connected thereto it produces such a number. The remainder unit 82 computes the remainder of this number by the value held in an associated 16-bit register 83. When the remainder unit 82 receives a signal from a tokeniser unit 86 it sends on this 16-bit computed remainder, and requests another pseudo-random number from the random number generator 80. The tokeniser stores the 16-bit remainder until it receives a request from the header buffer 20 along path 25. It then transmits the least significant four bits of the remainder, and shifts down the remaining bits by four places. It repeats this action until it has sent the number of nibbles corresponding to the length of the header (which is 2 or 4 depending on the setting of the associated flag 60 (which is shown in Figure 3) and then restarts its cycle. It will be appreciated that the range of random headers generated could be made completely general by incorporating an additional 16-bit register and an adder to add its contents to the output of the remainder unit before passing the result to the tokeniser. The Header Stripper The operation of the header stripper will now be described with reference to Figure 6. It can be seen that there is a single token buffer 85, which is in fact identical to the token buffer 50 in the header buffer 20 (Figure 3). The token buffer 85 signals to control logic 84 when it has received a token along the path 14a DataIn which is an end-of-packet token on the wire marked Got.EOP, and signals to control logic 84 on the wire marked Got.token.b whenever it receives any other token. It transmits its contents on DataOut path 40 when it receives from the control logic 84 a signal on Send.t. The Crossbar Switch The crossbar switch 10 is a 32 by 32 array of switch elements 88. Figure 7 shows a portion of the crossbar switch 10 showing 20 switch elements with thick arrows indicating the flow of data. Requests for data flow in the opposite direction and are not shown in Figure 7. Initially all the switch elements are "off", i.e. in state A in figure 7. When input i is to be connected to output j then switch element 88 (i, j) is switched "on" and the data flows from the input to the selected output as shown in state B in Figure 7. Figure 8 shows the flow of data in a 4-by-5 section of the crossbar switch 10 when two of the switch elements Y and Z are set "on" and all the others are "off". Notice that in this configuration the input 12b in.2 is connected to the output 14c out.3 and that input 12c in.3 is connected to output 14b out.2. Note that the switch element U 88 (2,2), which is in the 'off' state, is passing data for both of these connections. Note also that the 'on' state of switches Y 88 (3,2) and Z 88 (2,3) has disconnected switch V 88 (3,3), but this is of no consequence, since the input in.3 is connected to out.2 via switch Y, so that switch V is not needed to pass data from that input; and that output out.3 has been connected to input in.2. The arbitration circuitry 32 means that switch V is not required to pass data to output out.3 either. The external connections of each switch element 88 (i,j) are shown in Figure 9. The line ADDR, which is the address path 26 from the interval selector 22, is connected to all the switch elements in each row, i.e. those with the same i value. These connections are discussed more fully in the following. Each switch element 88 (i,j) of the crossbar switch is identical and the block structure of one of these elements is shown in figure 10. There are three main components: a switch 90, a comparator 92 and an arbiter server (ARB) 94 which are discussed in European Application No. 90307110.8 from which the present application is divided and the contents of which are herein incorporated by reference. Initialisation of Flags and Registers The following parameters must be supplied before the routing switch can operate: The packet header length (1 or 2 bytes) The comparator settings for the interval selectors 22, and the associated output link numbers for each range of destination node identifications; The portal comparator value for the interval selector 22; For each link: the 'randomise on input' and 'strip header on output' flags must be set; The range of the random headers (if any of the 'randomise on input' flags are set). These have to be input by the routing switch and loaded into the appropriate latches and registers. This could be done in a variety of ways, for example by sending pre-defined command codes down an extra dedicated link, which has channels to all the latches and registers. Note that all the interval selectors and random header generators must be programmed identically. This initialisation is indicated diagrammatically in Figure 1 by initialisation logic 30. The device has been described with one interval selector and one random header generator per link. It will be appreciated that both of these units are used only once or twice per packet input by the link, and so could in principle be shared between several links, connected by a bus, using an arbitration scheme to resolve multiple simultaneous requests for either resource. For example the arbitration method used in the crossbar switch 10 could be used to share an interval selector or random header generator between several links. Figure 11 shows an example of a network which uses a plurality of routing switches RS to route messages between source nodes and destination nodes represented in Figure 11 by circles marked N. The routing switches are interconnected by their links L, each link having a hard wired bidirectional pair of unidirectional channels as represented by reference numerals 4, 6 in Figure 1. The source and destination nodes N of the network can be any type of computer device, but the routing switch described herein is particularly applicable for networks having microcomputers as described in GB 111399 and in our copending British Patent Application No. (Page White & Farrer Ref: 64199). Connections to destination and source nodes N are called terminal links in Figure 11. In Figure 11 each routing switch is shown with four message links - in fact in the embodiment described above there are 32.

Claims: A communications device for transmitting and receiving messages and comprising input circuitry having storage means for storing data and a receiving input (4) for receiving input data, a counter for counting the amount of data stored in the storage means, and output circuitry transmitting a flow control code from an output thereof when there is sufficient storage capacity in the storage means for a predetermined amount of data; said output circuitry (42) having a data input (40) for receiving a first stream of data and a flow control request input (43) for receiving flow control information; the input circuitry being coupled to the output circuitry to supply said flow control information via the flow control request input (43); characterised in that said output circuitry is effective to convert said data of the first stream and said flow control information into a plurality of outgoing codes (6) each of a predetermined bit length and to transmit said outgoing codes as an output stream from said output, said codes being selected from a group of codes, a set of which are designated as data codes and one of which, not in said set, is designated as said flow control code; and in that said input data is in the form of a stream of incoming codes and the input circuitry is effective to decode incoming codes of the input stream into data items stored by said storage circuitry and said flow control information, whereby the output circuitry is caused to transmit said flow control code in said output stream when there is said sufficient storage capacity in the storage means. A communications device as claimed in claim 1, wherein the storage means has storage capacity sufficient to hold exactly said predetermined number of data items. A communications device as claimed in claim 1, wherein the storage means has sufficient storage capacity for more than said predetermined number of data items. A first communications device for transmitting messages to and receiving messages from a second communications device connected to the first communications device, the first communications device comprising a communications device according to any preceding claim wherein said outgoing codes are in use transmitted as an output stream to the second communications device, and said input stream of incoming codes are in use received from the second communications device whereby said flow control information supplied via the flow control request input causes said output circuitry of the first communications device to transmit said flow control code to the second communications device when there is said sufficient storage capacity in the storage means of the first communications device. A communications device according to any preceding claim, wherein the output circuitry has a counter for counting the number of data items which the output circuitry is permitted to transmit, the counter being incremented by said predetermined number in response to receipt of a said flow control code at the input circuitry, and being effective to be decremented by one for each data item then sent by the output circuitry. A communications device according to claim 5, wherein the output circuitry sends no further data items when the counter reaches zero, until it has been incremented in response to receipt of a flow control code. A method for transmitting a plurality of bit sequences from a first communications device to a second communications device, the bit sequences each having the same number of bits and constituting a group, the method comprising: designating one of said group of bit sequences as a flow control code and others of said group of bit sequences as data items; and at the second communications device, counting the number of data items transmitted from the first communications device and stored at the second communications device and, when there is capacity at the second communications device for a predetermined number of data items transmitting said flow control code from the second communications device to the first communications device to authorize transmission of said predetermined number of data items to the second communications device. A method according to claim 7, further comprising: incrementing a counter at the first communications device by said predetermined number on receipt of a flow control code and decrementing the counter each time a data item has been transmitted, whereby the counter maintains a count of the number of data items which the first communications device is permitted to transmit. A method according to claim 9, wherein the first communications device sends no further data items when the counter reaches zero, until it has been incremented in response to receipt of a flow control code. A routing switch for routing messages between computer devices in a network having a plurality of nodes at least some of which have respective identifications, each computer device including packet generating circuitry for generating message packets each with a header portion indicating a destination node identification and a message portion following the header portion, said routing switch including at least one input for receiving message packets from a source node in the form of an input stream of codes each of a predetermined bit length, and a communications device as claimed in claim 1; a plurality of output at each of which is arranged said output circuitry; header reading circuitry for reading the header portion of a packet received at the input; and switch circuitry for selectively interconnecting said input to a selected one of said outputs in dependence on reading of said header portion. A routing switch as claimed in claim 10, wherein said at least one input comprises a plurality of inputs, each selectively connectable to any of said plurality of outputs. A routing switch as claimed in claim 10 or 11, in which the routing switch further comprises header deletion circuitry for deleting the header portion of a packet received thereby so that on receipt of the packet by a successive routing switch connected thereto a subsequent portion of the packet forms the header portion. A routing switch as claimed in claim 10 or 11, in which the routing switch further comprises random header generation circuitry operable to generate random addresses to form new header portions for incoming packets. A method of encoding data for transmitting messages through a plurality of routing devices in bit sequences in which method the bit sequences are selected from a finite set of twenty bit sequences, each bit sequence having six bits comprising three ones and three zeros, wherein a first subset of said finite set consisting of sixteen bit sequences is designated for use as data codes and a second subset of said finite set is designated for use as control codes for controlling transmission of said data codes, said second subset consisting of four bit sequences which do not form part of said first subset, wherein a first one of said control codes is designated as a flow control code for controlling the quantity of data codes transmitted between a source device and a destination device; a second one of said control codes is designated as a null code for maintaining continuous transmission when there is no data code to be transmitted; and a third one of said control codes is designated as an end of packet code which identifies the end of a packet including with said end of packet code at least one code.

Inventors: MAY MICHAEL DAVID, PARSONS BRIAN JEREMY, THOMPSON PETER WILLIAM, WALKER CHRISTOPHER PAUL HULME, MAY, MICHAEL DAVID, PARSONS, BRIAN JEREMY, THOMPSON, PETER WILLIAM, WALKER, CHRISTOPHER PAUL HULME
Applicants: SGS THOMSON MICROELECTRONICS, STMICROELECTRONICS LIMITED
Application year: 1990
Main classification: H04L12
IPC codes: H04Q11, H04L12