GoalReview how data is sent in packets, how long a transfer takes, how parity checks work and what they miss, and how networks are protected.
New words
packet · a small piece of a message that carries an address, so that it can be sent separately and rebuilt at the endbandwidth · the amount of data a connection can carry each second, such as 40 Mbit/sparity bit · an extra bit added to a byte so that the number of 1s is always even (even parity) or always odd (odd parity)phishing · a message that pretends to be from a trusted sender to trick you into giving away private information
Explanation
Data travels across a network in packets, and devices follow protocols, which are agreed rules. A handshake starts a connection, and HTTP or HTTPS carries requests from a client to a server. The time to send a file is its size in megabits (megabytes × 8) divided by the bandwidth in megabits per second. A parity bit is added so that the count of 1s in a byte is always even or always odd, and in this course it is written first. A parity check detects one wrong bit but not two wrong bits, and it cannot say which bit is wrong. Networks are protected by physical measures, such as locked rooms, and digital measures, such as passwords, firewalls and backups. Trained staff can also spot phishing.
Idea
Rule to remember
time to send
megabytes × 8 ÷ megabits per second
number of packets
size ÷ packet size, rounded up
parity check
count all 8 bits; the count must match the agreed rule
parity limit
two changed bits can pass the check
Worked examples
Packet
1
2
3
4
Size in MB
4
4
4
3
Time and packets. A 15 MB file is sent over a 40 Mbit/s connection. It is 15 × 8 = 120 megabits, and 120 ÷ 40 = 3 seconds. If it is cut into packets of at most 4 MB, three packets are full and the last one carries the rest, so there are four packets.
Byte
1s counted
Odd?
Result
11100101
5
yes
pass
11100111
6
no
fail
Odd parity. The data bits 1100101 have four 1s. To make the total odd, the parity bit is 1, so the byte sent is 11100101, with five 1s. At the receiver, 11100101 passes. But 11100111 has six 1s, which is even, so it fails: at least one bit changed.
Byte
1s
Parity check
sent
11100101
5
pass
received
11100110
5
pass, but wrong
A check that is fooled. The byte 11100101 is sent, but interference changes its last two bits and 11100110 arrives. It has five 1s, which is odd, so the byte passes the odd parity check although it is wrong. Two changed bits can cancel each other out, which is why a parity block, or another check, is sometimes added.
Class activity
Packets and parity (no computer). Part 1: write a message of 12 words and cut a card into 6 pieces. Write 2 words and a number on each piece, shuffle them, and ask a partner to rebuild the message. Then remove one piece, as if a packet were lost. What must the receiver ask for? Part 2: use 8 coins, heads for 1 and tails for 0. Set 8 coins with an odd number of heads. Hide them, flip one coin secretly and ask a partner to count: do they notice? Can they say which coin changed? Flip two coins and count again. What happens?
Practice
1
A 20 MB file is sent over a 32 Mbit/s connection. How long does it take on its own? Then it is cut into packets of at most 6 MB: how many packets are there, and how big is each?
20 × 8 = 160 megabits, and 160 ÷ 32 = 5 seconds. There are 4 packets: 6 MB, 6 MB, 6 MB and 2 MB.
2
The sender uses even parity. Write the parity bit and the byte sent for each row of data bits.
Data bits
1s
Parity bit
Byte sent
1010011
?
?
?
0001110
?
?
?
1111111
?
?
?
0000000
?
?
?
1010011 has 4 ones: bit 0, byte 01010011. 0001110 has 3 ones: bit 1, byte 10001110. 1111111 has 7 ones: bit 1, byte 11111111. 0000000 has 0 ones: bit 0, byte 00000000.
3
Both devices use odd parity. Count the 1s in each received byte and say pass or fail.
Byte received
1s
Result
01101101
?
?
11011011
?
?
00010000
?
?
01101101 has 5 ones: pass. 11011011 has 6 ones: fail. 00010000 has 1 one: pass.
4
A school adds a second building 300 metres away. Why can it not just use one longer cable, and what could it use instead?
A wired signal gets weak after about 100 metres, so one long cable is not enough. The school could add extra hardware, such as a wireless access point or a switch of its own, to carry the signal, and it must think about the cost.