CS Chapter 2 Data Transmission
CS Chapter 2 Data Transmission
• 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
• Data can include anything from text, images, audio, video, animations, etc, or
any combination of these
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 a packet number
• Error checks make sure that when a packet is received there is minimal or no
corruption of the data
• Read error detection methods for more detail on how data packets can be
checked to ensure corruption is avoided/minimised
Packet Switching
• 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
•
• 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
o Serial
o Parallel
• Serial and parallel are methods of transmitting data (bits) from a sender to a
receiver
Serial transmission
• A stream of bits is sent in sequence, one after the other
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
• Low interference
Simplex transmission
• Data travels in only one direction
Half-duplex transmission
• 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
• Network cables can send and receive data at the same time and are examples
of full-duplex data transmission
• Slow
Simplex • Cheap as only one wire is used • Expensive for bi-directiona
transmission (multiple wire
• Serial-Simplex
• 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
• Parallel-Simplex
• 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
What is USB?
• The Universal Serial Bus (USB) is a widely used standard for transmitting data
between devices
o Keyboards
o Mice
o Video cameras
o Printers
o Mobile phone
o Disk drives
o Network adapters
• 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-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.)
o USB 2.0 - 480 Mbps (very common but slower compared to modern
versions)
o USB4/ USB4 2.0 - Up to 80 Gbps (the latest and fastest, used for high
speed data transfer)
Advantages Disadvantages
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
o Data loss can also occur from interruptions to data transmission such
as a blocked signal or if the transmission is intermittent
o 13/04/14 (DD/MM/YY)
o 12/31/2020 (MM/DD/YYYY)
o Jul-04-16 (MMM/DD/YY)
Parity Check
• 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
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 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
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
• When using parity bits, an error occurs when the number of total bits does not
match the agreed parity
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 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 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
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
• 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
• 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
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
Check Digits
• A check digit is the last digit included in a code or sequence, used to detect
errors in numeric data entry
o Phonetic errors
• Added to the end of a numerical sequence they ensure validity of the data
o Barcodes
• Each book has a unique ISBN number that identifies the book
• 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
• The final digit on a barcode is usually the check digit, this can be used
to validate and authenticate an item
• 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:
Encryption
What is encryption?
• 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
• 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
• 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
• Keys can vary in size and act like passwords, enabling people to protect
information
• 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 may use standard postage mail to share the key
• Asymmetric encryption is when two keys are used, a public and 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