0% found this document useful (0 votes)
18 views

2 Data Transmission J24

Uploaded by

Amira Okasha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

2 Data Transmission J24

Uploaded by

Amira Okasha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

2 Data transmission

Data packets

Data sent over long distances is usually broken up into data packets. A packets of data are much easier to
control than a long continuous stream of data.
Packet structure

1. a packet header consisting of


o the IP address of the sending device
o the IP address of the receiving device
o the sequence number of the packet; to ensure that all the packets can be reassembled into the
correct order once they reach the destination
o packet size; to ensure the receiving station can check if all of the packets have arrived intact
o total number of packets for this transmission
2. the payload consisting of:
o the actual data being sent in the packet ≈ 64KiB
3. a trailer consisting of:
o 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
o an error checking method; CRCs are used to check data packets:

Cyclic Redundancy Check (CRC):


CRC is an error detection mechanism in which:
 the sending computer adds up all the 1-bits in the payload and stores this as a hex value in the trailer
before it is sent
 When the packet arrives, the receiving computer recalculates the number of 1-bits in the payload and
compares it to the one sent in the trailer
 if the two values match, then no transmission errors occurred; otherwise the packet needs to be re-sent.

20
Packet switching
o Packet switching is a method of data transmission in which a message is broken up into a number of
packets
o Each packet is sent independently from start point to end point and will follow its own route
o At the destination, the packets are reassembled into their correct order (using the information sent in
the header).
o At each stage in the transmission, there are nodes that contain a router.
o Each router determines 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).
o routing selection depends on the number of packets waiting to be processed at each node
o the shortest possible path available is always selected which may not always be the shortest path, since
certain parts of the route may be too busy or not suitable
o packets can reach the destination in a different order to that in which they were sent.

Computer A
Router 1 Router 2

Router 3
4 3 1 2

Router 4 Router 5 Computer B

The benefits of packet switching: The drawbacks of packet switching:

o no need to tie up a single communication line o delay at the destination whilst the packets are being re-ordered.
o re-routing packets overcome failed/busy lines o packets can be lost and need to be re-sent
o high data transmission rate o more prone to errors with real-time streaming
o easy to expand package usage (ex a live sporting transmitted over the internet)

To avoid packets bounce around, Hop numbers are added to the header of each packet, this number is
reduced by 1 every time it leaves a router. When a hop is zero, and the packet hasn’t reached its destination,
then the packet is deleted when it reaches the next router.

21
Three factors are considered when transmitting data. Both sender and receiver must agree upon each factor
prior to data transmission.
1. the direction of the data transmission (simplex/ half duplex/ full duplex)
2. the mode/method of transmission (serial/ parallel)
3. the method of synchronisation between the two devices (synchronous/asynchronous)

1. Direction of data transmission:

Simplex data transmission is in one direction only (i.e. from sender


to receiver).

Ex: data being sent from a computer to a printer.

Half-duplex data transmission is in both directions but not at the


same time.

Ex: a phone conversation between two people where only one person speaks at a time.

Full-duplex data transmission is in both directions simultaneously.

Ex: broadband connection on a phone line.

2. Method of transmission

Serial data transmission: data is sent one bit at a time, over a single wire/channel

 More accurate/fewer errors over a longer distances, since only one wire/channel is used,
 less chance of data being skewed/out of synchronisation/order
 cheaper connection as one wire is used
 less interference as only a single wire

disadvantage:

 Data is transmitted at a slower rate than parallel data transmission.

An example of its use is sending data from a computer to a modem for transmission over a telephone line.

A common use for serial data transmission is the Universal Serial Bus (USB).

22
Parallel data transmission: data are sent down several wires/channels at the same time; one wire or channel
is used to transmit each bit.

 This method of data transmission works very well over short distances (over longer distances, the
bits can become skewed).
 Parallel data transmission is a faster method of data transmission than serial.

Uses of parallel data transmission:

 sending data to a printer from a computer using a ribbon connector.


 Integrated Circuit (IC) for sending data internally
 Internal data transfer (buses between the CPU and the memory).
The use of 8-bit, 16-bit, 32-bit and 64-bit buses, for example, allow much faster data transmission
rates than could be achieved with single channel serial data transfer

Universal Serial Bus (USB)

The Universal Serial Bus (USB-A) is an asynchronous serial data transmission method.

The USB cable consists of:

• a 4-wire shielded cable


• two of the wires are used for power and the earth
• two of the wires are used in the data transmission.

Advantages of using USB-A systems

 devices plugged into the computer are automatically detected and device
drivers are automatically loaded up
 connections can only fit one way preventing device incorrectly connected
 is an industry standard
 Can be used to charge devices
 error-free data transmission as the USB protocol notifies the transmitter to re-
transmit data if any errors are detected
 supported by many operating systems
 backward compatible (older versions are still supported)
Drawbacks of a USB

• The maximum cable length is presently about 5m


• The present transmission rate is limited to less than 500 megabits per second

23
USB-C is the latest type of USB connector, it is a symmetrical 24-pin USB connection
Advantages of using USB-C compared to USB-A

 Smaller and thinner which suits making devices thinner


 Offers 20 volts power connectivity, it can charge a full-size device
 Backward compatability

Error Detection methods

After data transmission, there is always the risk that the data has been corrupted

Errors can occur during data transmission due to:

o electrical interference, which can cause data to be corrupted


o problems during packet switching
o skewing of data (in parallel data transmission if the bits arrive out of synchronisation).

Methods to detect errors:

• parity checking • checksum


• automatic repeat request (ARQ) • echo checking.

1. Parity checking

Method used to check whether data has been changed/corrupted following transmission from one device to
another.

Systems use even parity have an even number of 1- bits; systems that use odd parity have an odd number of
1-bits. Before data is transferred, sender and receiver agree on the type of parity used.

Example:

If this byte is using even parity, then the parity bit needs to be 0

If odd parity is being used, then the parity bit needs to be 1 to make the number of 1-bits odd.

Drawbacks:

 If there are multiple errors in the same byte that still produce the same parity bit, the error will not be
detected
 2 bits interchanged (e.g. 1 → 0 and 0 → 1) that won’t change parity value
 even number of bits are transposed

Parity blocks is used to know exactly which bit has changed. A block of data is sent and the number of 1-bits
are totalled horizontally and vertically. This method indicates where the error is.

24
Example: Nine bytes of data have been transmitted. Even parity will be used.

Parity Byte, has also been sent. This byte consists entirely of the parity bits produced by the vertical parity
check. The parity byte also indicates the end of the block of data.
The following table shows how the data arrived at the receiving end:
• byte 8 (row 8) has incorrect parity (there are three 1-bits)
• bit 5 (column 5) also has incorrect parity (there are five 1-bits).
• The intersection of row 8 and column 5 gives the position of the but with error

25
2. Automatic Repeat Request (ARQ)

This is an error detection method that uses a positive/negative acknowledgement and timeout

 Acknowledgements are messages sent by the receiver indicating that it has received a packet
 Timeouts are pre-determined periods of time allowed to elapse before an acknowledgment is to be
received

Method

1. The sending computer transmits a block of data with a request to acknowledge data reception

2. the receiving computer receives an error detection code as part of the data (as CRC) to check if data
received contains an error

 if no error is detected, a positive acknowledgement is sent back to the sending device


 if an error is detected, the receiving device now sends a negative acknowledgement to the sending
device and requests re-transmission of the data

3. The sending computer waits a period of time (timeout) to see if the receiving computer acknowledges
receipt of the data (+ve or -ve)

4. After a set period of time, a timeout occurs which triggers the data to be automatically resent by the
sending computer

5. This will continue until the receiving computer acknowledges the data has been received

ARQ is often used by mobile phone networks to guarantee data integrity.

Timeout

3. Checksum

26
1. The checksum is calculated by the sending computer, from a block of data using an agreed algorithm

2. The data is then sent with the checksum (appended at the end of the data block)

3. The receiving computer re-calculates the checksum, using the same mathematical algorithm used by the
sending computer

4. The two checksum values are compared by the receiving computer

5. if the two checksums match, then no transmission errors have occurred; otherwise a request is made to
re-send the block of data.

4. Echo check
1. a copy of the data is sent back to the sender
2. the returned data is compared with the original data by the sender’s computer
3. if there are no differences, then the data was sent without error
if the two sets of data are different, then an error occurred during the data transmission.

Drawback of echo checks

 If the two sets of data are different, it is not known if the error occurred when originally sent, or when it
was sent back
 Echo checks require a lot of extra data to be transmitted

27
Encryption

Encryption is the conversion of the original data (plain text) into a form that is unreadable (ciphertext) by
using an encryption algorithm
• Encryption protect data during transmission if intercepted by a hacker
• Encryption won’t prevent hacking, it makes the data meaningless unless the recipient has the necessary
decryption key
• The encryption algorithm applies an encryption/decryption keys to encrypt/decrypt the data
• The longer the key, the harder it is to figure out, e.g. a 256 bit key is more secure than a 128 bit key.

Symmetric and asymmetric encryption


1) Symmetric encryption
 Symmetric encryption uses the same key to encrypt and decrypt the data.
 When the key is applied, the plain text (original text) goes through an encryption algorithm, to
produce a cypher text (encrypted message)
 The key is sent to the recipient to decrypt the message back to plain text
 this creates a problem known as the key distribution problem as a hacker could intercept the key and
decrypt the ciphertext data
 256-bits encryption keys can be used to overcome this problem.
Example

28
2) Asymmetric encryption
 Asymmetric encryption is a form of encryption where a pair of keys (public key and private key) are
responsible for encrypting and decrypting data.
 Public key is available to everybody; private key is only known only to the computer user; both are
needed to encrypt and decrypt messages
 Encryption keys are generated by hashing algorithm – this translates the message or key into a string of
characters shown in hexadecimal; the greater the number of bits, the harder it is to crack the encryption
Ex. MD4 which generates a 128 – bit string
Asymmetric encryption uses a special pairing of keys:
Public key • Provided by the recipient
• It can be given to anyone who wishes to send encrypted data to the recipient
• Safe to share as all it can do is encrypt data

Private key • Remains private on the computer, never sent or shared


• Only this key can decrypt the data encrypted using the public key

Example:
Tom and Jane work for the same company and Tom wishes to send a confidential document to Jane:
1. 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 be derived
from each other.
2. Jane now sends her public key to Tom.

3. Tom uses Jane’s public key to encrypt the document he wishes to send to her. He then sends his
encrypted document (ciphertext) back to Jane.

4. Jane uses her matching private key to unlock Tom’s document and decrypt it;
(this works because the public key used to encrypt the document and the private key used to decrypt it are a
matching pair generated on Jane’s computer. (Jane can’t use the public key to decrypt the message).

29
N.B.
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:

If a two-way communication is required between all five workers, then they all need to generate their
own matching public and private keys.

30

You might also like