0% found this document useful (0 votes)
10 views18 pages

CS Chapter 2 Data Transmission

The document explains data packets, which are small chunks of data transmitted over the internet using the Transmission Control Protocol (TCP). It details the structure of packets, the process of packet switching, various data transmission methods (serial, parallel, simplex, half-duplex, and full-duplex), and the Universal Serial Bus (USB) standard. Additionally, it discusses error occurrence and detection methods, including parity checks to ensure data integrity during transmission.

Uploaded by

antonyfootball2
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)
10 views18 pages

CS Chapter 2 Data Transmission

The document explains data packets, which are small chunks of data transmitted over the internet using the Transmission Control Protocol (TCP). It details the structure of packets, the process of packet switching, various data transmission methods (serial, parallel, simplex, half-duplex, and full-duplex), and the Universal Serial Bus (USB) standard. Additionally, it discusses error occurrence and detection methods, including parity checks to ensure data integrity during transmission.

Uploaded by

antonyfootball2
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/ 18

Data Packets

What are packets?

• Packets are small 'chunks' of data that make up a larger piece of data that has
been broken down by the TCP protocol so that it can be transmitted over the
internet

• TCP stands for Transmission Control Protocol and is used for organising data
transmission over networks

• Small 'chunks' of data are easier and quicker to route over the internet than big
'chunks' of data

o Routing involves finding the most optimal path over a network

• Data can include anything from text, images, audio, video, animations, etc, or
any combination of these

What do packets contain?

• A packet consists of:

Header Payload Trailer

Additional security informatio


Source IP address Actual data being transported
(less common)

Destination IP address End of packet notification

Packet number

(1 of 5 etc.)

• To transmit the message “This is a message :)”over the internet, TCP might break
the message down into 4 packets
• Each packet contains a:

o source IP address

o destination IP address

o payload (the data)

o a packet number

• Error checks make sure that when a packet is received there is minimal or no
corruption of the data

• Corruption is where packet data is changed or lost in some way, or data is


gained that originally was not in the packet

• Read error detection methods for more detail on how data packets can be
checked to ensure corruption is avoided/minimised

Packet Switching

• What is packet switching?

• Packet switching is a method of sending and receiving data (packets) across a


network

• Packet switching can be broken down into five stages:

• Stage • Overview • Detail

• Data is broken down into


• 1
packets
• Learn more by reading our data packets revisio
• Packets are assigned a
• 2
header

• Like normal car traPic, data traPic builds up on


• Each packet makes its way
• 3 • Routers can see this and decide to send a pack
to the destination
diPerent route that avoids traPic

• Routers control the routes • Routers know which nearby router is closer to t
• 4
taken for each packet destination device

• Packets arrive and are • If a packet does not reach its destination the re
• 5
reordered correctly send a resend request to the sender to resend

• What are the advantages of packet switching?

• Interference and corruption are minimal as individual packets can be resent if


they are lost or damaged

• The whole file doesn’t need to be resent if a corruption occurs, this saves
time and internet bandwidth

• Packet switching is quicker than sending a large packet as each packet finds the
quickest way around the network

• It's harder to hack an individual's data as each packet contains minimal data,
and travels through the network separately

What is data transmission?

• Data transmission is the process of transferring data from one device to


another using a wired or wireless connection

• Wired data transmission can be completed in two ways:

o Serial

o Parallel

Serial & Parallel Transmission

What is serial & parallel transmission?

• Serial and parallel are methods of transmitting data (bits) from a sender to a
receiver

• Each method determines how many bits can be transmitted at once

Serial transmission
• A stream of bits is sent in sequence, one after the other

• USB is an example of a wired serial connection

Parallel transmission

• A stream of bits is sent in sequence, one after the other across multiple wires at
the same time

• Transmission is asynchronous, data does not always arrive at the same time

• A skew can be caused by data arriving out of order in asynchronous


transmission

• A traditional printer cable is an example of a wired parallel connection

Advantages and disadvantages of serial & parallel transmission

Transmission Advantages Disadvantages

• Reliable over longer distance

Serial • Cheaper to setup • Slow transmission speed

• Low interference

• Only used on short distance


Parallel • Very fast transmission speed
• Prone to high interference

Simplex, Half-Duplex & Full-Duplex Transmission

What is simplex, half-duplex & full-duplex transmission?

• Simplex, half-duplex and full-duplex control the direction in which data is


transmitted between a sender and receiver

Simplex transmission
• Data travels in only one direction

• Sending data from a computer to a monitor is an example of simplex


transmission

Half-duplex transmission

• Data can travel in both directions, but not simultaneously (bi-directional)

• A printer cable which waits for the data to be received before sending back a
‘low ink’ message is an example of half-duplex transmission

Full-duplex transmission

• Data can travel in both directions at the same time (bi-directional)

• Network cables can send and receive data at the same time and are examples
of full-duplex data transmission

• Full-duplex is used in local and wide area networks

Advantages and disadvantages of simplex, half-duplex & full-duplex transmission

Transmission Advantages Disadvantages

• Slow
Simplex • Cheap as only one wire is used • Expensive for bi-directiona
transmission (multiple wire

• Cheaper than simplex for bidirectional


Half-duplex • Slow
transmission (fewer wires)

• Fast as data can travel in both directions


Full-duplex • Expensive
simultaneously

• Wires can be combinations of serial, parallel, simplex, half-duplex and full-


duplex

Simplex Half-duplex Full-duplex

Serial Serial-Simplex Serial-Half-duplex Serial-Full-duplex

Parallel Parallel-Simplex Parallel-Half-duplex Parallel-Full-duplex

• Serial-Simplex

o Data is transmitted one bit at a time in a single direction on one wire

• Serial-Half-duplex
o Data can be transmitted in both directions on a single wire but only one
bit at a time can be transmitted in one direction at a time

• Serial-Full-duplex

o Data can be transmitted in both directions at the same time on a single


wire one bit at a time

• Parallel-Simplex

o Multiple wires transmit one bit at a time in one direction

• Parallel-Half-duplex

o Multiple wires send multiple bits of data in both directions but only one
direction at a time

• Parallel-Full-duplex

o Multiple wires send multiple bits of data in both directions at the same
time

Universal Serial Bus (USB)

What is USB?

• The Universal Serial Bus (USB) is a widely used standard for transmitting data
between devices

• It is a serial communication method, and it operates asynchronously

• Many devices use USB such as:

o Keyboards

o Mice

o Video cameras

o Printers

o Portable media players

o Mobile phone

o Disk drives

o Network adapters

• DiPerent USB connector types exist for diPerent devices

• The letters refer to the physical shape and design of the USB connector:
o USB-A - Commonly used for flash drives, mice, keyboards, external HDD

o USB-B - Found in printers, scanners, and older external storage devices

o USB-C - Latest standard, known for it's small size, transfer speeds, and
it's ability to carry power

• The term USB can also be followed by numbers (USB 2.0, 3.0, 4 etc.)

• The numbers refer to the generation of USB technology, which determines


the speed and performance:

o USB 1.1 - 12 Mbps (very slow)

o USB 2.0 - 480 Mbps (very common but slower compared to modern
versions)

o USB 3.0/3.1/3.2 - 5 Gbps to 20 Gbps (much faster, used for external


HDDs and gaming devices)

o USB4/ USB4 2.0 - Up to 80 Gbps (the latest and fastest, used for high
speed data transfer)

• When a device is connected to a USB port the computer:

o Automatically detects that the device has been connected

o Looks for the correct driver:

§ If the driver is already installed, the appropriate device driver is


loaded so that the device can communicate with the computer

§ If the device is new, the computer will look for a compatible


device driver

§ If one cannot be found, the user must download and install an


appropriate driver manually
Advantages and disadvantages of USB

Advantages Disadvantages

The maximum cable length is roug


Devices are automatically detected and drivers are
metres meaning it cannot be used
automatically loaded for communication
distances, limiting its use

Cable connectors fit in only one way. Older versions of USB have limited
This prevents incorrect connections and ensures compatible data transmission rates for example U
transmission 2.0 has 480Mbps

Very old USB standards may not


As USB usage is standardised, there is a lot of support available
supported in the near future (USB
online and from retailers
etc)
Several diPerent data transmission rates are supported. The
newest transmission rate as of 2022 is USB4 2.0 with 80
Gbps (81,920 Mbps, 170x faster than USB 2.0)

Newer USB standards are backwards compatible with older USB


standards

Why Errors Occur

Why do errors occur?

• Errors can occur using wired or wireless technology due to interference

• Examples of interference include wire degradation or electrical fields changing


the signal

• Results of interference include:

o Data loss - data is lost in transmission

o Data gain - additional data is received

o Data change - some bits have been changed or flipped

• Wireless technology uses radio signals or other electromagnetic signals to


transmit data

o These signals can be blocked by physical barriers such as buildings,


walls, cars or other objects

o Interference can be caused by bad weather such as rain or clouds, or by


other wireless signals or electromagnetic radiation

• Wired technology carries more chance of causing an error as physical


components can be damaged, degrade or receive interference from outside
signals

o Data loss can also occur from interruptions to data transmission such
as a blocked signal or if the transmission is intermittent

Why check for errors?

• Computers expect data in certain formats

o A format is a way of arranging the data so that it can be easily


understood by people and by computers

o People agree to certain formats so that systems work


more ebiciently and there is little chance of misunderstanding each
other
• An example of a format is date and time

• Date and time can have multiple formats such as:

o 13/04/14 (DD/MM/YY)

o 12/31/2020 (MM/DD/YYYY)

o Jul-04-16 (MMM/DD/YY)

• If data is not as expected, things can go wrong

• For example, if a receiver expected to receive a date in format DD/MM/YY as


03/04/17 but received 04/03/17, did the sender mean 3rd April 2017 or 4th March
2017?

• An error or corruption occurs when data received is not as expected and


therefore is dibicult or impossible to process

Parity Check

What is a parity check?

• A parity check determines whether bits in a transmission have been corrupted

• Every byte transmitted has one of its bits allocated as a parity bit

• The sender and receiver must agree before transmission whether they are
using odd or even parity

• If odd parity is used then there must be an odd number of 1’s in the byte,
including the parity bit

• If even parity is used then there must be an even number of 1’s in the byte,
including the parity bit

• The value of the parity bit is determined by counting the number of 1’s in the
byte, including the parity bit

• If the number of 1’s does not match the agreed parity then an error has
occurred

• Parity checks only check that an error has occurred, they do not reveal where
the error(s) occurred

Even parity

• Below is an arbitrary binary string


EVEN
Byte
Parity bit

0 1 0 1 1 0 1

• If an even parity bit is used then all bits in the byte, including the parity bit,
must add up to an even number

o There are four 1’s in the byte

o This means the parity bit must be 0 otherwise the whole byte, including
the parity bit, would add up to five which is an odd number

Odd parity

• Below is an arbitrary binary string

ODD
Byte
Parity bit

1 1 0 1 1 0 1

• If an odd parity bit is used then all bits in the byte, including the parity bit,
must add up to an odd number

o There are four 1’s in the byte. This means the parity bit must be a 1
otherwise the whole byte, including the parity bit, would add up to four
which is an even number

• The table below shows a number of examples of the agreed parity between a
sender and receiver and the parity bit used for each byte

Example # Agreed parity Parity bit Main bit string Total number of 1’s

#1 ODD 0 1 1 0 1 0 1 1 5

#2 EVEN 1 0 0 0 1 0 0 0 2

#3 EVEN 1 0 1 0 1 1 1 1 6

#4 ODD 1 0 1 1 1 0 0 1 5

#5 ODD 1 1 0 1 0 1 0 1 5

#6 EVEN 0 1 0 0 1 1 1 0 4

• Example #1: The agreed parity is odd. All of the 1’s in the main bit string are
added (5). As this number is odd already the parity bit is set to 0 so the whole
byte stays odd
• Example #2: The agreed parity is even. All of the 1’s in the main bit string are
added (1). As this number is odd the parity bit is set to 1 to make the total
number of 1’s even (2)

• Example #6: The agreed parity is even. All of the 1’s in the main bit string are
added (4). As this number is even already the parity bit is set to 0 so the whole
byte stays even

How do errors occur?

• When using parity bits, an error occurs when the number of total bits does not
match the agreed parity

• Bits can be flipped or changed due to interference on a wire or wirelessly due


to weather or other signals

Example # Agreed parity Parity bit Main bit string Total number of 1’s

#1 ODD 1 1 1 0 1 0 1 1 6

#2 EVEN 1 0 0 0 1 0 0 0 2

#3 EVEN 1 0 1 1 1 1 1 1 7

#4 ODD 1 0 1 1 1 0 0 1 5

#5 ODD 1 1 0 1 0 1 1 1 6

#6 EVEN 0 1 0 0 0 1 1 0 3

• Parity checks are quick and easy to implement but fail to detect bit swaps that
cause the parity to remain the same

Parity Byte & Block Check

What are parity byte & block checks?

• Parity blocks and parity bytes can be used to check an error has
occurred and where the error is located

• Parity checks on their own do not pinpoint where errors in data exist, only that
an error has occurred

• A parity block consists of a block of data with the number of 1’s


totalled horizontally and vertically

• A parity byte is also sent with the data which contains the parity bits from
the vertical parity calculation
• Below is a parity block with a parity byte at the bottom and a parity bit column in
the second column

ODD Parity bit Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7

Byte 1 0 1 1 0 1 0 1

Byte 2 0 0 0 0 1 0 0

Byte 3 1 0 1 0 1 1 1

Byte 4 1 0 1 1 1 0 0

Byte 5 1 1 0 1 0 1 0

Byte 6 1 1 0 0 1 1 1

Byte 7 0 0 1 1 1 1 1

Byte 8 0 1 0 1 1 0 0

Parity byte 0 1 1 1 1 1 1

• The above table uses odd parity

• Each byte row calculates the horizontal parity as a parity bit as normal

• Each bit column calculates the vertical parity for each row, the parity byte

• It is calculated before transmission and sent with the parity block

• Each parity bit tracks if a flip error occurred in a byte while the parity
byte calculates if an error occurred in a bit column

• By cross referencing both horizontal and vertical parity values the error can be
pinpointed

• In the above example the byte 3 / bit 5 cell is the error and should be a 0
instead

• The error could be fixed automatically or a retransmission request could be


sent to the sender

Checksum

What is a checksum?

• A checksum is a value that can be used to determine if data has been corrupted
or altered

• It indicates whether data dibers from its original form but does not specify
where
• Checksums are calculated using an algorithm and the value is added to the
transmission

• The receiving device re-calculates the checksum and compares to the original

• If the checksums do not match, it is assumed an error has occurred

Check Digits

What is a check digit?

• A check digit is the last digit included in a code or sequence, used to detect
errors in numeric data entry

• Examples of errors that a check digit can help to identify are:

o Incorrect digits entered

o Omitted or extra digits

o Phonetic errors

• Added to the end of a numerical sequence they ensure validity of the data

• Calculated using standardised algorithms to ensure widespread compatibility

• Examples of where check digits can be used include:

o ISBN book numbers

o Barcodes

ISBN book numbers

• Each book has a unique ISBN number that identifies the book

• A standard ISBN number may be ten digits, for example, 965-448-765-9

• The check digit value is the final digit (9 in this example).

• This number is chosen specifically so that when the algorithm is completed the
result is a whole number (an integer) with no remainder parts

• A check digit algorithm is performed on the ISBN number and if the result is a
whole number, then the ISBN is valid

Barcodes

• Barcodes consist of black and white lines which can be scanned using barcode
scanners
• Barcode scanners shine a laser on the black and white lines which reflect
light into the scanner

• The scanner reads the distance between these lines as numbers and can
identify the item

• Barcodes also use a set of digits to uniquely identify each item

• The final digit on a barcode is usually the check digit, this can be used
to validate and authenticate an item

Automatic Repeat reQuests(ARQ)

What is an automatic repeat request(ARQ)?

• An automatic repeat request is a protocol that notifies the sender that an error
has occurred and that the data received is incorrect

• It works as follows:

o If an error is detected the receiver sends a negative acknowledgement


transmission to indicate the data is corrupted

o If no error is detected the receiver sends a positive acknowledgement


transmission meaning the data is correct

o If the receiver does not send any acknowledgement transmission then


the sender waits for a certain time period known as a time-
out before automatically resending the data

o This process is repeated until all data has


been received and acknowledged

Encryption

What is encryption?

• Encryption is a method of scrambling data before being transmitted across a


network

• Encryption helps to protect the contents from unauthorised access by making


data meaningless

• While encryption is important on both wired and wireless networks, it's even
more critical on wireless networks due to the data being transmitted over radio
waves, making it easy to intercept

How is wireless data encrypted?


• Wireless networks are identified by a 'Service Set Identifier' (SSID) which along
with a password is used to create a 'master key'

• When devices connect to the same wireless network using the SSID and
password they are given a copy of the master key

• The master key is used to encrypt data into 'cipher text', before being
transmitted

• The receiver uses the same master key to decrypt the cipher text back to 'plain
text'

• To guarantee the security of data, the master key is never transmitted. Without
it, any intercepted data is rendered useless

• Wireless networks use dedicated protocols like WPA2 specifically designed


for Wi-Fi security

How is wired data encrypted?

• Wired networks are encrypted in a very similar way to a wireless network, using
a master key to encrypt data and the same key to decrypt data

• Encryption on a wired network diPers slightly as it is often left to individual


applications to decide how encryption is used, for example HTTPS
Symmetric & Asymmetric Encryption

• Encryption relies on the use of a key

• A key is a binary string of a certain length that when applied to an encryption


algorithm can encrypt plaintext information and decrypt ciphertext

o Plaintext is the name for data before it is encrypted

o Ciphertext is the name for data after it is encrypted

• Keys can vary in size and act like passwords, enabling people to protect
information

What is symmetric encryption?

• Symmetric encryption is when both the sender and receiver are given an
identical secret key which can be used to encrypt or decrypt information

• If a hacker gains access to the key, then they can decrypt intercepted
information

• The secret key can be shared with the receiver without sending it electronically:

o Both parties could verbally share the key in person

o Both parties may use standard postage mail to share the key

o An algorithm may be used to calculate the key by sharing secret non-


key information

What is asymmetric encryption?

• Asymmetric encryption is when two keys are used, a public and private key

o Public key: a key known to everyone

o Private key: a key known only to the receiver

• Both keys are needed to encrypt and decrypt information

• Asymmetric encryption works as follows:

o Person A uses a public key to encrypt their message

o Person A sends their message over the network or internet

o Person B decrypts the message using their secret private key

• Only one private key can be used to decrypt a message and it is not sent over
the internet like a symmetric key
• Keys can be large, a key using 100 bits would generate
1,267,650,600,228,229,401,496,703,205,376 diPerent combinations

• Large keys are near impossible for a hacker to guess

You might also like