Data loss

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Data loss

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. A device sends 8 bytes of data but the receiver only gets 7 bytes. Which type of error is this?
A Data loss
B Data gain
2. Which statement describes data loss?
A Some bits or bytes that were sent never arrive
B Extra bits or bytes arrive that were never sent
3. The message HELLO is sent. The receiver gets HELO. What has happened?
A A byte was gained, so the message is longer
B A byte was lost, so the message is shorter
4. After a message is received, how can you spot data loss by comparing it with the message that was sent?
A The received message is longer
B The received message is shorter
5. A packet is sent as 10 bytes. Which received size would show data loss?
A 9 bytes
B 11 bytes

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1Sent: 01001000 01101001 | Received: 01001000 AData loss: one character (byte) went missing in transmission
2Sent: CAT | Received: CT BData loss: the second byte never arrived, so the message is shorter than the one sent
3Data loss means the received message is shorter than the sent message CThe received message is longer, not shorter. An extra character means data gain, not data loss.
4Data loss happens when a byte that was sent never arrives DSent: 11110000 10101010 00001111 | Received: 11110000 00001111
5Sent: HELLO | Received: HELLOO (data loss) EIf all 8 bytes arrived, nothing is missing. Data loss needs the received message to be shorter than the sent one.
6Sent: 8 bytes | Received: 8 bytes, but two bytes arrived missing, so data loss Fsent = 5 bytes, received = 3 bytes

Definitions

data loss

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
sent ← "HELLO" received ← "HELO" OUTPUT ______(sent) - LENGTH(received)
2.
sentCount ← 5 receivedCount ← 4 lostBytes ← sentCount _ receivedCount
3.
IF LENGTH(received) _ LENGTH(sent) THEN OUTPUT "Data loss" ENDIF
4.
IF lostBytes > 0 ____ OUTPUT "Byte missing" ENDIF
5.
sent ← "A1B2C3" received ← "A1B2C" lostBytes ← LENGTH(sent) - LENGTH(________)

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A sent <- "HELLO"
B got <- "HELO"
C IF LEN(got) > LEN(sent) THEN
D OUTPUT "Data loss"
E ENDIF
Question 2
A bytesSent <- 5
B bytesGot <- 4
C lost <- bytesGot - bytesSent
D OUTPUT lost
Question 3
A sent <- "DOG"
B got <- "DOGS"
C OUTPUT LEN(sent) - LEN(got)
Question 4
A sent <- MESSAGE
B got <- "MESAGE"
C shortBy <- LEN(sent) - LEN(got)
D OUTPUT shortBy
Question 5
A sent <- "HELLO"
B got <- "HLLO"
C lost <- LEN(sent) - LEN(got)
D IF lost < 0 THEN
E OUTPUT "Data loss"
F ENDIF

Answer Key

Data loss
Section A: Quick Questions
Q1
A — Data loss
Q2
A — Some bits or bytes that were sent never arrive
Q3
B — A byte was lost, so the message is shorter
Q4
B — The received message is shorter
Q5
A — 9 bytes
Section B: Match the Pairs
Q1
Sent: 01001000 01101001 | Received: 01001000 → Data loss: the second byte never arrived, so the message is shorter than the one sent
Q2
Sent: CAT | Received: CT → Data loss: one character (byte) went missing in transmission
Q3
Data loss means the received message is shorter than the sent message → sent = 5 bytes, received = 3 bytes
Q4
Data loss happens when a byte that was sent never arrives → Sent: 11110000 10101010 00001111 | Received: 11110000 00001111
Q5
Sent: HELLO | Received: HELLOO (data loss) → The received message is longer, not shorter. An extra character means data gain, not data loss.
Q6
Sent: 8 bytes | Received: 8 bytes, but two bytes arrived missing, so data loss → If all 8 bytes arrived, nothing is missing. Data loss needs the received message to be shorter than the sent one.
Section C: Definitions
Q1
data loss — When some bits or bytes that were sent never arrive, so the message that is received is shorter than the one that was sent.
Section D: Fill in the Blanks
Q1
sent ← "HELLO" received ← "HELO" OUTPUT LENGTH(sent) - LENGTH(received)
Q2
sentCount ← 5 receivedCount ← 4 lostBytes ← sentCount - receivedCount
Q3
IF LENGTH(received) < LENGTH(sent) THEN OUTPUT "Data loss" ENDIF
Q4
IF lostBytes > 0 THEN OUTPUT "Byte missing" ENDIF
Q5
sent ← "A1B2C3" received ← "A1B2C" lostBytes ← LENGTH(sent) - LENGTH(received)
Section E: Spot the Error
Q1
C — Data loss means the received message is shorter than the one sent. The test should be LEN(got) < LEN(sent), not >.
Q2
C — The number of bytes lost is the bytes sent minus the bytes received. The subtraction is the wrong way round and gives -1 instead of 1.
Q3
B — In data loss the received message is shorter than the sent one, so got should be "DO" (the G never arrived). "DOGS" is longer, which would be data gain.
Q4
A — The text that was sent is a string, so it must be written in quotes: sent <- "MESSAGE". Without quotes MESSAGE looks like a variable.
Q5
D — A positive value in lost means bytes went missing, so data loss is detected when lost > 0. Checking for < 0 would only be true if the message grew.