Local Asynchronous Communications RS232 Computer Networks and Internets

  • Slides: 28
Download presentation
Local Asynchronous Communications (RS-232) Computer Networks and Internets by Douglas Comer Includes material from

Local Asynchronous Communications (RS-232) Computer Networks and Internets by Douglas Comer Includes material from other sources. Rick Graziani graziani@cabrillo. edu Rick_Graziani@csumb. edu 1

5. 2 Asynchronous Communications n n Note: The next two chapters are better discussed

5. 2 Asynchronous Communications n n Note: The next two chapters are better discussed in a Data Communications class where they can be given the appropriate amount of time and focus. This chapter discusses how electric current is used to transfer digital information across short distances. Asynchronous communications n In the broadest sense, asynchronous communications is when the send and receiver to no need to coordinate (synchronize) before data is transmitted. n Note: This synchronization is at layer 1 as opposed to layer 4. n Communications hardware is classified asynchronous if the electrical signal the transmitter sends does not contain information that the receiver can use to determine where individual bits begin and end. n The receiving hardware must be built to accept and interpret the signal the sending hardware generates. n Comer, Chapter 6 Long Distance Communications, will describe synchronous communications. Rick Graziani, graziani@cabrillo. edu 2

Asynchronous Transmission – more info n n n Serial Transmission = Method of information

Asynchronous Transmission – more info n n n Serial Transmission = Method of information transmission in which one bit of a character is sent at a time. (figure 3 -9) Requires only one wire for transmission of a bit, plus other wires for transmitting other characters (later) Generally slower than parallel transmission Generally costs less than parallel transmission due to needing fewer hardware components and cables Serial Transmission can use one of the following transmission modes: n Asynchronous transmission n Synchronous transmission Rick Graziani, graziani@cabrillo. edu 3

Asynchronous Transmission – more info n n n Asynchronous: From the Greek asyn-, meaning

Asynchronous Transmission – more info n n n Asynchronous: From the Greek asyn-, meaning "not with, " and chronos, meaning "time“, “not with time” A method of data transmission which allows characters (bytes) to be sent at irregular intervals by preceding each character with a start bit, and following it with a stop bit. (Newton) Common for low speed and inexpensive transmissions such as terminals. Data rate = Transmission rate usually measured in bits per second or bps. Start and Stop bits define where the character begins and ends. Rick Graziani, graziani@cabrillo. edu 4

Asynchronous Transmission – more info Start bit = A bit, always a 0 (off),

Asynchronous Transmission – more info Start bit = A bit, always a 0 (off), followed by each of the data bits. n “Tips off the computer that the next bit is part of a transmitted character and not just part of the inter-character gap. ” (Newton) Stop bit = A bit, always a 1 (on), which follows the last data bit or parity bit. n “An interval at the end of each asynchronous character that allows the receiving computer to pause before the start of the next character. ” (Newton) Rick Graziani, graziani@cabrillo. edu 5

Asynchronous Transmission – FYI n n n The start bit starts the receiving computer’s

Asynchronous Transmission – FYI n n n The start bit starts the receiving computer’s internal clock and the expects to receive a certain number of data bits depending on the agreed upon data rate. Each device, sender and receiver, must be set to transmit and receive data at a given speed. Error checking is done on each character, using the parity bit (later). Receiver must somehow “sample” the incoming data accurately, i. e. receiver must sample the incoming data as close to the center of the “bit-cell” as possible. (coming) (See the Nyquist criteria for more information on how this is done. ) Transmitter and receiver clocks are independent of each other. Timing problems may arise if sender and receiver have different clock rates. Rick Graziani, graziani@cabrillo. edu 6

Asynchronous Transmission – FYI Timing in Asynchronous Communications (UDC refers to the book Understanding

Asynchronous Transmission – FYI Timing in Asynchronous Communications (UDC refers to the book Understanding Data Communications by Held) n n n Transmitter and receiver must agree on an exact clock rate Receiver retimes its clock on the edge of the transition (change) from the previous stop bit (1) to the zero (0) of the start bit. Receiver uses new timing to find the middle of the start bit. (Figure UDC-2. 15 a) If the receiver clock is slightly fast, no error occurs because the sample strobe still occurs within each bit time or bit cell. (Figure UDC-2. 15 b) If the receiver clock is so much slower than the clock of the transmitter, the sample strobe does not sample bit 4 and an error occur in the output. (Figure UDC-2. 15 c) Rick Graziani, graziani@cabrillo. edu 7

Another explanation from Sangoma Technologies n n n FYI Asynchronous communications This is the

Another explanation from Sangoma Technologies n n n FYI Asynchronous communications This is the method most widely used for PC or simple terminal serial communications. In asynch. serial communication, the electrical interface is held in the mark position between characters. The start of transmission of a character is signaled by a drop in signal level to the space level. At this point, the receiver starts its clock. After one bit time (the start bit) come 8 bits of true data followed by one or more stop bits at the mark level. The receiver tries to sample the signal in the middle of each bit time. The byte will be read correctly if the line is still in the intended state when the last stop bit is read. Thus the transmitter and receiver only have to have approximately the same clock rate. A little arithmetic will show that for a 10 bit sequence, the last bit will be interpreted correctly even if the sender and receiver clocks differ by as much as 5%. Asynch. is relatively simple, and therefore inexpensive. However, it has a high overhead, in that each byte carries at least two extra bits: a 25% loss of line bandwidth. A 56 kbps line can only carry 5600 bytes/second asynchronously, in ideal conditions. Sangoma Technologies: http: //www. sangoma. com/sync&a. htm Rick Graziani, graziani@cabrillo. edu 8

5. 3 Using Electrical Current n n n The simplest electronic communication systems use

5. 3 Using Electrical Current n n n The simplest electronic communication systems use a small electric current to encode data. Negative voltage might be used to represent a 1 (on bit), and a positive voltage might be used to represent a 0 (off bit). These voltages are sent over the wire for a specific amount of time. Rick Graziani, graziani@cabrillo. edu 9

5. 4 Standards for Communications Challenges: n How long should the voltage be held

5. 4 Standards for Communications Challenges: n How long should the voltage be held for a 0 or a 1? n What voltages and levels do we use? n How do you determine the number of 0’s or 1’s when the bits are consecutive? n How do we consider issues such as clocking, timing and high-speed transmission issues? (Data Communications) n How do we ensure inter-vendor compatibility? Solution: n Use standards set by responsible organizations such as ITU, EIA, IEEE. Rick Graziani, graziani@cabrillo. edu 10

5. 4 – Standards For Communications RS-232 n EIA RS-232 -C = A common

5. 4 – Standards For Communications RS-232 n EIA RS-232 -C = A common standard designed for use with devices such as modems and terminals, specifying the transmission of characters. n Designed for 7 bit characters, but can send 8 bit as well. n RS-232 is asynchronous so sender and receiver do not need to coordinate (clocking, etc. ) before transmission. n RS-232 allows a character to be sent at any time and the delay between characters is arbitrary. n Used for short distances between a computer and a modem or terminal. n Let’s see how this is done! Rick Graziani, graziani@cabrillo. edu 11

5. 4 – Standards For Communications RS-232 n n RS-232 never leaves zero volts

5. 4 – Standards For Communications RS-232 n n RS-232 never leaves zero volts on the wire. When the transmitter has nothing to send, it leaves the wire with negative voltage that corresponds to bit value of 1. Since the wire does “not return to zero volts” between each bit, a receiver cannot use the lack of voltage to mark the end of one bit and the start of the next. (see consecutive 1’s) Instead both the sender and receiver must agree on the exact length of time the voltage will be help for each bit. Rick Graziani, graziani@cabrillo. edu 12

5. 4 – Standards For Communications RS-232 When the first bit arrives, the receiver

5. 4 – Standards For Communications RS-232 When the first bit arrives, the receiver starts a timer. n Each bit is transmitted with the same length of time. n The start bit (+15 v) is used to signal the beginning of the character, transitioning from idle (-15 v) and to start (+15 v). n Positive (+) 15 volts are used for 0 bits n Negative (-) 15 volts are used for 1 bits RS-232 n 1 start bit (0 bit or +15 v) n 7 data bits n 1 stop bit (1 bit or – 15 v) n Rick Graziani, graziani@cabrillo. edu 13

RS-232 – More info (FYI) n Common RS-232 -C connectors Rick Graziani, graziani@cabrillo. edu

RS-232 – More info (FYI) n Common RS-232 -C connectors Rick Graziani, graziani@cabrillo. edu 14

RS-232 – More info (FYI) Voltage Levels for Data n 0 = signal b/t

RS-232 – More info (FYI) Voltage Levels for Data n 0 = signal b/t +3 and +15 volts n 1 = signal b/t -3 and -15 volts Transition zone or Guard band n signals outside the specified ranges which are ignored by the receiver Limitations n Distance: 50 feet per standard n Speed: 20 kbps (can be faster) Rick Graziani, graziani@cabrillo. edu 15

RS-232 – More info (FYI) The previous slides can be somewhat misleading, making you

RS-232 – More info (FYI) The previous slides can be somewhat misleading, making you think RS-232 is a standard between two computers (DTE devices) although it can be used as such. (later) n EIA Interface standard for communications between a DTE and a DCE n 20 - 115 kbps data rate DTE (Data Terminal Equipment) = any device capable of generating and/or receiving data such as computers, terminals, etc. n a source and a sink of data DCE (Data Circuit-terminating Equipment or Data Communications Equipment) = any device capable of connecting to a DTE on one side and a transmission channel on the other side n allows for DTE to communicate remotely (Figure 4 -3) n examples: modem or DSU (Data Service Unit) - later n responsible for converting data into “signals” so that they can be transported over the transmission channel n Rick Graziani, graziani@cabrillo. edu 16

RS-232 – More info (FYI) Rick Graziani, graziani@cabrillo. edu 17

RS-232 – More info (FYI) Rick Graziani, graziani@cabrillo. edu 17

RS-232 – More info (FYI) n Explanation on next slide. Rick Graziani, graziani@cabrillo. edu

RS-232 – More info (FYI) n Explanation on next slide. Rick Graziani, graziani@cabrillo. edu 18

RS-232 – More info (FYI) 1. 2. 3. Local and Remote DTE: “I would

RS-232 – More info (FYI) 1. 2. 3. Local and Remote DTE: “I would like to talk to the modem. ” (Raise DTR) Local and Remote DCE: “I am powered up and ready to go. ” (Raise DSR) Local DTE: “Send Telephone Number. ” (On TD), Remote DCE: “The phone is ringing. ” (RI) Remote DTE: “Well, answer it!” 4. (4 – 7) Modems send a Carrier Wave. In a full-duplex environment, CD, RTS and CTS are constantly asserted. 8. Local DTE: Data Transmitted on TD. Local DCE: Data Received on TD and sent out on telephone line to Remote DCE: Data Received on telephone line and sent to Remote DTE on RD. Remote DTE: Data Received on RD. 9. Remote DTE: Data Transmitted on TD. Remote DCE: Data Received on TD and sent out on telephone line to Local DCE: Data Received on telephone line and sent to Local DTE on RD. Local DTE: Data Received on RD. 10. Local DTE: “Session is over, I am going to hang-up and drops the DTR. ” Local DCE: “Hey, DTR is dropped, so I am going to drop the Carrier Wave to the Remote DCE: “Hey, there is no carrier wave, I am going to drop CD to Remote DTE. ” Remote DTE: “Hey, there is not Carrier, so the session must be over and so am I. ” Rick Graziani, graziani@cabrillo. edu 19

RS-232 – More info (FYI) n n Differences in pinning between DTE to DCE

RS-232 – More info (FYI) n n Differences in pinning between DTE to DCE and DTE to DTE. See Andy. Whittaker. com for more info: http: //www. andywhittaker. com/ecu/rs 232. htm Rick Graziani, graziani@cabrillo. edu 20

For More On Channel Coding Schemes Unipolar NRZ Polar NRZI Manchester Differential Manchester n

For More On Channel Coding Schemes Unipolar NRZ Polar NRZI Manchester Differential Manchester n For more information on other Channel Coding Schemes, including AMI, B 8 ZS, and others, check out various data communications books and articles. Rick Graziani, graziani@cabrillo. edu 21

5. 5 Baud Rate, Framing, and Errors n n Baud rate is better explained

5. 5 Baud Rate, Framing, and Errors n n Baud rate is better explained in the next Comer chapter, after we have had a chance to explain frequency, amplitude, and phase shift. The rest of this section is FYI. Rick Graziani, graziani@cabrillo. edu 22

5. 6 Full Duplex Asynchronous Comms. n n n Simplex Transmission: One way and

5. 6 Full Duplex Asynchronous Comms. n n n Simplex Transmission: One way and one way only. (Note: Comer does not differentiate between simplex and half-duplex. ) n One way street Half-duplex Transmission: Either way, but only one way at a time. n Two way street, but only one way at a time (land slide). Full-duplex Transmission: Both ways at the same time. n Two way street Rick Graziani, graziani@cabrillo. edu 23

5. 6 Full Duplex Asynchronous Comms. n n Minimal wiring required for full-duplex RS-232

5. 6 Full Duplex Asynchronous Comms. n n Minimal wiring required for full-duplex RS-232 communications. When using coax cable, signal is sent along the center conductor, and the shield provides a return path. Rick Graziani, graziani@cabrillo. edu 24

5. 7 Limitations of Real Hardware n n Samples are taken at the middle

5. 7 Limitations of Real Hardware n n Samples are taken at the middle of the time allocated to the bit in order to take into account imperfections in voltage. More information in Channel Coding presentation. Rick Graziani, graziani@cabrillo. edu 25

5. 8 Hardware Bandwidth and the Transmission of Bits n n In an attempt

5. 8 Hardware Bandwidth and the Transmission of Bits n n In an attempt to be brief, Comer is not complete in this section. Instead, we will cover this information in the next chapter from Comer, (Chapter 6 Long Distance Communication) and use information from Data Communication sources as well. Rick Graziani, graziani@cabrillo. edu 26

Possible Final Projects n n n To do justice to these subjects, we would

Possible Final Projects n n n To do justice to these subjects, we would need to spend more time than allocated by Comer. Instead, we will make these possible topics for final projects. n 5. 9 The Effect of Noise on Communications n 5. 10 Significance For Data Networking n Nyquist Theorem n Shannon’s Theorem or Shannon’s Law Other possible topics for final projects from this area: n Channel-coding schemes n Details of the operation of RS-232 n How coaxial cable is used for transmissions. Rick Graziani, graziani@cabrillo. edu 27

Chapter 5 – Local Asynchronous Communications (RS-232) Computer Networks and Internets by Douglas Comer

Chapter 5 – Local Asynchronous Communications (RS-232) Computer Networks and Internets by Douglas Comer Instructor: Rick Graziani, August 1, 2002 CST 311 Introduction to Telecommunications Includes material from other sources. University transferable option of CIS 181 at Cabrillo College Rick Graziani graziani@cabrillo. edu Rick_Graziani@csumb. edu 28