In this tutorial, you are going to learn about Switching in Computer Network and its types.
Switching in Computer Network
Switching in a computer network helps in deciding the best route for the data transmission if there are multiple paths in a larger network.
Switching technique is used to connect the system for making one-to-one communication. Switching techniques are mainly divided into three parts:
- Circuit Switching
- Message Switching
- Packet Switching
Packet Switching is further divided into two parts:
- Datagram Approach
- Virtual Circuit Approach.
Circuit Switching
There are three phases of Circuit Switching:
- Connection Establishment
- Data transfer
- Connection Disconnection
In circuit switching first Connection is established. Then Data transfer happens using that established connection or channel and this established connection is reserved between the sender and receiver. After completion of phase number 2 connection gets terminated i.e., Phase number 3 comes into action.
Example: Best example is the way as the telephone works.
Here in the diagram, you can see in phase 1 connection is being established between A and D for one-to-one communication. After that Data transfer starts happening and when the task is completed the connection between A and D is terminated.
Message Switching
It uses the Store and Forward mechanism. Message is transferred as a complete unit and forwarded using store and forward mechanism at the intermediary node.
In message switching, Sender sends the message which got broken into pieces and stores the full message to 1st hop i.e., intermediary device, then again it gets stored in next hop it continues until it reaches the receiver.
There are some drawbacks of the Message switching:
- Every Switch in transit path needs enough storage to accommodate the entire message.
- Message switching is very slow because of its store and forward technique.
- It is not suitable for streaming media and real-time applications.
Packet Switching
The internet is a packet switched network. Messages are broken into individual chunks called packets. Each packet is sent individually. Each packet will have a Source and Destination IP address with sequence number. Packets will travel across the network, taking the shortest path as possible. If packets are missing or corrupted, then the message will be sent to resend the message.
Sequence number will help the receiver to
- Reorder the packets.
- Detect missing packets and
- Send acknowledgement.
Approaches of Packet Switching
There are two approaches of packet switching
- Diagram Packet switching
- Virtual Packet Switching.
Datagram Packet Switching
- Datagram Packet Switching is also known as connectionless switching.
- Each independent entity is known as a datagram.
- Datagram contains destination information and the intermediary devices use this information to forward datagrams to the right destination.
- In this packet Path is not fixed. Intermediate nodes take the routing decisions to forward the packets.
Virtual Packet Switching
- Virtual Switching is also known as connection-oriented switching.
- In the case of Virtual circuit switching, a pre-planned route is established before the messages are sent.
- Call request and call accept packets are used to establish the connection between sender and receiver.
- In this approach, the path is fixed for the duration of a logical connection.
Difference Between Datagram Approach and Virtual Circuit Approach
Datagram approach | Virtual Circuit approach |
To forward the packets, nodes take the routing decisions. | Nodes does not take any routing decisions. |
Conjunction cannot occur as all the packets travel in different directions. | Conjunction can occur when the node is busy, and it does not allow other packets to pass through. |
It is more flexible as all the packets are treated as an independent entity. | It is not very flexible. |
Advantages of Packet Switching
Cost Effective: Switching devices do not require massive secondary storage to store the packets.
- Reliable: If any node is busy, then the packets can be rerouted.
- Efficient: It does not require any establishment path prior to the transmission, and many users can use the same communication channel simultaneously.
Disadvantages of Packet Switching
- Packet Switching technique cannot be implemented in those applications that require low delay and high-quality services.
- The protocols used in a packet switching technique are very complex and require high implementation cost.
- If the network is overloaded or corrupted, then it requires retransmission of lost packets. It can also lead to the loss of critical information if errors are nor recovered.
This article on 'Switching in Computer Network' is contributed by Aditya Raj. If you like TheCode11, then do follow us on Facebook, Twitter and Instagram.