Mode of data transfer -> Circuit Switching & Packet Switching
The
Imagine you want to send a long message from Computer A to Computer B.
- Circuit switching: establish one fixed route first, then send everything along that route.
- Packet switching: break the message into packets, then send each packet independently through the network.
Circuit Switching
- Connection-Oriented Communication
- A connection must be established before data transmission begins.
- All data follows the same path throughout the communication.
- The connection is terminated after transmission is complete.
- Example: early telephone systems established a fixed path between the caller and receiver.
- It is not implemented at the network layer.
Packet Switching
- Connectionless Communication
- No connection is established before data transmission begins.
- Data is divided into smaller units called packets.
- Each packet is individually addressed and sent to the receiver.
- Each packet may take a different path to reach the destination.
- Receiving computer wait for all packets of the message and reassembles the packets into the original message before delivering the message to the upper level.
- Network layer in the Internet is packet-switched network.
| Feature | Circuit switching | Packet switching |
|---|---|---|
| Connection established first? | Yes | No |
| Data divided into packets? | Not in the same independent-routing sense | Yes |
| Route | Same fixed route | Each packet is handled independently |
| Resources | Route or capacity is reserved | Network resources are shared |
| Order of arrival | Normally in order | May arrive out of order |
| Efficiency | Can waste reserved capacity | More efficient use of network capacity |
| Main example | Early telephone systems | The Internet |
Model Definition
Circuit switching is a method of data transmission in which a dedicated connection is established between the sender and receiver before communication begins. All data is then transmitted along the same fixed path throughout the entire communication.
Packet switching is a method of data transmission in which a message is divided into smaller units called packets. Each packet is individually addressed and transmitted independently through the network, possibly taking a different route. At the destination, the packets are reordered and reassembled to form the original message.
Differences, Advantages and Disadvantages
| Feature | Circuit switching | Packet switching |
|---|---|---|
| Connection | A connection must be established first | No connection is established first |
| Route | All data travels along the same fixed path | Packets are sent independently and may take different paths |
| Data transmission | Data is sent as a continuous stream | The message is divided into packets and reassembled at the destination |
| Advantages | Disadvantages |
|---|---|
| Data arrives in the correct order | Time is needed to establish the connection |
| Delay is predictable after connection | Reserved network resources may be wasted |
| No need to reorder and reassemble packets | The connection fails if the fixed path fails |
| Advantages | Disadvantages |
|---|---|
| Network resources are shared efficiently | Packets may arrive out of order |
| No connection setup is required | Packets may be lost during transmission |
| Packets can use an alternative route if one route is unavailable | Different routes may cause variable delays |
Protocol
Definition
A set of rules, standards, or procedures that govern how data is transmitted, received, and interpreted between devices in a communication network.
| Protocol | Purpose |
|---|---|
| Internet Protocol version 4 (IPv4) | Responsible for packetising, forwarding and delivering packets at the network layer. |
| Internet Control Message Protocol version 4 (ICMPv4) | Supports the unreliable and connectionless IPv4 protocol by handling errors that may occur during network-layer delivery. |
| Internet Group Management Protocol (IGMP) | Supports IPv4 multicasting, allowing data to be sent to a group of devices. |
| Address Resolution Protocol (ARP) | Connects the network and data-link layers by mapping network-layer addresses, such as IP addresses, to data-link-layer addresses, such as MAC addresses. |
IP
Definition
An unreliable connectionless protocol responsible for source-to-destination delivery
Address Resolution Protocol (ARP)
- Protocol used for sending error message, performing diagnostics, control the flow of data
Internet Control Message Protocol / Internet Group Message Protocol
- Protocol that enables one host to send one stream of data to many hosts at the same time.
IP Address
- Every host on a TCP/IP network needs to have a unique address. With this unique address, it is possible to send data from host to host.
- Every packet contains addressing information in the header, and the IP address in the header is used to route packets
IPv4
- 32-bit address that uniquely identifies every host on a network

IPv6
-
128-bits addresses
-
8 groups of 4 hex digits (16 bits)
- eg. EFDC:BA62:7654:3312:EFDC:BA72:7653:3210
-
IPv6 Zero Compression
- IPv6 addresses containing many zeros can be shortened using zero compression.
- Step 1: Remove leading zeros
- Leading zeros within each group can be removed.
- Example:
0008becomes8, and0800becomes800.
- Step 2: Use double-colon notation
- Consecutive groups containing only zeros can be replaced with
::. ::can only be used once in an IPv6 address.
- Consecutive groups containing only zeros can be replaced with
-
Example
- Original:
1080:0000:0000:0000:0008:0800:200C:417A - Step 1:
1080:0:0:0:8:800:200C:417A - Step 2:
1080::8:800:200C:417A
- Original:
| Feature | IPv4 | IPv6 |
|---|---|---|
| Address size | 32 bits | 128 bits |
| Address format | Dotted decimal | Hexadecimal, colon-separated |
| Number of addresses | Approximately 2³² | Approximately 2¹²⁸ |
| Header size | Variable | Fixed and simplified |
| Broadcast | Supported | Replaced by multicast |
IPv4 Classes
| Class | Network Portion | Host Portion | Range | Usage |
|---|---|---|---|---|
| A | 8 bits (first bit = 0) → 2^7 networks | 24 bits → 2^24 hosts | 0.0.0.0 – 127.255.255.255 | Very large networks |
| B | 16 bits (first two bits = 10) → 2^14 networks | 16 bits → 2^16 hosts | 128.0.0.0 – 191.255.255.255 | Medium networks |
| C | 24 bits (first three bits = 110) → 2^21 networks | 8 bits → 2^8 hosts | 192.0.0.0 – 223.255.255.255 | Small networks |
| D | First four bits = 1110 | N/A | 224.0.0.0 – 239.255.255.255 | Multicasting |
| E | First four bits = 1111 | N/A | 240.0.0.0 – 255.255.255.255 | Experimental/future use |
Class A
A Class A address has:
Network.Host.Host.Host
- First 8 bits are the network portion.
- Remaining 24 bits are the host portion.
- The first binary bit is always
0. 0.0.0.0is reserved.127.0.0.0is reserved for loopback.
For one Class A network:
possible host combinations.
However:
- All host bits
0represent the network address. - All host bits
1represent the broadcast address.
Therefore:
usable host addresses.
Class B
A Class B address has:
Network.Network.Host.Host
- First 16 bits are the network portion.
- Remaining 16 bits are the host portion.
- The first two binary bits are
10.
For each Class B network:
usable host addresses.
Example:
Network address: 172.16.0.0
Broadcast address: 172.16.255.255
Class C
A Class C address has:
Network.Network.Network.Host
- First 24 bits are the network portion.
- Remaining 8 bits are the host portion.
- The first three binary bits are
110.
For each Class C network:
usable host addresses.
Example:
Network address: 192.168.1.0
Broadcast address: 192.168.1.255
Class D&E
| Class | Purpose |
|---|---|
| D | Multicasting: transmitting data to a selected group of devices |
| E | Reserved for experimental or future use |
IPv4 Limitations
- Inflexible and cannot adapt to every network size.
- Address exhaustion (used too quickly).
- Inefficient routing tables (too large).
Solutions
- Subnetting
- The process of dividing a large network into smaller, more manageable subnetworks, or subnets.
- Helps solve the shortage of network addresses in classful addressing, especially for Class B networks.
- Allows one network prefix to be used for multiple physical networks.
- Helps organise networks more efficiently.
- Reduces broadcast traffic.