0% found this document useful (0 votes)
4 views108 pages

Chapter 2 Slides

Chapter 2 discusses various types and modes of data transmission, including packet switching, serial and parallel transmission, and different transmission modes such as simplex, half-duplex, and full-duplex. It also details the structure of data packets and methods for error detection, including parity checks and cyclic redundancy checks. Additionally, it introduces Universal Serial Bus (USB) as a common method for data transmission, highlighting its advantages and disadvantages.

Uploaded by

gabrielminalis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views108 pages

Chapter 2 Slides

Chapter 2 discusses various types and modes of data transmission, including packet switching, serial and parallel transmission, and different transmission modes such as simplex, half-duplex, and full-duplex. It also details the structure of data packets and methods for error detection, including parity checks and cyclic redundancy checks. Additionally, it introduces Universal Serial Bus (USB) as a common method for data transmission, highlighting its advantages and disadvantages.

Uploaded by

gabrielminalis
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 108

CHAP

TER 2: CHAPTER 2.1

Types and modes of


DATA
TRAN
SMISS
ION

Data Transmission
IGCSE COMPUTER SCIENCE
Do your homework already?

YES (actually no)


HOW IS DATA (TEXT, IMAGE, AND SOUND) TRANSMITTED?

YES!

Computer Science
A carregar…
is Easy
LESSON
OBJECTIVE

Packet Packet Types of Data


Transmission
Structure Switching
Packet Switching (Payload)
• Packet switching is a data transmission method where a message is divided into
multiple packets.
• Each packet can be transmitted independently from the start point to the endpoint.
• Upon reaching the destination, the packets must be reassembled in the correct
sequence.
A carregar…
• During transmission, nodes containing routers are encountered at various stages.
Each router decides the route each packet should take to reach its destination, using
the destination IP address as part of this routing process.
Each packet can be sent along a different route

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

There is no need to tie up a single communication line, enabling a high data


transmission rate.

Drawbacks of packet switching


Data may be lost and require re-transmission, causing a delay at the
destination while the packets are being re-ordered.
Data Packets
• When data is transmitted over long distances, it is typically
divided into data packets, also known as datagrams.
• These packets are approximately 64 KiB in size, which
simplifies managing the data compared to sending it as one
long, continuous stream.
• Each packet can travel via a different route to reach its
destination.
Packet Structure

P1

A carregar…
A typical packet is split up into:

Header Payload Trailer


Packet Structure (Header)
• Sender IP Address
Header • Receiver IP Address
• Sequence number of the packet.
• This is to ensure that all the packets can be
reassembled correctly once they reach the destination.
• Size of the packet
• This is to ensure that the receiving station can check if
all of the packets have arrived.
Packet Structure (Header)
• Sender IP Address
Header • Receiver IP Address
• Sequence number of the packet.
• This is to ensure that all the packets can be
reassembled correctly once they reach the destination.
• Size of the packet
• This is to ensure that the receiving station can check if
all of the packets have arrived.
Remember SSSR
Packet Structure (Payload)

The actual data in the packet.


Payload

“Have you done your


homework”
Packet Structure (Trailer)

• Some ways to identify the end of the packet. This is


Trailer essential to allow each packet to be separated from
each other as they travel from the sending to receiving
station.
Packet Structure (Trailer)
2. Some form of error checking to ensure packet arrives

Trailer error free.


Cyclic Redundancy Checks
• The sending computer will add up all the 1-bits in the
payload and store it as a hex value in the trailer before it is
Trailer
sent.

Eg. Payload Number of 1 bit Hexadecimal Trailer

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

A typical packet is split up into:

Header Payload Trailer


Data Transmission

• There are several different methods of transmitting data depending on


the types of hardware and connections being used.

Transmission Mode
Types of data transmission
• Simplex
• Serial
• Half-duplex
• Parallel
• Full-duplex
Data Transmission

• There are several different methods of transmitting data depending on


the types of hardware and connections being used.

Types of 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

Example : Computer is connected directly to the printer via a USB connection.


Types of data transmission - Parallel
• Parallel data transmission occurs when SEVERAL BITS OF DATA are sent
down SEVERAL CHANNELS/WIRES all at the same time.
• Each channel/wire transmits one bit

1
1
Sender Receiver
1

Example : Internal circuits in a computer.


Advantage Disadvantage
• Reliable for transmitting data • Slow data transmission as
only one channel is used
Serial over long distance
• Fewer Errors

• 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

• There are several different methods of transmitting data depending on


the types of hardware and connections being used.

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

Print this page


for me
Transmission mode - Half-duplex

• 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

Enable two-way transmission using full


• Delay in the communication
A carregar…

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)

• Universal Serial Bus (USB) is a type of serial data transmission.


• Designed to replace older port types, USB has become the most common input/output port on
computers.
• It has standardized data transfer between devices and computers, supporting both half-duplex
and full-duplex data transmission.
USB Cable

• The USB cable consists of a four-


wired shielded cable, with
• two wires for power (red and
black)
• two wires (white and green) are
for data transmission.
When a device is plugged into a computer using one of the
USB ports:

• A computer automatically detects the presence of a device through a small


change in voltage on the USB cable's data signal wires.
• The device is then recognized, and the appropriate driver software is loaded
to facilitate communication between the computer and the device.
• If the necessary driver software is not available, the user is prompted to
download it.
USB-C

A new type of USB connector, known as USB-C, is increasingly


common in laptops, tablets, and phones. This 24-pin symmetrical
connector can be inserted either way into a USB-C port.
Smaller and thinner than older USB connectors, USB-C provides
100-watt (20-volt) power connectivity, allowing full-sized devices to
be charged. It also supports data transfer speeds of 10 gigabits per
second (10 Gbps), enabling 4K video delivery.
Advantages and disadvantages of USB

• Ubiquitous and widely • Data transmission speed


available.
remains relatively slow.
• Supplies both power and data,
• Transmission quality
eliminating the need for an
external power source. degrades with cable lengths
• Backward compatible when over 5 meters.
using appropriate adapters.
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.3

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

Parity Checks Echo Check


Check Digit

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:

What should I put here if I want an EVEN number of 1s?

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:

What should I put here if I want an ODD number of 1s?

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

Let’s say that


even parity
is used
Let's say the message is corrupted...

0 1 1 0 0 1 0 0

Let’s say that


even parity
is used
Something is not
right ... the byte
The computer will detect that an error has occurred during the transmission of the byte. The error should contain
even number of 1
is detected by the recipient’s computer
re-calculating the parity of the byte sent.
Do it yourself - does any error occur?

1 Message (even parity is used)

) 1 1 1 0 1 1 0 1

Message (odd parity is used)


2)
1 1 1 1 1 1 1 1
Opps, there is a problem with parity check ...
Message

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

This column does not have an even


number of 1!
Checksum
Checksum
When a block of data is transmitted, a checksum is computed from that data block. Both the
sender and receiver use a predetermined algorithm to perform this calculation.

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

acknowledgment or reaches a set number of after a certain time Acknowledgement

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:

• an incorrect digit entered, for example 5327 entered instead of 5307


• Transposition errors where two numbers have changed order, for example
5037 instead of 5307
• Omitted or extra digits, for example 537 instead of 5307 or 53107 instead of
5307
• Phonetic errors, for example 13 (thirteen), instead of 30 (thirty).
International Standard Book Numbers

Check Digits - ISBN 13 methods

1. The check digit in ISBN 13 is the thirteenth digit in the number.

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

Check Digits - ISBN 13 methods

• 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

International Standard Book Numbers

Check Digits - ISBN 13 methods

• 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.

Wait, I don't get it....


Encryption cannot prevent a message from being intercepted, but it stops it from
making sense to the hacker.

A carregar…

Wait, I don't get it....


Plaintext and Ciphertext

Encryption
Algorithm

Plaintext Ciphertext
Plaintext and Ciphertext

Encryption
Algorithm

Plaintext Ciphertext

Decryption
Algorithm
Symmetric Encryption

1. Symmetric encryption uses an encryption key.


2. The same key is used to encrypt and decrypt the encoded message.
3. One method is called the Caesar Cipher.
Symmetric Encryption

Original message: I have covid


Key: 4578

i h a v e c o v i d
Symmetric Encryption - Encrypt

Original message: I have covid


Key: 4578

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

1. The primary challenge lies in maintaining the confidentiality of


the encryption key.
2. Security remains the central concern with symmetric
encryption, given that a lone encryption key serves both the
sender and the recipient, presenting a vulnerability.
Encryption key is required for both sender and recipient.
Asymmetric Encryption

1. Asymmetric encryption was created to address the security issues inherent


in symmetric encryption.
2. It makes use of two keys called the public key and the private key:

a. public key (made available to everybody)


b. private key (only known to the computer user).
Asymmetric Encryption
1. When a sender encrypts a message for transmission, the receiver generates a pair of keys: a
public key and a private key.
2. The public key is disseminated to any device that may need to send a message to the
receiver. Using the receiver's public key, the sender encrypts the message.
3. Upon receiving the message, the recipient uses their private key to decrypt it.
Asymmetric Encryption
Public key:
Private key:
Asymmetric Encryption
Public key:
Private key:
Important notes

Public key cannot be used to


decrypt a message.

Private key is never shared

As a result, asymmetric encryption is more secure than


symmetric encryptioon
To enable two-way communication among five workers, each generates their own public and private keys. They then
exchange public keys to securely send encrypted messages. Each worker decrypts incoming information using their private
key.
JUNE 2019
ANSWER
NOVEMBER 2020
ANSWER
MARCH 2020
ANSWER

You might also like