Here is a diagram of a simple star network. It shows computer A sending data to computer D:
Now what would happen if computer B also wanted to send data to computer D, a the same time? This isn't an unusual situation. D might be the file server, and the other computers might be reading and writing files to it all the time.
Networks use packet switching to cope with this.
The idea of packet switching is quite simple:
If A and B try send data to D at the same, the will switch alternate between sending some packets from A and some packets from B. It will appear as if both sets of data are being transferred simultaneously.
In a [[Mesh network topology|mesh network]], there are usually several different routes between any two computers on the network.
In that case, when data is transferred it is possible that some of the packets will take different routes through the network. Some packets from A to D might go directly, some might go via node E, some via node B, for example.
Packet switching is a feature of TCP/IP, that is used by the Internet and most local area networks.
What does a packet contain? The content is divided into two parts:
The header contains the following information:
The sequence number is required because the packets might not arrive in the order they were sent. If different packets arrive by different routes, it is possible that some later packets will arrive before some of the earlier packets.
The information in the header allows the device receiving the packets to put them back together to recreate the data that was sent.
An alternative to packet switching is circuit switching.
Consider the star network above. In a circuit switching network, if A wanted to send data to D, the switch would connect the two computers directly, and they would have dedicated use of the connection until they had finished the data transfer. If B wanted to send data to D, it would have to wait until A was finished.
The vast majority of modern networks use TCP/IP, which uses packet switching. Circuit switching is quite rare.
Older analogue phone lines used circuit switching - when you made a call, your phone would be directly connected to the person you were calling until the call ended. Modern services such as Skype send audio data over the Internet using packet switching.
Copyright (c) Axlesoft Ltd 2020