Chapter 2 - Data transmission 


Types and methods of data transmission

Data packets

  • Data sent over long distances is usually broken up into data packets.

  • Packet structure

A typical packet is split up into:

  • A packet header

  • IP address of the source device (sender)

  • IP address of the destination device (receiver)

  • Sequence number of the packet (allowing correct reassembly)

  • Size of the packets (in bytes)

  • The payload

  • The actual data in the packets - the payload

  • A trailer

  • Method of identifying the end of the packet

  • Some form of error checking to ensure packet arrives error-free

  • Cyclic redundancy checks (CRCs)

Packet switching

  • Each stage in the route contains a router. A router receives a data packet and, based on the information in the header, decides where to send it next.


  • Packet switching is a method of data transmission in which a message is broken from start point to end point.

  • Each packet can then be sent independently from start point to end point

  • At the destination, the packets will need to be reassembled into their correct order.

  • At each stage in the transmission, there are nodes that contain a router

  • Each router will determine which route the packet needs to take, in order to reach its destination.


Benefits of packet switching

  • No need to tie up a single communication line

  • Possible to overcome failed, busy or faulty lines by simply re-routing packets

  • Relatively easy to expand package usage

  • High data transmission rate is possible


Drawbacks of packet switching

  • Packets can be lost and need to be re-sent

  • Method is more prone to errors with real-time streaming

  • Delay at the destination whilst the packets are being re-ordered


Hopping

  • Method where a hop number is added to the header of each packet, and this number is reduced by 1 every time it leaves a router


Data transmission

  • Direction of data

  • Method of transmission

  • How will data be synchronised


Simplex, half-duplex and full-duplex

Simplex data transmission

  • Data can be sent in ONE DIRECTION ONLY


Half-duplex data transmission

  • Data can be sent in BOTH DIRECTIONS but NOT AT THE SAME TIME


Full-duplex data transmission

  • Data can be sent in BOTH DIRECTIONS AT THE SAME TIME


Serial and parallel data transmission

Serial data transmission

  • Data is sent ONE BIT AT A TIME over a SINGLE WIRE/CHANNEL

  • Bits are sent one after the other as a single stream.

  • Can be simplex, half-duplex or full-duplex

  • Works well over long distances

  • Data is transmitted at a slower rate than parallel data transmission

  • Data will arrive at its destination fully synchronised


Parallel data transmission

  • SEVERAL BITS OF DATA (usually one byte) are sent down SEVERAL CHANNELS/WIRES at the same time

  • Each channel/wire transmits one bit:

  • Can be simplex, half-duplex or full-duplex

  • Works well over short distances

  • Longer distances, data can be skewed

  • Arrive unsynchronised and arrive out of order

  • Longer the wire, the worse this can become

  • Faster method of data transmission than serial

  • Internal circuits in a computer use parallel data transmission since the distance travelled between components is very short and high-speed transmission is essential


Universal serial bus (USB)

  • Form of serial data transmission

  • Most common type of input/output port found on computers

  • Allows both half-duplex and full-duplex data transmission

  • Consists of a four-wire shielded cable, with two wires for power (red and black). The other two wires (white and green) are for data transmission.

  • When a device is plugged into a computer using one of the USB ports:

  • The computer automatically detects that a device is present

  • The device is automatically recognised, and the appropriate device driver software is loaded up so that the computer and device can communicate effectively

  • If a new device is detected, the computer will look for the device driver that matches the device; if this is not available, the user is prompted to download the appropriate driver software













  • Benefits and drawbacks of USB


Benefits

Drawbacks

Devices plugged into the computer are automatically detected and device drivers are automatically loaded up

Standard USB only supports a maximum cable length of 5 m; beyond that, USB hubs are needed to extend the cable length

Connections can only fit one way preventing incorrect connections being made

It has become an industry standard, which means considerable support is available

Even though USB is backward compatible, very early USB standards (V1) may not always be supported by the latest computers

Can support different data transmission rates (from 1.5 Mbps to 5 Gbps)

No need for external power source since cable supplies +5V power

Even the latest version 3 (V3) and version 4 (V4) USB-C systems have a data transfer rate which is slow compared to, for example, Ethernet connections (Note: USB V2 has a maximum data transfer rate of 480 Mbps.)

USB protocol notifies the transmitter to re-transmit data if any errors are detected; this leads to error-free data transmission

It is relatively easy to add more USB ports if necessary, by using USB hubs

USB is backward compatible (that is, older versions are still supported)




Methods of error detection

The need to check for errors

  • Errors can occur during data transmission due to:

  • Interference

  • Problems during packet switching

  • Skewing of data

  • Ways data can be checked for errors following transmission:

  • Parity checks

  • Checksum

  • Echo check





Parity checks

  • Used to check whether data has been changed or corrupted following data transmission

  • Based on the number of 1-bits in a byte of data

  • Parity can be either called EVEN or ODD

  • One of the bits in the byte is reserved for a parity bit

  • The parity bit is set according to whether the parity being used is even or odd


1

1

0

1

1

0

0

Parity bit

In this example, if the byte is using even parity, then the parity bit needs to be set to 0, since there is already an even number of 1-bits in the byte. We thus get:


0

1

1

0

1

1

0

0

Parity bit

In this example, if the byte is using odd parity, then the parity bit needs to be set to 1, since we need to have an odd number of 1-bits in the byte. We thus get:


1

1

1

0

1

1

0

0

Parity bit



Checksum

  • Used to check if data has been changed or corrupted following data transmission. 

  • Data is sent in blocks, and an additional value, called the checksum, is sent at the end of the block of data.

  • The checksum process is as follow:

  • When a block of data is about to be transmitted, the checksum is calculated from the block of data

  • The calculation is done using an agreed algorithm

  • The checksum is then transmitted with the block of data

  • At the receiving end, the checksum is recalculated by the computer using the block of data

  • The re-calculated checksum is then compared to the checksum sent with the data block

  • If the two checksums are the same, then no transmission errors have occurred; otherwise a request is made to re-send the block of data.







Echo check

  • When data is sent to another device, this data is sent back again to the sender

  • The sender’s computer compares the two sets of data to check if any errors occurred during the transmission process

  • Isn’t very reliable

  • If two sets of data are different, it isn’t known whether the error occurred when sending the data in the first place, or if the error occurred when sending the data back for checking

  • If no errors occurred, then it is another way to check that the data was transmitted correctly. In summary:

  • A copy of the data is sent back to the sender

  • The returned data is compared with the original data by the sender’s computer 

  • If there are no differences, then the data was sent without error

  • If the two sets of data are different, then an error occurred at some stage during the data transmission.




Check digits

  • The final digit included in a code; it is calculated from all the other digits in the code

  • Used for barcodes on products such as International Standard Book Numbers (ISBN) and Vehicle Identification Numbers (VIN) 

  • Used to identify eros in data entry caused by mis-typing or mis-scanning a barcode

  • Can usually detect the following types of errors:

  • An incorrect digit entered, ex. 5327 entered instead of 5307

  • Transportation errors where two numbers have changed order, ex. 5037 instead of 5307

  • Omitted or extra digits, ex. 537 instead of 5307 or 53107 instead of 5307

  • Phonetic errors, ex. 13(thirteen), instead of 30(thirty)


Automatic Repeat Requests (ARQs)

  • Used to check data following data transmission. In summary:

  • ARQ uses positive and negative acknowledgements and timeout

  • The receiving device receives an error detection code as part of the data transmission; this is used to detect whether the received data contains any transmission errors 

  • If no error is detected, a positive acknowledgement is sent back to the sending device

  • However, if an error is detected, the receiving device now sends a negative acknowledgement to the sending device and requests re-transmission of the data

  • A time out is used by the sending device by waiting a predetermined amount of time

  • And if no acknowledgement of any type has been received by the sending device within this time limit, it automatically re-sends the data until a positive acknowledgement is received

  • Or until a predetermined number of re-transmissions has taken place

  • ARQ is often used by mobile phone networks to guarantee data integrity