A system engineer's worst nightmare: transmitting a misinterpretation of data in a large block of serial data. If it doesn't corrupt the entire data stream, it forces the transmitting system to resend that entire block of data just to rectify the situation, as well as continue to transmit other data. This can result in latency in the network, or at worst, entirely incorrect data. So how does a network designer come up with a robust method for framing and interpreting data across multiple communication standards?
The physical layer (PHY) best handles these types of issues. As such, the resulting PHY design elements should include data encoding and a robust data-framing structure that can operate across a large selection of standards.A LITTLE BACKGROUND As soon as synchronous-serial communications systems arrived, designers had to figure out how to recover data that was serialized and then transmitted over an imperfect transmission channel.
The first step involved "encoding" the data to ensure it had sufficient transition density to allow a clock and data recovery (CDR) phase-locked loop (PLL) to extract the clock from the data stream. This step has been accomplished using various types of scramblers, 4B/5B and later 8B/10B encoder/decoders, and other more exotic methods such as scrambling polynomials for Sonet and the Society of Motion Picture and Television Engineers (SMPTE).
The second step involved finding the bit position that represents the start of the data stream, i.e., framing the data. When a serial data stream arrives at its destination, one bit looks pretty much like any other. Therefore, a "trick" is needed to find the exact bit that represents the beginning of a frame or piece of valid data information.
Today's transmission methods include a special string of bits to discover this bit alignment. In the FDDI-4B/5B code, it's called JK. In Fibre Channel-8B/10B, it's called K28.5. The string is also known as A1A2 in Sonet and as Timing Reference Sequence (TRS) in SMPTE. In any of these sync characters, the legally transmitted data doesn't contain this sequence in any bit alignment except for properly aligned data bits. Thus, the receiver logic can simply look for the "secret code" and set internal pointers to match it when found. Then the bit sequence will be "framed" (i.e., output in the same groupings as it had during transmission).STANDARDS DEFINE THE SYNC CHARACTER International standards bodies adopted and documented the sync characters mentioned above (along with the underlying encoding method) to ensure that systems can interoperate. The published standards include the basic definition of a "minimum" necessary behavior to ensure interoperability. None of the standards discusses how this minimum responds to worst-case events (or even more egregious, nonstandard uses) in the system environment.
For example, the 8B/10B code tables (the 10-bit codes used to represent 8-bit data with a few control codes left over) used by the Fibre Channel (FC) standard define the sync character to be a code sequence called a comma. In the table, the data type names beginning with a "D" represent valid data characters while the data type names beginning with "K" represent special character codes.
The comma characters are the first part of the special character code. This 7-bit sequence (110000 0 or 001111 1) can determine byte boundaries. It occurs in three of the code patterns that are defined as legal out-of-band signaling characters (K28.5, K28.1, and K28.7). FC uses only the first one of these.
In the FC standard, the letter of the law states that it's legal to frame on the 7-bit comma character (either 1100000 or 0011111). In later standards, this was simplified whereby framing now occurs on only one bit pattern (only 0011111, but not 1100000).THE MISFRAMING PROBLEM These simplifications are included in the standards. They were written for users to claim conformance to the standard with silicon built before the standard was finalized.
After a standard is published, this low-level detail is seldom if ever revisited, and it's usually used in later standards without comment because nobody wants to challenge a published standard. In effect, from the FC case mentioned above, the standard traded off decreased framing complexity for improved power without fully comprehending how this tradeoff would affect noisy-system behavior.
The problem of misframing arises when a serial stream nears its limits for distance or speed and starts to stress the receiving data-recovery circuits. Jitter and pulse degradation cause the serial stream to be misinterpreted, which flips the random data bits. In general, the system can tolerate this data corruption by detecting erroneous bits and either discarding (retransmit bad data) or fixing them (on-the-fly error correction). However, when there's a bad bit on the framing logic, a bit transposition can cause the packet recovery to be misframed (i.e., realigned to the wrong byte boundary). This will corrupt the data stream forever, or at least until a higher-level protocol forces reframing.
The simplification of using a single 7-bit comma, rather than a K28.5 character, opens the door for single-bit errors to create an alias-sync character that, in turn, causes misframing of the data stream. This problem arises because many characters (and adjacent character combinations) would include the string 0011111 or 1100000 if an unfortunate bit transposition occurs.SOME SOLUTIONS The problem of generating alias-sync characters is exacerbated by the fact that many opportunities exist to create a 7-bit alias-comma by corrupting otherwise good data bytes (or byte pairs) with an unlucky single-bit transposition. Using a more complete 10-bit K28.5 to frame the data slightly alleviates the problem, but it doesn't solve it. Even though the error rate is less than before, a huge number of combinations can still create the alias-sync. A system operating in a noisy enough environment will have errors. Also, if it's very sensitive to framing errors, the system will be disrupted.
The protocol designers for FC were aware of this problem and defined a 65-state finite state machine (FSM) to manage the framer logic. This state-machine detects if the recovered data is corrupt and enables the framer. The deserializer logic then examines the incoming data stream looking for commas and aligns the internal byte boundaries to them. When good data starts flowing out of the decoder, the FSM disables the framer. This technique limits the misframing exposure to just when the framer is enabled.
One of the most robust solutions to framing errors is what's called "multibyte framing." To understand the need for such a feature, one must first analyze the synchronization and idle characters of some common communications standards. As it happens, FC interpacket gaps are filled with four-byte ordered sets, each of which starts with a K28.5. All ordered sets and primitives in FC have a K28.5 followed by three data characters (e.g., IDLE is K28.5 D21.4 D21.5 D21.5). During transmission of ordered sets or idles, two instances of K28.5s will occur in successive ordered sets in identical 10-bit boundaries across 50 bits (Fig. 1).
In Enterprise Systems Connection (ESCON), an interconnect technology created by IBM, interpacket gaps are filled with multiple K28.5 special characters to provide the idle characters for framing. According to the ESCON specification, a link-level facility should transmit at least four consecutive idle characters in between two frames. Moreover, all Sequence Functions in ESCON contain a K28.5 character followed by a single data character (Fig. 2).
In Gigabit Ethernet (GbE), K28.5s are sent as part of I1, I2, C1, and C2 ordered sets. The IDLE ordered sets, I1 and I2, contain a K28.5 followed by one data character. Hence, when IDLE ordered sets are transmitted, the K28.5s are spaced across 30 bits in two successive occurrences of the ordered set (Fig. 3). The CONFIGURATION ordered sets, C1 and C2, contain a K28.5 followed by three data characters.
In the DVB-ASI specification, two or more successive K28.5 characters must precede all transport packets (Fig. 4).
Within the Open Base Station Architecture Initiative (OBSAI), a Master Frame comprises a message group series. The CDMA version of the OBSAI architecture features three K28.5 characters between each message group (Fig. 5). Looking at other wireless basestation data formats, such as OBSAI's WCDMA, OBSAI's GSM/EDGE, and CPRI (Common Public Radio Interface), shows only a single K28.5 character (Fig. 6).MULTIBYTE FRAMING Many physical layers are intended to comply with various data-communications standards. Other physical layers, such as Cypress' HOTLink family of devices, are intended to be standards-compliant (i.e., used in systems where the protocol logic controls the framer) and operate in the more general nonstandard environment (i.e., systems where no logical intelligence was assumed). These called for a solution that didn't require a complex external state machine, such as a multibyte framer.
The problem of bit flipping, which results from noise, causes the alias-sync problem. This effect is rare in that it affects a small group of bits at a time and can go a long way before the error repeats. This characteristic was used to support the assumption that if an alias-sync character was decoded (a decoder can't decipher whether the character is indeed real), it could be detected if the reframe condition was expanded to require a second sync before reframing.
The pipelined high-speed logic in the HOTLink family was expanded to record a K28.5's arrival and then opt to reframe only when another K28.5 character arrived exactly 10, 20, 30, or 40 bits later (i.e., exactly byte-aligned with zero to four intervening bytes). This would allow a system to be implemented without an FSM and ensure that erroneous framing events didn't cause trouble. (The design cost involved adding about eight high-speed flip-flops.)
If engineers re-analyze the synchronization and idle characters of certain common communications standards, they will see that FC, ESCON, GbE, DVB-ASI, and OBSAI's CDMA data format all require two or more K28.5 characters within a 50-bit span.
FC requires two K28.5 characters across 50 bits. ESCON requires four K28.5 characters across 40 bits. GbE requires two K28.5 characters across 30 bits. DVB-ASI requires two or more successive K28.5 characters. And, OBSAI's CDMA data structure requires three K28.5 characters within 30 bits. A multibyte framer's resilience can benefit all of these communications standards, even in a noisy environment.
To account for every situation, multibyte framers should include both a single-K28.5 framing mode and a multi-K28.5 mode, just in case some unforeseen system requirements forced framing on a single K28.5 (e.g., OBSAI's WCDMA, OBSAI's GSM/EDGE, and CPRI). Given that different applications implement K28.5 reframing triggering mechanisms in disparate ways, various framing modes are necessary as well.
For example, in systems using the FC FSM, the framer logic should reframe on every K28.5 found. In other systems, two K28.5s are byte-aligned and spaced less than five bytes apart to affect a reframe, while others will reframe only if two framing characters are detected within 50 bits on identical 10-bit character boundaries. For an extremely robust data stream, some devices will reframe only upon detection of at least four consecutive framing characters on identical 10-bit character boundaries.COMMA CHARACTER FRAMING If a combination of comma characters exist, such as those present in K28.5, K28.1, and K28.7 characters (i.e., two comma characters within a 50-bit span), a robust solution would be to perform multibyte framing using comma characters.
Such a feature is valuable when synchronizing links if multiple K28.7 or K28.5 characters are sent until links are established in a protocol like OBSAI. To alleviate the probability of misframing on the 7-bit comma (either 110000 0 or 001111 1), the framer should frame to an 8-bit comma (either 110000 01 or 001111 10).
Multibyte framing in deserializing devices solves real system problems not delineated in standards where they claim compliance. This type of better-than-standard behavior makes a multibyte framer an important part of a robust serial-transmission-system architecture.