2 Data Transmission J24
2 Data Transmission J24
Data packets
Data sent over long distances is usually broken up into data packets. A packets of data are much easier to
control than a long continuous stream of data.
Packet structure
20
Packet switching
o Packet switching is a method of data transmission in which a message is broken up into a number of
packets
o Each packet is sent independently from start point to end point and will follow its own route
o At the destination, the packets are reassembled into their correct order (using the information sent in
the header).
o At each stage in the transmission, there are nodes that contain a router.
o Each router determines which route the packet needs to take, in order to reach its destination (the
destination IP address is used in this part of the process).
o routing selection depends on the number of packets waiting to be processed at each node
o the shortest possible path available is always selected which may not always be the shortest path, since
certain parts of the route may be too busy or not suitable
o packets can reach the destination in a different order to that in which they were sent.
Computer A
Router 1 Router 2
Router 3
4 3 1 2
o no need to tie up a single communication line o delay at the destination whilst the packets are being re-ordered.
o re-routing packets overcome failed/busy lines o packets can be lost and need to be re-sent
o high data transmission rate o more prone to errors with real-time streaming
o easy to expand package usage (ex a live sporting transmitted over the internet)
To avoid packets bounce around, Hop numbers are added to the header of each packet, this number is
reduced by 1 every time it leaves a router. When a hop is zero, and the packet hasn’t reached its destination,
then the packet is deleted when it reaches the next router.
21
Three factors are considered when transmitting data. Both sender and receiver must agree upon each factor
prior to data transmission.
1. the direction of the data transmission (simplex/ half duplex/ full duplex)
2. the mode/method of transmission (serial/ parallel)
3. the method of synchronisation between the two devices (synchronous/asynchronous)
Ex: a phone conversation between two people where only one person speaks at a time.
2. Method of transmission
Serial data transmission: data is sent one bit at a time, over a single wire/channel
More accurate/fewer errors over a longer distances, since only one wire/channel is used,
less chance of data being skewed/out of synchronisation/order
cheaper connection as one wire is used
less interference as only a single wire
disadvantage:
An example of its use is sending data from a computer to a modem for transmission over a telephone line.
A common use for serial data transmission is the Universal Serial Bus (USB).
22
Parallel data transmission: data are sent down several wires/channels at the same time; one wire or channel
is used to transmit each bit.
This method of data transmission works very well over short distances (over longer distances, the
bits can become skewed).
Parallel data transmission is a faster method of data transmission than serial.
The Universal Serial Bus (USB-A) is an asynchronous serial data transmission method.
devices plugged into the computer are automatically detected and device
drivers are automatically loaded up
connections can only fit one way preventing device incorrectly connected
is an industry standard
Can be used to charge devices
error-free data transmission as the USB protocol notifies the transmitter to re-
transmit data if any errors are detected
supported by many operating systems
backward compatible (older versions are still supported)
Drawbacks of a USB
23
USB-C is the latest type of USB connector, it is a symmetrical 24-pin USB connection
Advantages of using USB-C compared to USB-A
After data transmission, there is always the risk that the data has been corrupted
1. Parity checking
Method used to check whether data has been changed/corrupted following transmission from one device to
another.
Systems use even parity have an even number of 1- bits; systems that use odd parity have an odd number of
1-bits. Before data is transferred, sender and receiver agree on the type of parity used.
Example:
If this byte is using even parity, then the parity bit needs to be 0
If odd parity is being used, then the parity bit needs to be 1 to make the number of 1-bits odd.
Drawbacks:
If there are multiple errors in the same byte that still produce the same parity bit, the error will not be
detected
2 bits interchanged (e.g. 1 → 0 and 0 → 1) that won’t change parity value
even number of bits are transposed
Parity blocks is used to know exactly which bit has changed. A block of data is sent and the number of 1-bits
are totalled horizontally and vertically. This method indicates where the error is.
24
Example: Nine bytes of data have been transmitted. Even parity will be used.
Parity Byte, has also been sent. This byte consists entirely of the parity bits produced by the vertical parity
check. The parity byte also indicates the end of the block of data.
The following table shows how the data arrived at the receiving end:
• byte 8 (row 8) has incorrect parity (there are three 1-bits)
• bit 5 (column 5) also has incorrect parity (there are five 1-bits).
• The intersection of row 8 and column 5 gives the position of the but with error
25
2. Automatic Repeat Request (ARQ)
This is an error detection method that uses a positive/negative acknowledgement and timeout
Acknowledgements are messages sent by the receiver indicating that it has received a packet
Timeouts are pre-determined periods of time allowed to elapse before an acknowledgment is to be
received
Method
1. The sending computer transmits a block of data with a request to acknowledge data reception
2. the receiving computer receives an error detection code as part of the data (as CRC) to check if data
received contains an error
3. The sending computer waits a period of time (timeout) to see if the receiving computer acknowledges
receipt of the data (+ve or -ve)
4. After a set period of time, a timeout occurs which triggers the data to be automatically resent by the
sending computer
5. This will continue until the receiving computer acknowledges the data has been received
Timeout
3. Checksum
26
1. The checksum is calculated by the sending computer, from a block of data using an agreed algorithm
2. The data is then sent with the checksum (appended at the end of the data block)
3. The receiving computer re-calculates the checksum, using the same mathematical algorithm used by the
sending computer
5. if the two checksums match, then no transmission errors have occurred; otherwise a request is made to
re-send the block of data.
4. Echo check
1. a copy of the data is sent back to the sender
2. the returned data is compared with the original data by the sender’s computer
3. if there are no differences, then the data was sent without error
if the two sets of data are different, then an error occurred during the data transmission.
If the two sets of data are different, it is not known if the error occurred when originally sent, or when it
was sent back
Echo checks require a lot of extra data to be transmitted
27
Encryption
Encryption is the conversion of the original data (plain text) into a form that is unreadable (ciphertext) by
using an encryption algorithm
• Encryption protect data during transmission if intercepted by a hacker
• Encryption won’t prevent hacking, it makes the data meaningless unless the recipient has the necessary
decryption key
• The encryption algorithm applies an encryption/decryption keys to encrypt/decrypt the data
• The longer the key, the harder it is to figure out, e.g. a 256 bit key is more secure than a 128 bit key.
28
2) Asymmetric encryption
Asymmetric encryption is a form of encryption where a pair of keys (public key and private key) are
responsible for encrypting and decrypting data.
Public key is available to everybody; private key is only known only to the computer user; both are
needed to encrypt and decrypt messages
Encryption keys are generated by hashing algorithm – this translates the message or key into a string of
characters shown in hexadecimal; the greater the number of bits, the harder it is to crack the encryption
Ex. MD4 which generates a 128 – bit string
Asymmetric encryption uses a special pairing of keys:
Public key • Provided by the recipient
• It can be given to anyone who wishes to send encrypted data to the recipient
• Safe to share as all it can do is encrypt data
Example:
Tom and Jane work for the same company and Tom wishes to send a confidential document to Jane:
1. Jane uses an algorithm to generate a matching pair of keys (private and public) that they must keep
stored on their computers; the matching pairs of keys are mathematically linked but can’t be derived
from each other.
2. Jane now sends her public key to Tom.
3. Tom uses Jane’s public key to encrypt the document he wishes to send to her. He then sends his
encrypted document (ciphertext) back to Jane.
4. Jane uses her matching private key to unlock Tom’s document and decrypt it;
(this works because the public key used to encrypt the document and the private key used to decrypt it are a
matching pair generated on Jane’s computer. (Jane can’t use the public key to decrypt the message).
29
N.B.
Jane can also exchange her public key with any number of people working in the company, so she is able to
receive encrypted messages (which have been encrypted using her public key ) and she can then decrypt
them using her matching private key:
If a two-way communication is required between all five workers, then they all need to generate their
own matching public and private keys.
30