CS Assignment
CS Assignment
Done by:
Referenced on:
A data packet (sometimes called datagram) is the form in which computer data is
transmitted from one device to another. The packets are quite small (around 64 KiB per
packet).
Data structure
Header: The header contains the surface level information about the packet including IP
addresses, sequence number of the packet, size of the packet.
Payload: The payload contains the actual data of the packet, represented in binary or
hexadecimal. It is typically around 64 KiB
Trailer: The trailer contains information about the method of identification of the
packet and some sort of error checking method to ensure it arrives without error.
Packet switching
Packet switching is a method of data transmission in which a message/data is broken
up into number of packets, each packet can then be sent independently from start point
to end point. At the destination the packets will be reassembled into their correct order
using sequencing number included in the data header
This ensures that data arrives to the receiver in the most optimized route and to prevent
data loss.
First, from the sender the data is broken down into smaller packages
Then the packages travel through other devices (also called nodes) to the
receiving node,
The most optimal route is used to join the sender to the receiver
The data is then reconstructed at the receiving end and then is read by the
receiving device
Figure of how packet switching works
Transmission direction:
Simplex: Simplex mode occurs when data can be sent in One Direction Only.
Half-duplex: Half duplex mode occurs when data is sent in Both Directions but Not at
the same time
Full-duplex: Occurs when data can be sent in Both Directions at the Same Time
Transmission channel:
Serial data transmission: Occurs when data is sent at only one bit at a time over a
single wire/channel.
Parallel data transmission: Occurs when several bits of data are sent through several
channels/wires all at the same time.
Note: Data can become unorganized (skewed) when travelling over long distances)
Error Checking
When data is being send to other devices, there is a chance that the data can contain
errors which make it hard or impossible to decode the data or it might send
misinformation down to the receiver.
To prevent this, there are multiple error checking methods which include:
Parity Check: Parity checking is a method used to check whether data has been
changed or corrupted. This method is based on the number of 1-bits in a byte of data.
The parity can either be called Even (when an even number of 1-bits in the byte) or Odd
(when there is an odd number of 1-bits in the byte)
Checksum: A method that uses a common checking method, adds up all values and sees
if it matches with the method that is being used. Very simple and effective, but is not
precise enough to be able to detect superficial errors
Easiest to implement but can add significantly more delay to data transmission.
Automatic Repeat Request: A technique, not much of a method that is used alongside
other error checking methods. It works on Acknowledgements. It works like-
Sender
sends
data Yes No
again If data
contain
error
Receiver sends
Receiver sends
Negative
Acknowledgement to
Acknowledgement to
sender
Sender
Encryption
Encryption is the method of scrambling data to secure its true meaning for data security
or privacy; there are mainly two types of encryptions
Symmetric Encryption: A system where there is one key that can both decrypt and
encrypt data.
Asymmetric Encryption: The system where separate keys are used to encrypt and
decrypt data instead of the same key.