A communication method where a data stream is divided into smaller packets and transmitted independently through the network. More efficient than leased lines.
A packet contain a header, data payload.
Steps:
- Data is divided into packets.
- Each packet is transmitted independently.
- Routers forward packets from node to node.
- Packets eventually reach the destination host.
Each packet of the same data stream might be routed through different routes.
2 approaches.
Connectionless
Packets transmitted without establishing a connection beforehand. Simple. Flexible.
A network following connectionless packet switching is called as connectionless network or a datagram service.
Each packet contains the destination address. Routing decisions are made independently for each packet. Usually no built-in error control.
Forwarding
The process of switching a packet from an input line to an output line. Done by routers using forwarding tables. Each router maintains a forwarding table mapping from destination address to next hop.
Connection-Oriented
Packets transmitted after establishing a virtual circuit between source and destination before transmitting packets.
A network following connectionless packet switching is called as connectionless network or a datagram service.
Connection setup required. Packets follow the same pre-determined path. Routers maintain connection state. Network may provide error control.
Connection Identifier
Aka. CID. Each incoming and outgoing virtual circuit on a switch has a unique identifier. Unique inside a given link. Used in connection-oriented networks.
Routers maintain forwarding tables mapping from incoming CID to outgoing CID. Packets are forwarded based on the CID. Faster forwarding compared to full destination addresses.
Comparison
| Feature | Connectionless | Connection-Oriented |
|---|---|---|
| Setup | Not required | Required |
| Packet addressing | Destination address | Connection ID |
| Router state | No state | Maintains state |
| Routing | Per packet | Per connection |
| Failure handling | Minimal effect | Virtual circuits terminate |
| QoS | Difficult | Possible |
| Congestion control | Difficult | Possible |