Unit 2-Data Transmission
Unit 2-Data Transmission
TRANSMISSION
Transmission Of Data
Data is frequently transferred from one device to another. The two devices could be in the
same building or thousands of kilometres away. Irrespective of the distance travelled, the
transmission of data needs to be considered with respect to:
• How the data is transmitted?
• How can errors following transmission be detected and can the data be recovered?
• The role of encryption to make sure data that falls into the wrong hands can’t be used
• It is also important to consider ways of checking for errors in data once it has been
entered into a computer
2.1.1 Data packets
• Data sent over long distances is usually broken up into data packets (sometimes called
datagrams).
• The packets of data are usually quite small, typically 64 KiB, which are much easier to
control than a long continuous stream of data.
Benefit of using data packets
If a particular transmission route was out of action or very busy. Then packet can be sent along a
different route to its destination.
Drawback of splitting data into packets
It needs to reassemble the data when it reaches its destination
Packet structure
For each packet, the payload consists of the actual data being sent in the packet (this is
usually about 64 KiB).
Packet Trailer
For each packet, the packet trailer consists of:
» some way of identifying the end of the packet; this is essential to allow
each packet to be separated from each other as they travel from sending to
receiving station
» an error checking method; cyclic redundancy checks (CRCs) are used to check data
packets:
– this involves the sending computer adding up all the 1-bits in the payload
and storing this as a hex value in the trailer before it is sent
– once the packet arrives, the receiving computer recalculates the number of
1-bits in the payload
– the computer then checks this value against the one sent in the trailer
– if the two values match, then no transmission errors have occurred;
otherwise the packet needs to be re-sent.
Packet structure
Packet switching : Example
• Let us now consider what happens when a photograph, for example, is sent from
computer ‘A’ to computer ‘B’.
• The photograph will be split up into a number of packets before it is sent.
• There will be several possible routes for the packets, between computer ‘A’ (sender)
and computer ‘B’ (receiver).
• Each stage in the route contains a router. A router receives a data packet and, based
on the information in the header, decides where to send it next. For example:
Packet switching
• Packet switching is a method of data transmission in which a message is broken up
into a number of packets.
• Each packet can then be sent independently from start point to end point.
• At the destination, the packets will need to be reassembled into their correct order
(using the information sent in the header).
• At each stage in the transmission, there are nodes that contain a router.
• Each router will determine which route the packet needs to take, in order to reach its
destination (the destination IP address is used in this part of the process).
• Suppose the photograph has been split up into five packets that have been sent in the
following order:
Packet switching
• Each packet will follow its own path (route)
• Routers will determine the route of each packet
• routing selection depends on the number of packets waiting to be processed at each
node
• The shortest possible path available is always selected – this may not always be the
shortest path that could be taken, since certain parts of the route may be too busy or
not suitable
• Unfortunately , packets can reach the destination in a different order to that in which
they were sent.
• Figure 2.5 shows one possible scenario. Notice the different paths taken by each
packet from computer ‘A’ to computer ‘B’. Also notice that the packets have arrived in a
different order compared to the way they were sent, namely
PACKET SWITCHING
BENEFITS OF PACKET SWITCHING
4 a. Explain how it is possible for packets to be lost during their transmission across a
network.
b. Describe how it is possible for a system to deal with lost packets and prevent them from
slowing down the transmission process.
c. Explain why you think packet switching might improve data security.
2.1.2 DATA
TRANSMISSION
• Data transmission can be either over a short distance (for example, computer
• to printer) or over longer distances (for example, from one computer to another in a
global network).
Important factors for data transmission:
• The direction of data transmission (for example, can data transmit in one direction
only, or in both directions)
• The method of transmission (for example, how many bits can be sent at the same time)
• How will data be synchronised (that is, how to make sure the received data is in the
correct order).
These factors are usually considered by a communication protocol.
Data Transmission Modes
Data Transmission Modes
Transmission mode defines the direction of flow of
signal between two connected devices.
Simplex Data Transmission
• Half-Duplex is like the dreaded "one lane" road you may have
run into at construction sites. Only one direction will be allowed
through at a time.
• The IEEE-1284 allows printers to send messages to the
computer. The printer cannot send these messages while the
computer is sending characters but when the computer stops
sending characters, then the printer can send messages back.
• The only advantage that Half-Duplex would have is the single
lane or single track is cheaper then the double lane or double
track
Full Duplex Transmission
Advantage:
• It is simple and reliable because next bit is not transmitted until the current bit has
been received.
• Cost of transmission is low as one wire is required to transmit data.
Disadvantage:-
• The transmission is slow because one bit is transmitted at one time.
Application : -
• All peripheral devices that connect through a universal bus(USB) use serial data
transmission.
• It works on long distances i.e data from computer to a modem for transmission over
a telephone line.
Parallel Transmission of Data
• In parallel transmission, all the bits of data are transmitted
simultaneously on separate communication lines.
• All bits of byte are received at the same time.
• Bits can be transmitted as simplex, half duplex or full duplex
Parallel Transmission:
Advantages:-
• Transfer of data is faster than serial transmission because all the bits
are travelling at the same time.
• Data can be transmitted in less time
Disadvantage:-
• It is less reliable as the bits can become muddled up. The bits might
reach out of sequence at the destination. This problem is called
‘skew’.
• More Costly because in order to transmit n bit, n wires are use
Application : -
• It is suitable for short distances.
• sending data from a computer to a printer
• internal data transfer (buses)
Comparison Of Serial And Parallel
Transmission
Integrated Circuits(Ics)
• Parity Check
• Check Digit
• Checksum
• Automatic Repeat reQuest (ARQ)
• Echo check
Parity Check
• A parity check uses a parity bit to make sure that that the data has been
sent accurately.
• Data is sent in bytes, normally made up of 8 bits.
• In a parity check, the first 7 bits of the byte are the data itself, the last
bit is the parity bit.
• A parity check can use odd parity or even parity.
• Systems that use even parity have even number of 1’s
• Systems that use ODD Parity have odd number of 1’s
Parity Checking
Error checking using Parity Check :
Method
• The sending and receiving computers agree the protocol
to be used (even or odd)
• The sending computer adds the correct parity bit to the
binary data (either an extra 1 or 0)
• The sending computer sends the binary data, including
the parity bit
• The receiving computer checks to make sure the overall
parity of the data received is as agreed (an even or odd
number of 1 bits)
• If the parity of the data is incorrect, the receiving
computer will request that the data is transmitted again
Drawbacks of parity checks
• If two bits are transposed (change places) then the computer could be
fooled into thinking the data is correct and not corrupted
• If two random bits change state then the system could also be fooled
Activity 2.5 : Pg 56
Parity Block
Byte 2 1 0 0 1 0 1 0 1
Byte 3 0 1 1 1 1 1 1 0
Byte 4 1 0 0 0 0 0 1 0
Byte 5 0 1 1 0 1 0 0 1
Byte 6 1 0 0 0 1 0 0 0
Byte 7 1 0 1 0 1 1 1 1
Byte 8 0 0 0 1 1 0 1 0
Byte 9 0 0 0 1 0 0 1 0
Parity 1 1 0 1 0 0 0 1
byte
Parity block example(EVEN PARITY
Classwork : Q 1
A Check Digit is the final digit included in a code; it is calculated from all
the other digits in the code. Check digits are used for
• Barcodes
• Product codes
• International Standard Book Numbers (ISBN)
• Vehicle Identification Numbers (VIN).
66
Types Of Errors Identified By Check Digit
67
Check Digit Calculation :ISBN-13
An example of a check digit calculation is ISBN 13, where the 13th digit
of the ISBN code is calculated using the following algorithm.
1 Add all the odd numbered digits together, excluding the check digit.
2 Add all the even numbered digits together and multiply the result by 3.
3 Add the results from 1 and 2 together and divide by 10.
4 Take the remainder, if it is zero use this value, otherwise subtract the
remainder from 10 to find the check digit.
68
Check Digit Calculation :Example
Using the ISBN above 9 7 8 0 3 4 0 9 8 3 8 2 without its check digit:
1. 9+8+3+0+8+8 = 36
2. 3(7 + 0 +4+ 9 + 3 +2) =75
3. (36 + 75 )/10 =11 remainder l
4. 10 - l =9 the check digit.
69
Checking Check Digit Calculation
To check that an ISBN 13 digit code is correct a similar process is
followed.
1. Add all the odd numbered digits together, including the check digit.
2. Add all the even number of digits together and multiply the result
by 3.
3. Add the results from I and 2 together and divide by 10.
4. The number is correct if the remainder is zero.
Using the ISBN above 9 7 8 0 3 4 0 9 8 3 8 2 9 with its check digit:
1. 9+8+3+0+8+8+9 =45
2. 3(7+0+4+9+3+2) = 75
3. (45 + 75 )/ 10 =12 remainder 0
Remainder is 0 therefore number is correct 70
FIND THE CHECK DIGIT USING ISBN-13
A.ISBN=978190612400
B(I) ISBN=9718780171500
• Check Digit = 6
B(II) ISBN=9781234567897
Modulo 11 check Digit Calculations
74
Example 2: Modulo-11
Calculation 1 – Generation of the check digit from the
other digits in a number
The following algorithm generates the check digit from the other 7 digits:
Step 1 7-digit number: 4 1 5 6 7 1 0
weighting values: 8765432
Step 2 sum: (8 × 4) + (7 × 1) + (6 × 5) + (5 × 6) + (4 × 7) + (3 × 1) + (2 × 0)
= 32 + 7 + 30 + 30 + 28 + 3 + 0
total = 130
Step 3 divide total by 11: 130/11 = 11 remainder 9
Step 4 subtract remainder from 11: 11 – 9 = 2 (check digit)
So we end up with the following eight-digit: 4 1 5 6 7 1 0 2 75
Re-calculation of the check digit from the eight-
digit number
To check that the eight-digit number is correct, including its check digit, a similar process is
followed:
1 each digit in the number is given a weighting of 8, 7, 6, 5, 4, 3, 2 or 1 starting from the left
2 the digit is multiplied by its weighting and then each value is added to make a total
3 the total is divided by 11
4 the number is correct if the remainder is zero
Using the 8-digit number: 4 1 5 6 7 1 0 2
Step 1 : weighting values: 8 7 6 5 4 3 2 1
Step 2 sum: (8 × 4) + (7 × 1) + (6 × 5) + (5 × 6) + (4 × 7) + (3 × 1) + (2 × 0) + (1 × 2)
= 32 + 7 + 30 + 30 + 28 + 3 + 0 + 2 = 132
Step 3 divide total by 11: 132/11 = 12 remainder 0
Step 4 remainder is 0, therefore number is correct
76
FIND CHECK DIGIT USING MODULO-11
• 1127
Check Digit =4
Automatic Repeat ReQuests (ARQ)
Plain
Text
Encryption
• Encryption is the translation of data into a secret code.
• Encryption is the most effective way to achieve data security.
• To read an encrypted file, a secret key is needed to decrypt it.
• Encryption is used primarily to protect data in case it has been hacked
but it won’t prevent hacking.
• It makes the data meaningless unless the recipient has necessary
decryption tools
• There are 2 types of encryptions
Symmetric Encryption
Asymmetric Encryption
Symmetric Encryption
4291362856
• Message
COMPUTER SCIENCE IS EXCITING.
Decryption key is, 4 2 9 1 3 6 2 8 5 6. But in this case, the decryption process would
be the reverse of encryption and each letter would be shifted –4, –2, –9, –1, and so
on. For example, ‘G’ ‘C’, ‘Q’ ‘O’, ‘V’ ‘M’, ‘Q’ ‘P’, and so on.
Problem with symmetric encryption :
KEY DISTRIBUTION PROBLEM
• In symmetric encryption sender and the receiver have the same
encryption and decryption key.
• There is a security risk as sender has to supply the key to the
recipient.
• This key can be intercepted by the hacker during the transmission.
This is called Key Distribution Problem.
• In order to avoid this problem both sender and receiver use an
algorithm to generate the key, then there is no need to transmit the
key.
Asymmetric Encryption
• Asymmetric encryption has 2 keys that are mathematically linked.
• In asymmetric encryption, one key is used to encrypt a message and
another is used to decrypt the message. This is known as public-key
encryption. This avoids the risks surrounding the symmetric
encryption
• For asymmetric encryption a private and public key both are needed
A public key is made available to everyone
A private key is kept secret on your computer. Your computer can
use it to decrypt the message. It is never transmitted
Asymmetric Encryption : Example
Tom (Sender) Message Jane (Receiver)
• Jane uses an algorithm to generate a matching pair of keys (private and public) that they must
keep stored on their computers; the matching pairs of keys are mathematically linked but can’t b
derived from each other.
• Jane now sends her public key to Tom.
ASYMMETRIC ENCRYPTION
Message
Tom (Sender) Jane (Receiver)
Jane generates
a matching
pair of keys
that are linked
mathematically
Tom wants to
send a
message to
jane
Asymmetric Encryption : Example
• Jane can also exchange her public key with any number of people working in the company, so she
is able to receive encrypted messages (which have been encrypted using her public key ) and she
can then decrypt them using her matching private key:
• For a a two-way communication all five workers, then they all need to generate their own
matching public and private keys. Once this is done, all users then need to swap public keys so that
they can send encrypted documents/files/messages between each other. Each worker will then use
their own private key to decrypt information being sent to them.
Asymmetric encryption
application in banks
• When a user logs onto a bank’s website, a copy of bank’s public key is
downloaded to the user’s browser.
• Communication from bank is encrypted with private key.
• User’s browser decrypt message using public key
• Similarly, any messages from user’s browser are encrypted with public
key
• Only bank holds the private key to decrypt them.
• Therefore the Bank is trusted because it has key to encrypt the
messages
DATA PACKETS : KEY TERMS
Data packet – a small part of a message/data that is transmitted over a network;
after transmission all the data packets are reassembled to form the original
message/data
Packet header – the part of the data packet that contains the IP addresses of the
sender and receiver, and includes the packet number which allows reassembly of the data
packets
Packet trailer – the part of a data packet that indicates the end of the data
packet and cyclic redundancy check error check
Skewed (data) – data that arrives at the destination with the bits no longer
synchronised
Parity Bit – a bit (either 0 or 1) added to a byte of data in the most significant bit
position; this ensures that the byte follows the correct even parity or odd parity protocol
Parity Block – a horizontal and vertical parity check on a block of data being
transmitted
Parity Byte – an extra byte of data sent at the end of a parity block; it is
composed of the parity bits generated from a vertical parity check of the data block