Chapter 2 Data Transmission
Chapter 2 Data Transmission
Data Packets:
Data packets, also known as datagrams, are typically used to transport data over great
distances. Generally speaking, the data packets are easier to manage than a lengthy,
continuous stream of data because they are significantly smaller, typically 64KiB. By dividing up
the data in this fashion, each packet can be transmitted to its destination via a different path.
This would undoubtedly be very helpful in the event if a specific transmission route was
unavailable or extremely congested.
Packet Structure:
Three components make up a standard packet:
Packet header
Payload
Trailer
Packet header:
The packet header for every packet is made up of:
what the sender device's IP address is
what the receiving device's IP address is
the packet's sequence number (which is used to make sure that, once they arrive
at their destination, every packet can be put back together in the right order).
packet size (so that the receiving station can verify that every packet has arrived
undamaged)
Payload:
The actual data being transferred in each packet makes up the payload (which is
typically 64KiB).
Packet trailer:
The package trailer for every packet includes:
If the two values are the same, there have been no transmission faults; if
otherwise, the packet needs to be sent again.
Packet Switching:
Now let's look at what occurs, say, when a picture is delivered from computer "Sender" to
computer "Receiver". When the picture is sent, it will be divided into several packets. Between
computer "Sender" and computer "Receiver", there will be multiple paths by which the packets
may go. A router is present at every stage of the route. When a router receives a data packet, it
determines where to transmit it next using the information in the header. As an illustration:
With Packet switching, a message is divided up into several packets for data transmission. After
that, each packet can be sent from the start point to the end point on its own. The packets
must be reassembled at the destination (using the information sent in the header) in the
correct order. There are nodes with routers at every level of the transmission. Every router will
ascertain the path that the packet must follow to get at its intended destination (this step
involves the usage of the destination IP address).
Assume that our image has been divided into five packets and that they were sent in the
following sequence:
Every packet is going to take its own journey.
Routes for every packet will be determined by routers.
The quantity of packets awaiting processing at each node determines which route
should be taken.
The shortest path that is always chosen may not always be the shortest path that could
be followed since some sections of the route might be too congested or unsuitable.
Sadly, packets may arrive at their destination out of the order in which they were
delivered.
Advantages Disadvantages
Closing off a single communication Packets may need to be resent if they are
connection is not necessary. lost.
Rerouting packets can solve the issue of When real-time streaming occurs, such as
failed, busy, or malfunctioning lines. when a live sporting event is broadcast
online, the technique is more error-prone.
It is not too difficult to increase package
utilization.
It is feasible to transfer data at a rapid rate. As the packets are being re-arranged at the
destination, there is a delay.
Hop Number:
Packets may occasionally be lost because they keep "bouncing" from router to router instead of
ever getting to their intended destination. As the amount of dropped packets increased and
clogged the system, eventually the network would simply stop working. This is solved by using a
technique known as hopping. Every packet has a hop number added to its header, which is
lowered by 1 each time it leaves a router.
There is a maximum hop number for every packet. When a packet reaches the next router, it is
erased if its hop number hits zero and it hasn't reached its destination. The receiving computer
will then indicate which packets are missing and send out a request to resend them.
Data Transmission:
the data transmission direction (e.g., can data transfer in both directions or just one
direction).
the transmission technique (e.g., the maximum number of bits that can be transferred
simultaneously)
methods for synchronizing data, or how to guarantee that the information is received in
the right sequence.
Long-distance serial data transfer performs admirably. In contrast to parallel data transmission,
the data is transferred more slowly. Since only one channel or wire is required, the data will
arrive perfectly synchronized (that is, in the right order) at its destination. Utilizing it when a
computer and printer are connected via a USB connection is one instance of its application.
The USB cable has two red and black power wires, making it a four-wire shielded cable. The
data transfer is done via the other two wires, which are green and white. When a USB port on a
computer is used to connect a device:
The presence of a device is immediately detected by the computer (this is because the
data signal wires in the USB cable have a slight voltage change).
In order to enable successful communication between the computer and device, the
device is automatically recognized and the necessary device driver software is loaded.
The user is prompted to download the necessary driver software if a new device is
detected; if this is not possible, the computer will search for the device driver that
corresponds with the device (some systems do this automatically and the user will see a
notice asking for permission to connect to the device website).
Advantages Disadvantages
When a device is inserted into the computer, USB hubs are required to extend cables
device drivers are automatically loaded and longer than 5 meters, as regular USB only
identified. allows cables up to that length.
Connections can only fit one way, avoiding
the creation of erroneous connections.
As a result of its industry standardization, Even though USB is backwards compatible,
there is a lot of support accessible. the newest computers could not always
able to accommodate a range of data transfer support the very early USB standards (V1).
speeds (from 1.5Mbps to 5Gbps)
as the cable provides +5V power, there is no In comparison to Ethernet connections, for
need for an external power source. instance, even the most recent USB-C
When mistakes are identified, the USB systems, version 3 (V3) and version 4 (V4),
protocol alerts the transmitter to retransmit have a slow data transfer rate (Note: USB V2
the data, resulting in error-free data has a maximum data transfer rate of
transmission. 480Mbps.)
Using USB hubs, adding more USB ports is
comparatively simple when needed.
USB is backwards compatible, meaning it can
still work with prior versions.
Parity Checks:
One technique for determining if data has been altered or corrupted after transmission is parity
checking. The basis of this strategy is the quantity of 1-bits that make up a data byte.
There are two possible names for the parity: ODD (an odd number of 1-bits in the byte) and
EVEN (an even number of 1-bits in the byte). A parity bit is reserved for one of the bits in the
byte, which is often the most significant or left-most bit. Depending on whether even or odd
parity is being used, the parity bit is set. As an illustration, look at the byte:
Example:
1 1 0 1 1 0 0
Since there are already an even number of 1-bits (four 1-bits) in the byte in this example, the
parity bit must be set to 0 if the byte is utilizing even parity.
As a result, we obtain:
0 1 1 0 1 1 0 0
1 1 1 0 1 1 0 0
NOTE: Before data is transferred, an agreement is made between sender and receiver regarding
which of the two types of parity are used. This is an example of a PROTOCOL.
Example no 2:
Nine bytes of data have been sent in this example. It is agreed upon that even parity shall be
used. The PARITY BYTE is another byte that has been sent. The parity bits generated by the
vertical parity check make up the entirety of this byte. The end of the data block is also
indicated by the parity byte.
The table first indicates that there was a problem after the data was transmitted. Second, the
location of the wrong bit value that resulted in the error can be located at the intersection of row
8 and column 5. Thus, byte 8 ought to contain the value
0 0 0 1 0 0 1 0
This would also fix column 5, resulting in a vertical parity that is even (now has four 1bits). As a
result, this byte could either be automatically fixed as previously demonstrated or the sender
may receive an error message requesting that they retransmit the data block. Finally, note that
the aforementioned procedure might not be able to find the fault if two of the bits change
value after data transfer. As an illustration, utilizing
Example 1 again:
0 1 0 1 1 1 0 0
0 1 1 1 1 1 0 1
Or:
0 1 0 1 0 0 0 0
Or:
0 1 0 1 0 1 1 0
Checksum:
One way to determine whether data has been altered or corrupted after transmission is to use
a checksum. Data is transmitted in blocks, with a supplementary value known as the checksum
delivered at the conclusion of each block.
Here is how the checksum procedure works:
The checksum of a data block is computed from the data block just before it is
transferred.
An algorithm that has been agreed upon by the sender and the recipient is used to
perform the calculation.
The data block is thereafter transmitted along with the checksum.
The computer at the receiving end uses the data block to recalculate the checksum (the
predetermined procedure is applied to find the checksum).
Next, the checksum sent with the data block and the recalculated checksum are
compared.
Resending the data block is requested if there are any transmission issues, as shown by
the two checksums being the identical.
Explained diagram:
Check Digits:
The last digit of a code is called a check digit, and its value is determined by adding together all
the previous digits. For product barcodes, such as International Standard Book Numbers (ISBN)
and Vehicle Identification Numbers (VIN), check digits are utilized. Check digits are used to find
data entry problems that result from incorrect barcode scanning or typing. Usually, they are
able to identify the following kinds of errors:
a wrong number typed; for instance, 5327 was entered in place of 5307
transposition mistakes in which the order of two numbers is altered, such as 5037
instead of 5307
missing or additional numbers, such as 53107 in place of 5307 or 537 in place of 5307
phonetic mistakes, such as saying Thirteen instead of Thirty (13).
To create a check digit, there are several techniques available. Here, two typical approaches will
be examined:
ISBN 13
Modulo-11
Example 1: ISBN 13
The thirteenth digit of the number is the check digit for ISBN 13. We shall now look at two
distinct computations. The check digit is generated as the initial calculation. The check digit is
verified (i.e., recalculated) in the second calculation.
First calculation: Using the other 12 digits in a number, create the check digit.
The check digit is produced from the other 12 digits using the following algorithm:
1. 9 + 8 + 3 + 0 + 8 + 8 = 36
2. 3 × (7 + 0 + 4 + 9 + 3 + 2) = 75
3. 36 + 75)/10 = 111/10 = 11 remainder 1
4. 10 – 1 = 9 the check digit
Consequently, we arrive at the thirteen-digit number that follows (which corresponds to the
number seen in Figure:
Second Calculation: The check digit is recalculated from the thirteen-digit number (which now
includes the check digit).
A comparable procedure is used to verify that an ISBN 13-digit code, including its check digit, is
accurate:
1. total the odd-numbered digits (including the check digit) together.
2. add up all the even numbers, multiply the result by 3.
3. add the outcomes from 1 and 2 and divide by 10.
4. if the remainder is zero, the answer is right.
Using the ISBN 9 7 8 0 3 4 0 9 8 3 8 2 9 (including its check digit) from Figure 2.17:
1. 1 9 + 8 + 3 + 0 + 8 + 8 + 9 = 45
2. 3 × (7 + 0 + 4 + 9 + 3 + 2) = 75
3. (45 + 75)/10 = 120/10 = 12 remainder 0
4. remainder is 0, therefore number is correct.
Example 1: Module-11
The modulo-11 approach is appropriate for numerous applications, including product numbers
and VINs, because it can have different number lengths. The check digit is generated as the
initial calculation. The check digit is verified (i.e., recalculated) in the second calculation.
First calculation: involves creating the check digit by using the other digits in the number.
The check digit is produced from the remaining seven digits using the technique below:
1. Starting from the left, each digit in the number is assigned a weight of 8, 7, 6, 5, 4, 3, or
with the weightings beginning at 8 because the number will become eight-digit once the
check digit is added.
2. Each value is added to the digit after it has been multiplied by its weighting to arrive at a
total.
3. the sum is split into 11 parts.
4. The check digit is then determined by subtracting 4 from 11 (notice that if the
remainder is 10, the check digit 'X' is used).
The example to be used has the following seven-digit number:
Second calculation: Recalculating the check digit from the eight-digit number (which now
includes the check digit) is the.
A similar procedure is used to verify that the eight-digit number, including its check digit, is
accurate:
1. 1 Starting from the left, each digit in the number is assigned a weight of 8, 7, 6, 5, 4, 3, 2,
or 1.
2. The digit is then multiplied by its weighting, and each value is combined to create the
total.
3. the sum is split into 11 parts.
4. If the remainder is zero, the number is accurate.
Applying the eight-digit code: 4 1 5 6 7 1 0 2
1. value of weighting Eight Seven Six Five Four Three Two One
2. Add: (8× 4) + (7× 1) + (6× 5) + (5× 6) + (4× 7) + (3× 1) + (2× 0) + (1× 2) = 32 + 7 + 30 +
30 + 28 + 3 + 0 + 2 total = 132
3. times the total by 11 to get 132/11 = 12 leftover 0
4. remainder equals 0, hence the number
ARQ makes use of timeouts, which are the amount of time that can pass before an
acknowledgement is received, as well as positive and negative acknowledgements,
which are signals delivered to the receiver indicating that data has or has not been
received correctly.
During data transmission, the receiving device receives an error detection code (usually
a Cyclic Redundancy Check; see Section 2.1.1); this code is used to determine whether
the received data contains any transmission problems.
A positive acknowledgement is returned to the sender device if there is no error found.
But today, in the event that a mistake is found, the receiving device requests that the
data be retransmitted and sends a negative acknowledgment to the transmitting device.
The sending device waits a predefined period of time in order to use a time-out.
And the sending device will automatically keep delivering the data until it receives a
positive acknowledgement if it has not gotten any kind of acknowledgement within this
time frame.
... or until a certain amount of retransmissions have occurred.
Mobile phone networks frequently use ARQ to ensure data integrity.
There is always a chance that data being transferred over a public network (wired or wireless)
will be intercepted by someone, like a hacker. In these situations, a hacker is frequently called
an eavesdropper. Encryption reduces this risk to some extent.
Data is transformed by encryption so that it cannot be read by someone for whom it was not
meant. While it cannot stop the data from being collected, it does impede the eavesdropper
from understanding it. This is especially crucial if the information is private or sensitive (such as
bank account information, credit card information, medical records, or legal papers).
Symmetric encryption:
An encryption key is utilized in symmetric encryption, and it is used to both encrypt and decrypt
the communication. Initially, contemplate a basic framework employing a decryption key and a
10-digit denary encryption key, resulting in 1 × 1010 potential codes. Let's say the encryption
key we have is:
4291362856
This indicates that each letter in a word is moved +4, +2, +9, +1, and so on, places throughout
the alphabet. As an illustration, consider the following message, which appears both plaintext
on the top line of Figure and ciphertext on the bottom line, both before and after the
encryption key is applied: COMPUTER SCIENCE IS EXCITING:
Applying the same decryption key, 4 2 9 1 3 6 2 8 5 6, will be required to return to the original
message. However, in this instance, the decryption procedure would be the opposite of the
encryption process, with each letter being shifted by –4, –2, –9, –1, and so forth. Take "G" for
"C," "Q" for "O," "V" for "M," "Q" for "P," and so forth.
But in a few of seconds, contemporary computers might "crack" this encryption key. We now
utilize 256-bit binary encryption keys, which provide 2256 (or roughly 1.2 × 1077) potential
choices, in an attempt to counter this. (When we go closer to quantum computers, even this
could not be sufficient.)
The actual challenge lies in maintaining the encryption key's secrecy (for instance, it must be
supplied over intercept able text or email messages). Because both the sender and the recipient
need the same encryption key, security is always the primary disadvantage of symmetrical
encryption.
Asymmetric encryption:
To address the security issues with symmetric encryption, asymmetric encryption was created.
The public key and the private key are the two keys that are used in it:
public key (made available to everybody)
private key (only known to the computer user).
3. Tom now encrypts the document he wants to deliver to Jane using her public key (). He
then returns Jane his encrypted paper, or ciphertext.
4. The public key that was used to encrypt the document and the private key that was
used to decrypt it are a matching pair that were generated on Jane's computer, which is
how Jane unlocks and decrypts Tom's document using her matching private key (). Jane
is unable to decrypt the message using the public key.
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:
Should all five workers need to communicate in both directions, they will each need to create a
set of public and private keys that match. After completing this, all users must exchange public
keys in order to transmit encrypted files, documents, and messages to one another. The
information that is transmitted to each employee will then be decrypted using their individual
private key.