Chapter 2 - Data Transmission
Chapter 2 - Data Transmission
(Chapter 2)
Syllabus Content:
1
Syllabus Content:
2
2 Data Transmission
NOTE: Data Packets & Packet Switching are newly added topics in the Computer
Science (2210) syllabus for the session 2023–2025.
Packet Structure:
A packet of data in a unit of data has a packet header.
The header contains the destination address, packet number & the originator’s address.
The packet also has a payload and a trailer.
It stores data about the packet and its routing to ensure it reaches its destination.
It ensures that the message can be properly reconstructed.
3
Cyclic Redundancy Checks (CRCs):
Packet Switching:
The data is broken down into packets.
Each packet is given its own route.
The routing for a packet depends on the congestion.
The packets may not arrive in the order sent.
A large message is broken down into a group of smaller chunks of the same size called
packets.
Each packet is dispatched independently and may travel along different routes/paths.
A router controls the route taken by a packet and decides where to send packet next for the
most efficient path.
The packets may arrive out of order and are reassembled into the original message at the
destination (using the information sent in the packet header).
If packets are missing/corrupted, a re-transmission request is sent.
Function of a Router in Packet Switching:
4
Diagram of Packet Switching:
The message sent by computer ‘A’ was split into four packets.
The original packet order was:
They arrived in the order:
It means they need to be reassembled in the correct order at the destination.
1. It makes best use of the available (channel) capacity by using alternative routes.
2. It ensures accurate delivery of the message.
3. The use of alternative routes is more secure as harder to intercept messages.
4. It provides better security as packets are hashed and sent by different routes.
5. The use of alternative routes is more robust, and path/route is also available to other users.
6. The missing packets can be easily detected and a re-sent request is sent so the message
arrives complete.
7. If a network changes, the router can detect this and send the data another way to ensure it
arrives.
8. It doesn’t use whole/complete bandwidth.
9. It allows simultaneous use of channels by multiple users.
Disadvantages of Packet Switching:
1. There are time delays to reassemble packets at the destination and correcting errors.
2. The packets can be lost and need to be re-sent.
3. The network problems may introduce errors in packets.
4. It requires complex protocols for delivery.
5. It is unsuitable for real-time transmission applications/real-time streaming e.g. a live
sporting event being transmitted over the internet.
5
Uses of Packet Switching:
Hopping:
Sometimes it is possible for packets to get lost and keep ‘bouncing’ around from router to
router and never actually get to their destination.
Eventually, the network could grind to a halt as the number of ‘lost’ packets mounts up and
clogs up the system.
To overcome this, a method called hopping is used.
Process of Hopping:
If the packet has not reached its destination and the hop number becomes 0, then the
packet will be deleted when it reaches the next router.
The missing packets will then be flagged by the receiving computer and the request to re-
send these packets will be made.
6
Exam Style Questions:
Question 1:
Answer:
7
Question 2:
Answer:
Question 3:
8
Answer:
Question 4:
9
Answer:
10
2.1.2 Data Transmission:
According to our syllabus, we will consider three factors regarding data transmission:
11
Methods of Data Transmission: It means bits are sent one after the
other in a single stream.
1) Serial Data Transmission:
It is when data is sent, one bit at a time, over a single wire or channel.
The bits arrive in sequence.
It can be synchronous or asynchronous.
12
2) Parallel Data Transmission:
It is when several bits of data (usually 1 byte) are sent down several wires or channels at the
same time. (one wire or channel is used to transmit each bit)
The bits may arrive out of sequence.
It can only be synchronous.
1. The timing must be very accurate as there are no control bits sent along otherwise data will
be mixed up/skewed.
14
Exam Style Questions:
Exam Tip:
If examiner tells you that a person is using any of the following be it:
And asks you to explain why the person is using that specific data transmission
method. Just remember that you have to address both parts of the questions to gain
full marks. This kind of question is mostly asked for 4 marks and above.
One part will address the advantages/benefits/choice of using either serial or parallel
transmission.
The other part will address the advantages/benefits/choice of using either simplex,
half-duplex or duplex transmission.
Question 1:
A computer includes an Integrated Circuit (IC) and a Universal Serial Bus (USB) for data
transmission. Describe how the computer uses these for data transmission, including the
type of data transmission used. (4)
15
Question 2:
Priya stores her website on a webserver. To transmit the website data to the webserver she
uses parallel duplex data transmission. Describe how data is transmitted using parallel
duplex data transmission. (4)
Question 3:
A file server is used as a central data store for a network of computers. Rory sends data from
his computer to a file server that is approximately 100 metres away. It is important that the
data is transmitted accurately. Rory needs to be able to read data from and write data to the
file server at the same time.
Identify the most suitable data transmission methods for this application: (2)
Serial ✓ Simplex
Parallel Half-duplex
Duplex ✓
Explain why your answer is the most suitable data transmission. (4)
Serial duplex is used since serial uses a single wire hence there is a less chance of
interference.
It is more reliable over longer distances (100 metres and above).
It is more accurate and bits won’t be skewed over a long distance.
Moreover, duplex transmits data in both directions simultaneously which allows read and
write operations at the same time.
Read and write at the same time won’t be allowed by other methods such as simplex and
half-duplex.
Question 5:
A company has over 100 cameras. At the end of each day all these cameras send their
images, capture over the last 24 hours, to a central computer.
Explain why a company uses dedicated fibre optic cable rather than transmitting the data
over the local broadband network? (2)
17
Answer:
18
Question 7:
19
Answer:
20
Question 8:
Answer:
21
Question 9:
Answer:
22
Question 10:
Answer:
23
Question 11:
Answer:
24
Question 12:
Answer:
25
2.1.3 Universal Serial Bus (USB):
It is an asynchronous serial data transmission method.
It uses serial transmission so bits of data are sent one at a time.
It is a Universal standard used for transfer of data between a computer and devices.
The USB allows both half-duplex and full-duplex data transmission.
The computer automatically detects the presence of device due to slight change in voltage
level.
The device is automatically recognized, and the appropriate device driver is loaded.
If a new device is detected, the computer looks up the device driver which matches the
device; if it’s unavailable, the user is prompted to download the appropriate software.
Exam Tip:
1. Memorize any four of the advantages and use them when the question demands an
explanation of any number of advantages.
2. If question simply demands stating of advantages (no explanation), then write according
to marks by summarizing the following given points.
1. The devices are automatically detected and configured when initially attached due to
changes in voltage level.
2. It is a universal standard so it is likely to be compatible with every computer.
3. It is impossible to connect device incorrectly as connector only fits one way.
4. It is a high-speed connection so data will be transmitted quicker.
5. It uses serial transmission so it is cheaper to manufacture/buy and less chance of skewing of
data.
6. It doesn't require a wireless network therefore, can be used if a network is down.
7. It is backwards compatible (with earlier versions of USB ports) so no additional technology
is needed.
8. It can power the device therefore no separate source of power is needed.
9. The drivers are automatically downloaded so there is no need to find them online or install
manually.
26
Disadvantages of USB Systems:
1. The maximum cable length is presently about 5 metres.
2. The present transmission rate is limited to less than 500 megabits per second.
3. The older USB standard (e.g. 1.1) may not be supported in near future.
USB-C System:
USB-C is a new type of USB connector which has now become more common in laptops
and tablets/phones.
It is a 24-pin symmetrical connector which means it will fit into a USB-C port either way
round.
It is expected to become the new industry standard (universal) format.
Advantages of USB-C:
27
Exam Style Questions:
Question 1:
Answer:
28
Question 2:
Answer:
29
Question 3:
Answer:
30
Question 4:
Answer:
31
2 Data Transmission
1. Interference as all types of cable can suffer from electrical interference, which can cause
data to be corrupted or even lost.
2. Problems during packet switching which can lead to data loss or data gain
3. Skewing of data which occurs during parallel data transmission can cause data corruption if
the bits arrive out of synchronization.
There are a number of error detection methods for detecting errors in data after
transmission:
1. Parity checks (odd and even), including parity byte & parity block check
2. Checksum
3. Echo Check
32
Question: Describe a situation in which a parity check cannot detect corruption of a byte OR
describe a situation in which an error during parity check goes undetected.
1. Error will not be detected if there are multiple errors in same byte that still produce the
same parity bit.
2. It will not be detected if an even/odd number of digits are changed (depending upon
even/odd parity used).
3. It will not be detected if a transposition error has occurred.
NOTE: The following steps explain the way of solving practical parity checking questions asked
in examination mostly. Theoretical knowledge of parity checking given above is rarely asked.
1) Systems that use EVEN PARITY have an even number of 1- bits; systems that use ODD
PARITY have an odd number of 1-bits.
2) If it is given in a question that even parity is used and an incomplete register like below is
given, you need to count the number of 1’s to see if they are even or odd. If they are even
already, then simply add 0’s in the blank space. If 1’s are odd, then you need to balance and
write 1’s until the total number of 1’s become even.
3) Similarly, if it is given in a question that odd parity is used and an incomplete register like
above is given, you need to count the number of 1’s to see if they are even or odd. If they are
odd already, then simply add 0’s in the blank space. If 1’s are even, then you need to balance
and write 1’s until the total number of 1’s become odd.
4) If the examiner gives you a complete register filled with 8 bits, and tells you that even parity
is used, asking you to identify if the data was transmitted correctly. You simply need to count
the number of 1’s in the register and check if they are even. If they are even, then data was
transmitted correctly and if they are odd then it was corrupted during transmission.
5) Similarly, if the examiner gives you a complete register filled with 8 bits, and tells you that
odd parity is used, asking you to identify if the data was transmitted correctly. You simply
need to count the number of 1’s in the register and check if they are odd. If they are odd then
data was transmitted correctly and if they are even then it was corrupted during transmission.
33
Practice Questions:
11001000
01111100
01101001
10110100
01101101
10000001
Q3.
34
Q4.
Q5.
Q6.
35
Practical Method/Approach of Parity Block Checking:
In this method, a block of data is sent, and the number of 1-bits are totaled horizontally and
vertically (in other words, a parity check is done in both horizontal and vertical directions).
As the following example shows, this method not only identifies that an error has occurred but
also indicates where the error is.
36
1) First we need to see what type of parity is used.
2) According to the even/odd parity used, we need to count 1’s in all columns and check which of
the column does not follow the even/odd parity used.
3) Then we need to count 1’s in all bytes (rows) and check which of the rows does not follow the
even/odd parity used.
4) The intersection point of that column and byte gives the corrupted bit.
5) If the examiner asks you to circle the corrupted bit, then simply encircle the bit at the
intersection point.
6) If the examiner asks you to write byte number and column number, simply write the byte
number with wrong parity and the column number with wrong parity in the provided space.
(iii) How did you arrive to your answer in part (i)(ii)? (2) *The corrupted bit has been
Column 4 has odd number of 1’s (3 ones). encircled as well for you to
Byte 5 has odd number of 1’s (5 ones). understand (though it is not the
requirement of this question)*
37
Exam Style Questions:
Question 1:
38
Answer:
Question 2:
39
Answer:
Register C
Question 3:
40
Answer:
Register Y
41
2) Checksum:
Before transmission, calculation is performed on data to get an additional value called
checksum using an algorithm.
The value is then transmitted with the block of data.
The value is recalculated by the receiver using same algorithm on the block of data
received.
A comparison is made between checksum values before and after transmission.
If checksum values are different, then error is detected, and retransmission request is sent.
If checksum values are the same, then data has been transmitted correctly.
3) Echo Check:
When data is sent to another device, 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.
It is not very reliable because if both sets of data are different, it is not known whether the
error occurred while sending the data in first place, or when sending the data back for
checking to the sender.
42
2.2.3 Check Digits:
They are used to identify errors in data entry caused by mistyping or mis-scanning a
barcode.
They are used for barcodes on products, such as International Standard Book Numbers
(ISBN)(found on the cover of a book) and Vehicle Identification Numbers (VIN).
There are a number of different methods used to generate a check digit. Two common
methods will be considered here:
1. ISBN 13
2. Modulo-11
NOTE: You will not need to remember the steps shown in following algorithms as the steps
will be given to you in the question. However, it is important that you understand how to use
an algorithm to calculate or verify check digits. Therefore, study the following examples &
. calculations very carefully so you can learn how to apply these steps.
1) ISBN 13:
As the ‘13’ in the ISBN 13 suggests, the check digit in ISBN 13 is the thirteenth digit in the
number.
This 13th digit (check digit) is generated from the other 12 digits in the number.
43
Steps of Calculation (without check digit):
Example Calculation 1: Generation of the check digit from the other 12 digits in a number
We will use the following sample barcode (ISBN 13 code with check digit):
9 7 8 0 3 4 0 9 8 3 8 2
odd even odd even odd even odd even odd even odd even
Step 1 – 9 + 8 + 3 + 0 + 8 + 8 = 36
Step 2 – 3 x (7 + 0 + 4 + 9 + 3 + 2) = 3 x (25) = 75
44
To check that an ISBN 13-digit code is correct, including its check digit, similar steps are followed.
1. Add all the odd numbered digits together, including the check digit.
2. Add all the even numbered digits together and multiply the result by 3.
3. Add the results from Step 1 & Step 2 together and divide by 10.
4. The number is correct if the remainder is 0 (zero).
Example Calculation 2: Re-calculation of the check digit from the thirteen-digit number
(which now includes the check digit)
We will use the same following barcode (ISBN 13 code with check digit):
9 7 8 0 3 4 0 9 8 3 8 2 9
odd even odd even odd even odd even odd even odd even odd
Step 1 – 9 + 8 + 3 + 0 + 8 + 8 + 9 = 45
Step 2 – 3 x (7 + 0 + 4 + 9 + 3 + 2) = 3 x (25) = 75
45
2) Modulo-11:
This method can have different lengths of number which makes it suitable for many
applications, such as product codes or VINs.
Steps of Calculation:
The following algorithm is used to generate the check digit for a number with seven digits:
1. Each digit in the number is given a weighting of 8, 7, 6, 5, 4, 3, or 2 starting from the left
(weightings start from 8 since the number will become eight-digit when the check digit is
added).
2. The digit is multiplied by its weighting and then each value is added to make a total.
3. The total is divided by 11.
4. The remainder is then subtracted from 11 which gives the value of check digit and if the
remainder is 10 then check digit ‘X’ is used.
Example Calculation 1: Generation of the check digit from the other digits in a number
4 1 5 6 7 1 0
8 7 6 5 4 3 2
Step 1 – Each digit is given weightings starting from left, e.g. digit 4 has weighting 8 and so on.
46
To check that the eight-digit number is correct, including its check digit, similar steps are followed.
1. Each digit in the number is given a weighting of 8, 7, 6, 5, 4, 3, 2 or 1 starting from the left.
2. The digit is multiplied by its weighting and then each value is added to make a total.
3. The total is divided by 11.
4. The number is correct if the remainder is 0 (zero)..
Example Calculation 2: Re-calculation of the check digit from the eight-digit number (which
now includes the check digit)
4 1 5 6 7 1 0 2
8 7 6 5 4 3 2 1
Step 1 – Each digit is given weightings starting from left, e.g. digit 4 has weighting 8 and so on.
47
Practice Questions
Q1.
48
Q2.
49
2.2.4 Automatic Repeat Query (ARQ):
They are used to establish that data is received without error.
Timeout:
50
Exam Style Questions:
Question 1:
A library’s archive system uses an error detection and correction system that combines a
parity check with an automatic repeat request (ARQ)
Describe how this system uses the parity check and ARQ. (6)
Exam Tip:
Each error-checking method is asked for no more than 4 marks in an exam.
The examiner can either give a specific error-checking method alone for 4 marks or ask
you to write any one of your choices.
Question 2:
There are various methods used to detect errors that can occur during data transmission and
storage.
1) Parity check
2) Check digit
3) Checksum
Exam Tip:
Since 4 methods are asked and 8 marks are assigned, each method will be answered for
no more than 2 marks so (2 x 4 = 8 marks).
51
Question 3:
Data can sometimes be corrupted when it is transmitted from one computer to another,
causing errors to be present in the data.
Identify and describe three methods of error detection that could be used to see if an error
has occurred. [9]
Exam Tip:
Since 3 methods are asked and 9 marks are assigned, each method will be answered for
no more than 3 marks so (3 x 3 = 9 marks).
Question 4:
52
Answer:
Question 5:
53
Answer:
Question 6:
Answer:
54
Question 7:
Answer:
55
2 Data Transmission
2.3 | Encryption
Under these circumstances, a hacker is often referred to as an eavesdropper. The use of encryption
helps to minimize this risk.
It is used so that data cannot be understood if intercepted without the decryption key.
Encryption:
It is scrambling for data to make it meaningless.
It uses an encryption algorithm and key to encrypt data and decryption key to decipher
encrypted message.
Encryption is used primarily to protect data in case it has been hacked while encryption
won’t prevent hacking, it simply makes the data meaningless to the eavesdropper unless
the recipient has the necessary decryption tools.
This is particularly important if the data is sensitive or confidential such as credit card/bank
details, medical history, or legal documents etc.
56
General procedure/working of encryption:
Types of Encryptions:
1) Symmetric encryption
2) Asymmetric encryption
Some data is encrypted with an 8-bit key. How this encryption can be made more secure:
It can be made more secure by increasing the length of the key such as making the key 12-
bit or more etc.
It will generate more possibilities for key and hence less chance of decryption by brute force
method.
57
A system uses 64-bit symmetric encryption. How increase the level of security provided by
the encryption:
The length of the key can be increased by using more bits for the encryption key.
It will generate more possibilities for key and hence less chance of decryption by brute force
method.
A system uses 128-bit symmetric encryption. How the strength of encryption can be
improved:
The length of the key can be increased by using more than 128 bits for the encryption key.
A more complex encryption algorithm can be used.
It will generate more possibilities for key and hence less chance of decryption by brute force
method.
The modern computers can crack the encryption key in a matter of seconds.
Solution:
To overcome this issue, we now use 256-bit binary encryption keys that give 2256
(approximately 1.2 x 1077) possible combinations.
The same key is used for encryption & decryption and so required for both sender and
recipient.
Therefore, the key has to be sent in an email or text message to the recipient which can be
intercepted by, for example, a hacker which puts the security of encrypted message at risk.
The real difficulty is keeping the encryption key a secret and so this security issue referred
to as the key distribution problem is the main drawback of symmetrical encryption.
Solution:
A system based on Modulo-11 can be used, where both sender and receiver can calculate the
encryption key without it actually being exchanged in any way electronically.
The following routine shows how both the sender and recipient end up with the same key
without sending the actual key electronically (using Modulo-11):
The table below is an encryption algorithm through which messages are produced in
encrypted form.
The algorithm uses an encryption key to produce a message which appears meaningless
unless the same key is applied to decrypt the original message.
58
Drawbacks of Symmetric Key Encryption:
1. The key has to be exchanged very securely.
2. Once the key is compromised then it can be used to decrypt both sent and received
messages.
3. Symmetric encryption cannot ensure non-repudiation (proof of integrity & origin of data).
59
Examples of Symmetric Encryption System:
1) A simple system is considered that uses a 10-digit denary encryption key and a decryption
key (this gives 1 x1010 possible combinations). Suppose our encryption key is:
4 2 9 1 3 6 2 8 5 6 (10-digits)
which means every letter in a word is shifted across the alphabet +4, +2, +9, +1, and so on,
places.
Plain Text C O M P U T E R S C I E N C E I S B E S T
Key Applied 4 2 9 1 3 6 2 8 5 6 4 2 9 1 3 6 2 8 5 6 4
Cipher Text G Q V Q X Z G Z X I M G W D H O U M C I M
one sequence of encryption key applied another sequence of encryption key applied
again
When the encryption key is applied to plain text, the following process happens: another
sequence of
When key is applied to plain letter ‘C’:
encryption
C + shifting 4 letters = D → E → F → G key applied
Cipher Text of ‘C’ = ‘G’
O + shifting 2 letters = P → Q
Cipher Text of ‘O’ = ‘Q’
M + shifting 9 letters = N → O → P → Q → R → S → T → U → V
Cipher Text of ‘M’ = ‘V’
P + shifting 1 letter = Q
Cipher Text of ‘P’ = ‘Q’ and so on…
60
For decryption, the same key will be used to get back to original message, but the
decryption process would be the reverse of the encryption:
–4 –2 –9 –1 –3 –6 –2 –8 –5 –6 (10-digits)
which means every letter in a word is shifted backward -4, -2, -9, -1, and so on.
When the decryption key is applied (same key) to cipher text, the following process
happens:
2) In a simple symmetric encryption system, each letter of the alphabet is substituted with
another.
Hello World
Nmilozgu Pnwgyng
61
3) A simple symmetric encryption system is used to encrypt messages. Each letter of the
alphabet is substituted by another letter.
Plain text
a b c d e f g h i j k l m n o p q r s t u v w x y z
Cypher text
v p n a q b r u z s c o y k w f x i e m d j t l h g
◼ a v m v (data)
◼ e q n d i z m h (security)
a v m v e q n d i z m h (data security)
A new cypher text is created by shifting each letter of the alphabet five places to the right.
Showing the new cypher text below:
Plain text
a b c d e f g h i j k l m n o p q r s t u v w x y z
v w x y z a b c d e f g h i j k l m n o p q r s t u
62
2) Asymmetric Encryption:
It is a more secure method which overcomes security problems associated with symmetric
encryption.
It makes use of two types of keys, called the public key and the private key:
Public Key:
◼ This key is widely available and can be used to encrypt message that only the owner of
private key can decrypt.
Note:
NOTE: A number of examples have been given on the next page to better explain how
asymmetric key encryption works. The standard procedure of asymmetric encryption
including concepts of sender, receiver, public key, private key, encryption & decryption is
same for all the examples, but they have been given for you to understand how to apply
these concepts according to different scenarios asked in examination paper.
63
Examples of Asymmetric Encryption:
1) Wiktor is an employee of a travel agent. He uses asymmetric encryption to send
confidential information to this female manager and the manager also replies confidentially.
How data is encrypted using asymmetric key encryption:
It uses different keys for encrypting (public key) and decrypting data (private key).
When Wiktor sends a message to his manager, the message is encrypted into cipher text
using his managers public key.
When the manager receives the message, it is decrypted using her private key.
When the manager replies, the message is encrypted using Wiktor’s public key.
When Wiktor receives the message, it is decrypted into plain text using his private key.
2) Ben wants to send a highly confidential email to Mariah so that only she can read it. How
data is encrypted using asymmetric key encryption:
It uses different keys for encrypting (public key) and decrypting data (private key).
Ben acquires Mariah’s public key.
Ben encrypts the email using Mariah’s public key.
Ben sends the encrypted email to Mariah.
Mariah decrypts the email using her private key.
3) Some data is being sent from one computer user to another over the internet. How data
is encrypted using asymmetric key encryption:
4) Mohammad is working away from his company’s head office. He wants to send a secure
message over a computer network to the head office. How data is encrypted using
asymmetric key encryption:
Two matching keys are used, one public & one private.
Mohammad obtains the public key of head office.
Before a message is sent, the message is encrypted by (sender’s computer) using the public
key of the head office.
When the message is received at head office, it is decrypted by (receivers computer) using
private key of the head office.
64
5) Laura wants to send an important message to her bank over the internet. How data is
encrypted using asymmetric key encryption:
Two matching keys are used, one public & one private.
Laura obtains the public key of the bank.
Before a message is sent, the message is encrypted by (sender’s computer) using the public
key of the bank.
When the message is received at bank’s computer, the message is decrypted by (receivers
computer) using private key of the bank.
65
Exam Style Questions:
Question 1:
Answer:
66
Question 2:
Answer:
67
Question 3:
Answer:
Question 4:
68
Answer:
Question 5:
Answer:
69
Question 6:
Answer:
Question 7:
70
Answer:
Question 8:
Answer:
71
Question 9:
Answer:
72
Question 10:
Answer:
73
Question 11:
Answer:
74
Question 12:
Answer:
75