Chapter 2 Slides
Chapter 2 Slides
Data Transmission
IGCSE COMPUTER SCIENCE
Do your homework already?
YES!
Computer Science
A carregar…
is Easy
LESSON
OBJECTIVE
Any Route
P1
Secret
Message P2 Destination
P3
One disadvantage : Data needs to be reassembled when it reaches the
destination.
P1
Secret
Message Destination
P2
P3
1. The router/switch will determine the route of each packet.
2. Routing Selection depends on the number of packets waiting to be processed at
each node.
3. The shortest possible path available is always selected.
4. Packets can arrive in a different order compared to the way they were sent.
Benefits of packet switching
P1
A carregar…
A typical packet is split up into:
1110100110100
1111010010101 1 F F
5
Cyclic Redundancy Checks
2. Once the packet arrives, the receiving computer
Trailer recalculate the number of 1-bits in the payload.
Trailer
F
Eg. Payload Number of 1 bit Hexadecimal
Compare
1110100110100
1111010010101 1 F
Does error occur?
5
Packet Structure
P1
Transmission Mode
Types of data transmission
• Simplex
• Serial
• Half-duplex
• Parallel
• Full-duplex
Data Transmission
• Serial
• Parallel
Types of data transmission - Serial
• Serial data transmission occurs when data is sent ONE BIT AT A TIME over a
single wire/channel.
• Bits are sent one after the other as a single stream.
10111001
Sender Receiver
1
1
Sender Receiver
1
• Expensive
• Faster data transmission as multiple
• Synchronisation errors can happen
channels are used
due to the separation of data across
Parallel data transmission works
Parallel •
different channels.
well over short distances. • Data can be skewed
Data Transmission
Transmission Mode
• Simplex
• Half-duplex
• Full-duplex
Transmission mode - Simplex
• Simplex mode occurs when data can be sent in ONE DIRECTION ONLY (for example, from
sender to receiver).
LAPTOP TO PRINTER
• Half-duplex mode occurs when data is sent in BOTH DIRECTIONS but NOT
AT THE SAME TIME (for example, data can be sent from ‘A’ to ‘B’ and from
‘B’ to ‘A’ along the same transmission line, but they can’t both be done at the
same time).
"OVER OVER"
WALKIE
TALKIE "YES?"
Transmission mode - Full-duplex
• Full-duplex mode occurs when data can be sent in BOTH DIRECTIONS AT
THE SAME TIME (for example, data can be sent from ‘A’ to ‘B’ and from ‘B’
to ‘A’ along the same transmission line simultaneously).
BROADBAND
INTERNET
CONNECTION
Advantage Disadvantage
• The process can use full bandwidth
• Two way communication is not
Simplex for the channel possible
Half-Duplex bandwidth
• Fastest duplex transmission method due• Some networks are not able to
Full-Duplex to each communication using its own utilise the technology.
simplex channel. No delay
DIY
Which types of data transmission are being described:
data is sent one bit at a time in one direction only
Transmission Mode
Types of data transmission
Serial Simplex
Parallel Half-duplex
Full-duplex
DIY
Which types of data transmission are being described:
data is being sent 8 bits at a time in one direction only
Transmission Mode
Types of data transmission
Serial Simplex
Parallel Half-duplex
Full-duplex
DIY
Which types of data transmission are being described:
data is being sent 16 bits at a time in both directions simultaneously
Transmission Mode
Types of data transmission
Serial Simplex
Parallel Half-duplex
Full-duplex
DIY
Which types of data transmission are being described:
data is sent one bit at a time in both directions simultaneously
Transmission Mode
Types of data transmission
Serial Simplex
Parallel Half-duplex
Full-duplex
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
Chapter 2.2
Universal Serial
Bus (USB)
Universal Serial Bus (USB)
Methods of error
detection
IGCSE Computer Science
HELP!
The need to check for errors.
• When data is transmitted, there is always a risk that it may be corrupted, lost or even
gained.
• Errors can occur during data transmission due to:
1. Interference: All types of cables can experience electrical interference, leading to data
corruption or loss.
2. Problems during packet switching: Data loss or unauthorized data access can occur during
packet switching.
3. Skewing of data: During parallel data transmission, bits can arrive out of synchronization,
causing data corruption.
Five error detection methods
Automatic
Checksum Repeat
Request
How do we know that bits are being transmitted correctly?
0 1 1 0 1 1 0 0
0 1 1 0 1 0 0 0
Parity Checks
• Parity checking is a method used to detect data alterations or corruption during
transmission.
• It involves counting the number of 1-bits in a data byte.
• Parity checks are divided into EVEN and ODD categories.
• One bit in the byte, typically the most significant or left-most bit, is assigned as the
parity bit.
SETTING UP THE PARITY BIT - EVEN PARITY
The parity bit is set according to whether the parity being used is even or odd. For example, consider the byte:
0 1 1 0 1 1 0 0
0, awesome!
SETTING UP THE PARITY BIT - ODD PARITY
The parity bit is set according to whether the parity being used is even or odd. For example, consider the byte:
1 1 1 0 1 1 0 0
1, awesome!
Steps to set up a parity bit:
1 1 0 1 1 0 0
• Count the number of 1s
• Ask a question:
• Even parity: What digit should I put in the empty box if I want an EVEN number of
1s?
• Odd parity: What digit should I put in the empty box if I want an ODD number of
1s?
• Decide yourself based on the question!
How does parity check helps detect errors?
Message
0 1 1 0 1 1 0 0
0 1 1 0 0 1 0 0
) 1 1 1 0 1 1 0 1
0 1 0 1 1 1 0 0
Even parity
is used
Parity check will not work if two bits are corrupted!
Message
0 1 1 1 1 1 0 1
Even parity
is used
In these scenarios, the byte is clearly corrupted, but the number of '1' bits remains even. Thus, no error would be
detected despite the evident transmission errors.
Note: Parity check fails to detect errors when an even number of bits are corrupted.
Parity Block Check
Parity block check is more robust than simple parity check as it not only detects errors
but also allows for their correction.
Let’s say we are transmitting the following seven bytes using even parity:
Parity bit
0 1 1 0 1 0 1
1 0 0 0 0 0 1
0 0 0 1 0 0 1
0 0 1 0 1 1 1
1 0 1 0 0 0 1
1 0 0 1 0 0 1
0 0 1 0 1 1 0
Parity Block Check
Steps
Set the parity bit.
Parity bit
0 0 1 1 0 1 0 1
0 1 0 0 0 0 0 1
0 0 0 0 1 0 0 1
0 0 0 1 0 1 1 1
1 1 0 1 0 0 0 1
1 1 0 0 1 0 0 1
1 0 0 1 0 1 1 0
Parity Block Check
Steps
Set the parity byte. It is set in a way that ensures each column has an even number of 1.
0 0 1 1 0 1 0 1
0 1 0 0 0 0 0 1
0 0 0 0 1 0 0 1
0 0 0 1 0 1 1 1
1 1 0 1 0 0 0 1
1 1 0 0 1 0 0 1
1 0 0 1 0 1 1 0
Parity
byte
1 1 1 0 0 1 0 0
Parity Block Check
Steps
Let’s say an error has occurred. Unlike normal parity check, it can detect where exactly the error has
occurred.
0 0 1 1 0 1 0 1
0 1 0 0 0 0 0 1
0 0 0 0 1 0 0 1
This row does not have
an even number of 1! 0 0 0 0 0 1 1 1
1 1 0 1 0 0 0 1
1 1 0 0 1 0 0 1
1 0 0 1 0 1 1 0
1 1 1 0 0 1 0 0
0 0 1 1 0 1 0 1 = 53
Checksum that will be
0 1 0 0 0 0 0 1 = 65 150 transmitted along with the
data
0 0 0 0 1 0 0 1 =9
0 0 0 1 0 1 1 1 = 23
Checksum
Checksum
Comparing the checksum before and after transmission will help to identify whether an error
has occurred.
0 0 1 1 0 1 0 1 = 53
86 != 150, this shows that
0 0 0 0 0 0 0 1 =1 86 an error has occurred.
0 0 0 0 1 0 0 1 =9
0 0 0 1 0 1 1 1 = 23
Echo Check
• Upon receiving a message, the receiver immediately sends a copy back to the sender.
• A comparison is then performed.
• If no differences are found between the two data sets during the echo check, it
indicates no error has occurred.
• If differences are detected, an error has occurred, and the data will be retransmitted.
As you might have deduced, this method isn't very reliable. If the two data sets differ, it's unclear whether the error occurred
during the initial data transmission or when sending the data back for checking.
Automatic Repeat Requests
1. The receiving device gets an error detection
code with the data transmission.
2. If no error is detected, a positive DATA
acknowledgment is sent back to the sending
device.
3. If an error is detected, the receiving device
sends a negative acknowledgment and
requests a data retransmission. B
A
4. The sending device uses a time-out, waiting
a predetermined time for an acknowledgment.
5. If no acknowledgment is received within
this time, the sending device automatically Timeout = Resend if no
retransmits the data until it receives a positive acknowledgement received No error = Positive
retransmissions.
Error = Negative
Acknowledgement
Check Digits
A check digit is a single digit added to a string of numbers to verify the accuracy and
integrity of the data during transmission or input.
Types of errors:
2 . The thirteenth digit is generated using the other 12 digits in a number. Different
methods are used for different system when calculating the thirteenth digit.
3. The thirteenth digit will help to identify whether an error has occurred or not.
International Standard Book Numbers
• Add all the odd numbered digits together (Not the 13rd number)
• Add all the even numbered digits together and multiply the result by 3
• Add the results from 1 and 2 together and divide by 10
• Take the remainder, if it is zero then use this value, otherwise subtract the remainder
from 10 to find the check digit.
EXAMPLES
– CHECK
DIGIT IN
ACTION
• Add all the odd numbered digits together (Not the 13rd number)
• Add all the even numbered digits together and multiply the result by 3
• Add the results from 1 and 2 together and divide by 10
• Take the remainder, if it is zero then use this value, otherwise subtract the
remainder from 10 to find the check digit.
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
PA S T Y E A R Q U E S T I O N S
Symmetric and Asymmetric Encryption
The purpose of encryption
Message could be
intercepted by a hacker
Encryption cannot prevent a message from being intercepted, but it stops it from
making sense to the hacker.
A carregar…
Encryption
Algorithm
Plaintext Ciphertext
Plaintext and Ciphertext
Encryption
Algorithm
Plaintext Ciphertext
Decryption
Algorithm
Symmetric Encryption
i h a v e c o v i d
Symmetric Encryption - Encrypt
i h a v e c o v i d
4 5 7 8 4 5 7 8 4 5
Symmetric Encryption - Encrypt
i h a v e c o v i d
INCREASE 4 5 7 8 4 5 7 8 4 5
Symmetric Encryption - Encrypt
i h a v e c o v i d
4 5 7 8 4 5 7 8 4 5
m m h d i h v d m i
mmhdihvdmi
Symmetric Encryption - Decrypt
m m h d i h v d m i
4 5 7 8 4 5 7 8 4 5
Symmetric Encryption - Decrypt
m m h d i h v d m i
DECREASE 4 5 7 8 4 5 7 8 4 5
Symmetric Encryption - Decrypt
m m h d i h v d m i
DECREASE 4 5 7 8 4 5 7 8 4 5
i h a v e c o v i d
Why symmetric?
Encrypt Decrypt
+4 -4
-4 +4
a v e c o v d m m h d i h v d m i
i h i
8 4 5 7 8 4 5 4 5 7 8 4 5 7 8 4 5
4 5 7
m m h d i h v d m i i h a v e c o v i d
Drawbacks of symmetric encryption