Read an Excerpt
Chapter 1: Asynchronous Terminal Services
Introduction So we start. This first chapter will give you a brief technical overview of standard asynchronous communications. Then we will examine the basic terminal services provided by Cisco routers and access servers. The labs are simple to set up and can be accomplished with any Cisco router with an auxiliary port, asynchronous/synchronous port, or asynchronous communications port. Samples of all three are shown by the end of the chapter.
Asynchronous Communication
How do asynchronous communications work? After we answer this question, some of the commands we use on Cisco routers and access servers will make a little more sense.
Asynchronous data is transmitted in a serial manner, one bit at a time. If we just sent some random bits of information, it would be difficult to receive these random bits and make sense out of them. So in asynchronous communications, we organize the transmission of data in characters.
The beginning and end of each character of data must be identified by start and stop bits. The start bit indicates when the data byte is about to begin, and the stop bit signals when it ends. The requirement to send these additional two bits causes asynchronous communications to be slightly slower than synchronous; however, it has the advantage that the processor does not have to deal with the additional idle characters.
An asynchronous line that is idle is identified with a value of 1 (also called a mark state). By using this value to indicate that no data is currently being sent, the devices are able to distinguish between an idle state and a disconnected line. When a character is about to betransmitted, a start bit is sent. A start bit has a value of 0 (also called a space state). Thus when the line switches from a value of 1 to a value of 0, the receiver is alerted that a data character is about to come down the line.
Once the start bit has been sent, the transmitter sends the actual data bits. There may either be five, six, seven, or eight data bits, depending on the number you have selected. Both the receiver and the transmitter must agree on the number of data bits, parity, and the baud rate (see below). Almost all devices transmit data using either seven or eight data bits. Note that when only seven data bits are employed, you cannot send ASCII values greater than 127. After the data has been transmitted, a stop bit is sent. A stop bit has the value of 1 (mark state) and is 1, 1.5, or 2 bits long and can be detected correctly even if the previous data bit also had a value of 1. Character termination is accomplished by the stop bit's duration; this forces a mark state (idle) between characters.
Besides the synchronization provided by the use of start and stop bits, an additional bit called a parity bit may optionally be transmitted along with the data. A parity bit affords a small amount of error checking, to help detect data corruption that might occur during transmission. You can choose: even parity, odd parity, mark parity, space parity, or none at all. When even or odd parity is being used, the number of marks (logical 1 bits) in each data byte are counted, and a single bit is transmitted following the data bits to indicate whether the number of 1 bits just sent is even or odd. For example, when even parity is chosen, the parity bit is transmitted with a value of 0 if the number of preceding marks is an even number. For the eight-bit binary value of 0110 0 011, the parity bit would be 0. If even parity were in effect and the binary number 1101 0110 were sent, then the parity bit would be 1. Odd parity is just the opposite, and the parity bit is 0 when the number of mark bits in the preceding word is an odd number. The parity rule is simple: for even parity, the number of mark bits must be even; for odd parity, the number of mark bits must be odd. The parity bit is either a mark or space to make the parity correct. Parity error checking is very basic, and while it will tell you if there is a single bit error in the character, it doesn't show which bit was received in error. If an even number of bits are in error, then the parity bit would not reflect any error at all. Mark parity means that the parity bit is always set to the mark signal condition, and the space parity always sends the parity bit in the space signal condition. Since these two parity options serve no useful purpose whatsoever, they are almost never used. Figure 1-1 shows some sample character transmissions.
FYI The common shorthand for defining data stream characteristics is 8-N-1. First comes the number of data bits: 5, 6, 7, or 8. Second is parity: N(one), E(ven), O(dd), S(pace), or M(ark). Third is the number of stop bits: 1, 1.5, or 2.
Sample #1 illustrates a sample bit stream of 1100 1001 if the definition we use is eight data bits, no parity, and one stop bit, or 8-N-1. At sample time 1, the line is idle or in the mark state (1). When the line state changes to a space state (0), the line detects the start bit and sets up a sampling rate based on the bits per second defined. When the next sample time comes, the line starts clocking in bits by sampling the data stream level for is and Os. The stop bit(s) at the end of the character stream forces the data stream to a mark or idle condition so that the data stream will correctly identify the start of a new character with a space start bit.
QUESTION #1 Based on the following data stream definitions for samples #2, #3, and #4, what are the characters being transmitted in binary, and are they valid characters or not? You will find answers to these questions at the end of the chapter.
Sample #2's definition is 5-E-1 Sample #3's definition is 8-E-2 Sample #4's definition is 7-0-1.
Transmission speed is the one area that has not been discussed. Transmission speed is based on a clocking signal. When we get to cabling and physical layer signalling in Appendix A, we will see that there is no clocking signal between the two end points. How does the circuitry at each end know how fast to send the data stream? Each end must set matching speeds in bits per second to transmit and receive data correctly. There is another option when it comes to setting up the transmission speed at either end. The feature is referred to as autobaud. If there is a known character being received, and the speed is correct, then the character will be properly decoded. This only works if the bits per character and parity are correctly defined. Autobaud works by starting with the maximum speed available on the port or line, and checking to see if the known character is received. If the transmission is not decoded correctly, then the initial speed is reduced to the next lower standard speed, and the data stream is checked again. This process is repeated until the correct speed is detected...