Data Transmission
Computer science (IGCSE)
Data Packets
When transmitting a file or data from one device to another, the data must be sent as quickly as possible
whilst maintaining data integrity. If the data is transmitted as a large block, or in its entirety, it can take
too much time before the recipient receives it.
Breaking the data into smaller ‘chunks’ allows it to be transmitted faster from the sending device to the
receiving device. These smaller chunks are known as data packets, or simply
A packet is a small unit of data that can be transmitted from a sending device to a receiving device via a
network communication protocol.
Structure of a data packet
Because each packet is a small, fixed portion of a data item, there must
be some way of identifying it on the network. For example, you need to
know where the packet is coming from, where it is going, and what part
of the message it carries. Generally, a packet consists of three major
parts:
1.Header
2.Payload
3.Trailer
Structure of a data packet
Data found in the header of a packet
The header of a packet contains information used by routers to determine the
source and destination of a packet.
The information inside the header is also essential for reconstructing the
original message at the receiving device when
multiple packets are received.
Examples of data found in the header of a packet include:
1.The IP address of the sending device
2.The IP address of the receiving device
3.Packet number (to indicate the position of each packet in the original message)
Payload
The payload is the part of a data packet that carries the actual data.
However, it is important to remember that the data delivered
via a single packet is incomplete, as it is only a fragment of the original
message.
It will take data from multiple packets to reconstruct the original
message, and the packets must be rearranged in
the same order they left the sender’s computer.
Each packet is identified by the packet number found in the header.
Arranging the packet numbers will put the message fragments in order,
and the original message will have been reconstructed.
The Trailer
The trailer is the part of the packet that tells the
receiving device that the end of the packet has
been reached and not to expect any more data to
be transmitted from that packet.
Packet switching
A number of methods can be used to transmit data efficiently
from the sending to the receiving computer. One of these
methods is known as packet switching
In this method, the data packets are each sent via a different
route to their destination, and may arrive out of order.
Several factors can determine the route a packet takes on its
way to its destination. These may include the route
availability, i.e. is there congestion (too many existing
packets on the route)? It may also be that an error is detected,
so the packet has to be resent and may take a different route
the second time.
When the packets arrive, they may be out of order due to delays in their
respective routes, so they will need to be re-ordered to reconstruct the
original message.
This is where the packet number becomes essential to determine a
packet’s position in the original message.
Advantages and disadvantages of packet switching
Advantages
• Packets can take different routes to get to their destination.
• A router can be used to determine each packet’s best route.
• Any transmission errors, such as corrupt or missing packets, can be detected whenever
they occur. (When this happens, the receiving computer can request for the corrupt packet to be resent.)
Disadvantages
• packets may be dropped if they move around the network for a certain period without
being delivered.
• Each packet is assigned a time to live (TTL)
• The maximum amount of time a packet is allowed to stay on a network before it is
delivered, measured in hops.
• A hop is the number of routers a packet moves across before getting to its destination
computer.