ct101_datacommunication

Upload: muneeb-ahmad

Post on 14-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 CT101_DataCommunication

    1/23

    Data Communication

    CT101 - Computing Systems

  • 7/30/2019 CT101_DataCommunication

    2/23

    Contents

    Data Transmission Circuits

    Parallel and Serial Data Transmission

    Asynchronous Serial Transmission

    Synchronous Serial Transmission

    Data Communication Terminology

    Channel, baud rate, bits per second, bandwidth

    Protocols Asynchronous and synchronous protocols

    Data Multiplexing

    Time division multiplexing and frequency division multiplexing

    Modems

    Summary

  • 7/30/2019 CT101_DataCommunication

    3/23

    Data Transmission

    Data transmission is the transfer of data frompoint-to-point often represented as an

    electromagnetic signal over a physical point-to-point

    or point-to-multipoint communication channel

    A communication channel refers to the medium used

    to convey information from a sender (or transmitter)

    to a receiver, and it can use fully or partially the

    medium.

    Examples of channels: copper wires, optical fibbers

    or wireless communication channels.

  • 7/30/2019 CT101_DataCommunication

    4/23

    Data Communication Channels

    The following is a discussion on the THREE main types of transmission circuits (channels),

    simplex, half duplex and full duplex. Simplex

    Data in a simplex channel is always one way. Simplex channels are not often used because it is notpossible to send back error or control signals to the transmit end. An example of a simplex channelin a computer system is the interface between the keyboard and the computer, in that key codes needonly be sent one way from the keyboard to the computer system.

    Half Duplex

    A half duplex channel can send and receive, but not at the same time. Its like a one-lane bridgewhere two way traffic must give way in order to cross. Only one end transmits at a time, the otherend receives.

    Full Duplex Data can travel in both directions simultaneously. There is no need to switch from transmit to

    receive mode like in half duplex. Its like a two lane bridge on a two-lane highway.

  • 7/30/2019 CT101_DataCommunication

    5/23

    Parallel and Serial Data

    Data may be transmitted between two points in two different ways.Lets consider sending 8 bits of digital data (1 byte)

    Parallel transmission Each bit uses a separate wire

    To transfer data on a parallel link, a separate line is used as a clock signal. This

    serves to inform the receiver when data is available. In addition, another linemay be used by the receiver to inform the sender that the data has been used,and its ready for the next data.

  • 7/30/2019 CT101_DataCommunication

    6/23

    Parallel and Serial Data

    Serial Each bit is sent over a single wire, one after the other Usually no signal lines are used to convey clock (timing information)

    There are two types of serial transmission, essentially having to do with how the clock isembedded into the serial data

    Asynchronous serial transmission

    Synchronous serial transmission

    If no clock information was sent, the receiver would misinterpret the arriving data(due to bits being lost, going too slow).

    Parallel transmission is obviously faster, in that all bits are sent at the same time,whereas serial transmission is slower, because only one bit can be sent at a time.Parallel transmission is very costly for anything except short links.

  • 7/30/2019 CT101_DataCommunication

    7/23

    Asynchronous Serial Transmission

    (RS232 Example) Because no signal lines are used to convey clock (timing) information, this method groups

    data together into a sequence of bits (five to eight), then prefixes them with a start bit and astop bit. This is the method most widely used for PC or simple terminal serialcommunications.

    In asynchronous serial communication, the electrical interface is held in the markpositionbetween characters. The start of transmission of a character is signaled by a drop in signallevel to the space level. At this point, the receiver starts its clock. After one bit time (the startbit) 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 readcorrectly 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. Alittle arithmetic will show that for a 10 bit sequence, the last bit will be interpreted correctlyeven if the sender and receiver clocks differ by as much as 5%.

    It is relatively simple, and therefore inexpensive. However, it has a high overhead, in thateach byte carries at least two extra bits: a 20% loss of line bandwidth.

  • 7/30/2019 CT101_DataCommunication

    8/23

    Synchronous Serial Transmission

    (PS2 Example) The PS/2 mouse and keyboard implement a bidirectional synchronous serial protocol.

    The bus is "idle" when both lines are high (open-collector). This is the only state where the

    keyboard/mouse is allowed begin transmitting data. The host has ultimate control over the

    bus and may inhibit communication at any time by pulling the Clock line low.

    The device (slave) always generates the clock signal. If the host wants to send data, it must

    first inhibit communication from the device by pulling Clock low. The host then pulls Data

    low and releases Clock. This is the "Request-to-Send" state and signals the device to startgenerating clock pulses.

    Summary: Bus States

    Data = high, Clock = high: Idle state.

    Data = high, Clock = low: Communication Inhibited.

    Data = low, Clock = high: Host Request-to-Send

    Data is transmited 1 byte at a time:

    1 start bit. This is always 0.

    8 data bits, least significant bit first.

    1 parity bit (odd parity - The number of 1's ithe data bits plus the parity bit always add up

    to an odd number. This is used for error

    detection.).

    1 stop bit. This is always 1.

    1 acknowledge bit (host-to-device

    communication only)

  • 7/30/2019 CT101_DataCommunication

    9/23

    Serial CommunicationName Sync

    /Async

    Type Duplex Max

    devices

    Max

    speed(Kbps)

    Max

    distance(feet)

    Pin

    count(not including ground)

    RS-232 async peer full 2 115.2 30 2 (or 4 with HW handshake)

    RS-422 async multi-drop half 10 10000 4,000 1 (unidirectional only,additional pins for each

    bidirectional comm.)

    RS-485 async multi-point half 32 10000 4,000 2

    I2C sync multi-

    master

    halfLimitation based

    on bus

    capacitance and

    bit rate

    3400 1000 625

  • 7/30/2019 CT101_DataCommunication

    10/23

    Data Communication Terminology

    Channel A channel is a portion of the communications medium allocated to the sender

    and receiver for conveying information between them. The communicationsmedium is often subdivided into a number of separate paths, each of which isused by a sender and receiver for communication purposes.

    Baud Rate

    Baud rate is the same as symbol rate and is a measure of the number of linechanges which occur every second. Each symbol can represent or convey one(binary encoded signal) or several bits of data. For a binary signal of 20Hz, thisis equivalent to 20 baud (there are 20 changes per second).

    Bits Per Second This is an expression of the number of data bits per second. Where a binary

    signal is being used, this is the same as the baud rate. When the signal ischanged to another form, it will not be equal to the baud rate, as each linechange can represent more than one bit (either two or four bits).

    Bandwidth Bandwidth is the frequency range of a channel, measured as the difference

    between the highest and lowest frequencies that the channel supports. The

    maximum transmission speed is dependant upon the available bandwidth. Thelarger the bandwidth, the higher the transmission speed.

  • 7/30/2019 CT101_DataCommunication

    11/23

    Protocols and Synchronization

    Protocols A protocol is a set of rules which governs how data is sent from one point to another. In

    data communications, there are widely accepted protocols for sending data. Both thesender and receiver must use the same protocol when communicating.

    BY CONVENTION, THE LEAST SIGNIFICANT BIT IS TRANSMITTED FIRST(Network order)

    ASYNCHRONOUS PROTOCOLS

    Asynchronous systems send data bytes between the sender and receiver. Each data byte ispreceded with a start bit, and suffixed with a stop bit. These extra bits serve tosynchronize the receiver with the sender.

    Transmission of these extra bits (2 per byte) reduce data throughput. Synchronization isachieved for each character only. When the sender has no data to transmit, the line is idleand the sender and receiver are NOT in synchronization. Asynchronous protocols aresuited for low speed data communications.

    SYNCHRONOUS PROTOCOLS Synchronous protocols involve sending timing information along with the data bytes, so

    that the receiver can remain in synchronization with the sender. When the sender has nodata to transmit, the sender transmits idle flags (a sequence of alternating 0's and 1's) tomaintain sender/receiver synchronization. Data bytes are packaged into chunks calledpackets, with address fields being added at the front (header) and checksums at the rearof the packet.

  • 7/30/2019 CT101_DataCommunication

    12/23

    Data Multiplexing

    A multiplexer is a device which shares a communication link betweena number of devices (users).

    Rather than provide a separate circuit for each device, the multiplexercombines each low speed circuit onto a single high speed link. Thecost of the single high speed link is less than the required number of

    low speed links. It does this by time or frequency division.

  • 7/30/2019 CT101_DataCommunication

    13/23

    Time Division Multiplexing

    In time division, the communications link is subdivided in terms oftime.

    Each sub-circuit is given the channel for a limited amount of time,before it is switched over to the next user, and so on

    In the picture bellow it can be seen that each sub-channel occupies the

    entire bandwidth of the channel, but only for a portion of the time

  • 7/30/2019 CT101_DataCommunication

    14/23

    Frequency Division Multiplexing

    In frequency division multiplexing, each sub-channel isseparated by frequency (each sub-channel is allocated partof the bandwidth of the main channel)

    The speed or bandwidth of the main link is the sum of theindividual sub-channel speeds or bandwidth.

  • 7/30/2019 CT101_DataCommunication

    15/23

    Modems

    Modems are devices which allow digital data signals to betransmitted across an analogue link.

    Modem stands for modulator/demodulator. A modemchanges the digital signal to an analogue frequency, and

    sends this tone across the analogue link. At the other end,another modem receives the signal and converts it back todigital.

  • 7/30/2019 CT101_DataCommunication

    16/23

    Modulation Techniques

    Modulation techniques are methods used to encode digitalinformation in an analogue world.

    There are three basic modulation techniques

    AM (amplitude modulation)

    FM (frequency modulation)

    PM (phase modulation)

    All 3 modulation techniques employ a carrier signal. A

    carrier signal is a single frequency that is used to carry theintelligence (data).

    For digital, the intelligence is either a 1 or 0.

    When we modulate the carrier , we are changing its characteristics

    to correspond to either a 1 or 0.

  • 7/30/2019 CT101_DataCommunication

    17/23

    Amplitude Modulation

    Modifies the amplitude of the carrier to represent 1s or 0s

    a 1 is represented by the presence of the carrier for a predefined period of 3 cycles of carrier.

    Absence or no carrier indicates a 0

    Pros

    Simple to design and implement

    Cons

    Noise spikes on transmission medium interfere with the carrier signal.

    Loss of connection is read as 0s.

  • 7/30/2019 CT101_DataCommunication

    18/23

    Frequency Modulation

    Modifies the frequency of the carrier to represent the 1s or 0s.

    a 0 is represented by the original carrier frequency

    a 1 by a much higher frequency ( the cycles are spaced closer together)

    Pros

    Immunity to noise on transmission medium.

    Always a signal present. Loss of signal easily detected

    Cons

    Requires 2 frequencies

    Detection circuit needs to recognize both frequencies when signal is lost.

  • 7/30/2019 CT101_DataCommunication

    19/23

    Phase Modulation

    Phase Modulation modifies the phase of the carrier to represent a 1 or 0.

    The carrier phase is switched at every occurrence of a 1 bit but remains unaffected for a 0 bit.

    The phase of the signal is measured relative to the phase of the preceding bit. The bits are timed to

    coincide with a specific number of carrier cycles (3 in this example = 1 bit)

    Pros

    Only 1 frequency used

    Easy to detect loss of carrier

    Cons

    Complex circuitry required to generate and detect phase changes

  • 7/30/2019 CT101_DataCommunication

    20/23

    Summary

    In simplex circuits, data only travels one way. In half-duplex circuits,

    data travels in both directions but not at the same time. In full-duplexcircuits, data can travel in both directions at the same time.

    Parallel circuits use a separate wire for each bit of data, and also usewires to convey timing information. Serial circuits use the same wirefor all data bits, and timing information is sent along with the data.

    Parallel transmission is faster. Examples of parallel circuits incomputers are the address, data and control bus.

    In asynchronous communication, each data element like a character isprefixed with a start and stop bit. In synchronous communication thedata is accompanied (either explicitly or implicitly) by a clock signal.

    A modem is a device which allows computer data to be sent over thetelephone (dial-up) networks

  • 7/30/2019 CT101_DataCommunication

    21/23

    Additional slides about Synchronous Protocols

  • 7/30/2019 CT101_DataCommunication

    22/23

    Synchronous Serial Transmission

    In fast speed synchronous communications, data is not sent in

    individual bytes, but as frames of large data blocks. Frame sizes varyfrom a few bytes through 1500 bytes for Ethernet.

    The clock is embedded in the data stream encoding, or provided onseparate clock lines such that the sender and receiver are always insynchronization during a frame transmission. Most modern WAN

    framing is built on the High-Level Data Link Control (HDLC) framestructure. An HDLC frame has the following general structure

    The flag is a sequence 01111110 which delimits the start of the frame.A technique known as bit stuffing is used to insert additional zerosinto the data so that a flag sequence never appears anywhere but at the

    start and end of a frame. These extra bits are "unstuffed" again by thereceiver.

  • 7/30/2019 CT101_DataCommunication

    23/23

    Synchronous Serial Transmission

    The address field is usually one byte, but may be more. It is used to indicate the sender or intended

    receiver of the frame. It is possible to have multiple stations connected to a single wire, and to design thesystem so that each receiver only "sees" frames with its own address. By this means multiple stations cancommunicate with each other using just one line (for instance on a Local Area Network).

    The control field is one or more bytes. It contains information on the type of frame (for instance,whether this is a frame containing user data or a supervisory frame which performs some sort of linkcontrol function). It also often contains a rotating sequence number that allows the receiver to checkthat no frame has been lost.

    The "payload" of the frame is the data field. The data in this field is completely transparent. In fact, it

    does not even have to be organized in 8 bit bytes, it is a purely arbitrary collection of bits. Following the data field are two bytes comprising the Cyclic Redundancy Check(CRC). The value of

    these bytes is the result of an arithmetic calculation based on every bit of data between the flags. Whenthe frame is received, the calculation is repeated and compared with the received CRC bytes. If theanswers match then we are sure to a very high degree of certainty that the frame has been receivedexactly as transmitted. If there is a CRC error the received frame is usually discarded.

    Finally, the frame is terminated by anotherflag character.

    Synchronous communication is usually muchmore efficient in use of bandwidth than Asynch. The datafield is usually large in comparison to the flag, control, address, and CRC fields, so there is very littleoverhead.