Packets, transmission methods and direction
IGCSE Computer Science · Data Transmission
Data packets
Large files are broken into small packets before being sent. Each packet has three parts:
| header | the destination address, the sender's address, and the packet number |
| payload | the actual data being carried |
| trailer | an error-checking method, and a marker showing the packet has ended |
The packet number is the part students forget, and it is essential: packets can arrive out of order, so the receiver needs the numbers to reassemble the file correctly.
Packet switching
Packets travel independently, and each one is routed by whichever path is least congested at that moment. So packets of the same file may take different routes and arrive out of order, and the receiving device reassembles them using the packet numbers.
Advantages: no single line is tied up, so the network is used efficiently; and if one route fails, packets are simply re-routed around the problem.
Disadvantages: packets can arrive out of order or be lost, so they must be reassembled and any missing ones requested again — which adds delay.
Serial and parallel transmission
| serial | bits are sent one at a time down a single wire |
| parallel | several bits are sent simultaneously down several wires |
Parallel is faster over short distances, but it has a serious weakness over long ones: the bits travel down slightly different wires at slightly different speeds, so they arrive at different times. This is called skew, and it corrupts the data.
Serial has no skew because there is only one wire. It is also cheaper (fewer wires) and more reliable over distance — which is why almost all long-distance transmission, including USB and network cables, is serial.
So "parallel is faster" is only true over short distances. Over long ones, serial wins.
Direction of transmission
- simplex — data travels in one direction only. Example: a computer sending to a printer that gives no status back;
- half-duplex — data travels in both directions, but not at the same time. Example: a walkie-talkie;
- full-duplex — data travels in both directions simultaneously. Example: a phone call, or broadband.
The pair most often confused is half-duplex and full-duplex. Both send in two directions — the difference is only whether they can do it at the same time.
USB
USB is a serial connection. Its advantages: the connector only fits one way so it cannot be plugged in wrongly; it is a universal standard supported by almost all devices; it can supply power as well as data; and it is automatically detected by the operating system.
Its limits: cable length is restricted (long cables cause signal loss), and older USB standards are slower than some alternatives.
Worked example: choosing serial or parallel, and explaining skew
(a) Explain why almost all long-distance connections use serial transmission, even though parallel transmission can send many bits at once. (b) State three advantages of USB.
Solution
(a) Why serial wins over long distances.
Reason one — skew. Parallel transmission sends several bits at once over different wires. But those wires are not exactly identical: they differ slightly in length, resistance and interference.
Over short distances, that difference is negligible. But the farther the signal travels, the more the difference accumulates, so bits that should arrive together arrive out of step.
This is called skew, and when it becomes large enough, the receiver cannot correctly reassemble which group of bits belongs with which — the data is corrupted.
Serial transmission cannot suffer skew, because there is only one wire and the bits travel one after another in the correct order.
Reason two — cost. Parallel needs many wires. For a cable hundreds of metres or kilometres long, a cost eight or sixteen times higher is unacceptable.
Reason three — crosstalk. Many wires running close together also cause interference with each other, making the problem worse.
Conclusion. The statement “parallel is faster” is only true over short distances — such as inside a computer's circuit board. Over long distances, serial is both cheaper and more reliable, so it is the choice for USB, network cables and every long-distance link.
(b) Three advantages of USB.
One — it cannot be plugged in the wrong way. The connector is designed to fit in only one orientation, so the user cannot plug it in backwards and damage the device.
Two — a widespread standard. Almost every device supports USB, so the same cable can be used for many different computers and peripherals. The operating system also detects it automatically, so no manual installation is needed.
Three — it supplies both power and data. Many devices — mice, keyboards, portable hard drives — need no power supply of their own because they draw power through the USB cable itself.
Limitations worth stating: the cable length is limited because long cables cause signal loss, and older USB standards are slower than some alternatives.
Worked example: packets and packet switching
Describe the three parts of a packet and the contents of each. Then explain how packet switching works, and why the packet number is essential.
Solution
The three parts of a packet.
The header. Contains the destination address so the network knows where to send the packet, the sender's address so the receiver knows who to reply to, and the packet number.
The payload. Contains the actual data being carried — the part of the file's content.
The trailer. Contains the error-checking method so the receiver can check whether the data was corrupted on the way, and an end-of-packet marker.
How packet switching works.
A large file is split into many small packets. Each packet travels independently, and at each network node, the router chooses for it the route that is least congested at that moment.
Consequence: the packets of the same file can take different routes, and because the routes differ in length, they arrive out of order.
Why the packet number is essential.
Without the number, the receiver has no way of knowing which packet comes before which. It would assemble the pieces in the order they arrive, and the resulting file would be jumbled and useless.
With the number, the receiver simply re-sorts them by number and then assembles them — whatever order they arrive in.
The number does a second job too: it lets the receiver know which packet is missing. If packets $1, 2, 4, 5$ are received, packet $3$ has clearly been lost, and the receiver asks for exactly that packet to be resent instead of resending the whole file.
Advantages of packet switching. No line is held exclusively, so the network is used efficiently; and if a route fails, the packets are rerouted around the fault so the connection is not cut.