Datagram vs Virtual Circuit Approach in Packet Networks: Concepts, Diagrams, and Comparisons
In packet-switched networking, two fundamental forwarding/service models are commonly contrasted: the datagram approach and the virtual circuit approach. Both models move data in units called packets (often with headers), but they differ in how routing decisions and network state are handled.
At a high level:
- In the datagram approach, each packet carries enough information for routers to decide where to send it, typically based on the destination address. Routers generally do not maintain per-flow forwarding state between packets.
- In the virtual circuit approach, a path (virtual circuit) is established first; routers keep state so that subsequent packets of that “connection” follow the same path, using a virtual circuit identifier (VCI) in their headers.
Conceptually, you can think of datagrams as “send each letter with an address” and virtual circuits as “set up a specific mail route, then send multiple letters on that same route.”
Below is a visual comparison of the two models.
Key terms you’ll use throughout:
- datagram
- virtual circuit
- VCI
- per-packet routing
Datagram vs Virtual Circuit (overview)
Datagram Approach (Connectionless Packet Delivery)
In the datagram approach, routers treat each packet as an independent unit. When a packet arrives at a router, the router consults the packet’s header (commonly including a destination address) and selects the next hop. Importantly, this decision is not tied to a previously established end-to-end session state.
Characteristics (typical):
- connectionless operation (no call setup)
- routing decisions made independently for each packet
- network paths can differ per packet, due to load changes or different routing outcomes
- minimal per-flow state in routers (only the packet header is used for forwarding)
Diagram (per-packet independent forwarding):
Virtual Circuit Approach (Connection-Oriented Packet Delivery)
In the virtual circuit approach, the network establishes a path before data transfer begins. During setup (often called call establishment), routers along the route store state that binds a VCI (or similar label) to the appropriate outgoing interface/next hop.
After the setup:
- each data packet contains the VCI (rather than requiring the routers to repeatedly compute full end-to-end routing)
- routers use their stored state to forward packets consistently along the established path
Diagram (setup phase + data phase):
Side-by-Side Comparison (What Changes, What Stays the Same)
Both models are packet-switched and can be used to transport data reliably or unreliably depending on higher-layer mechanisms (e.g., transport protocols). The difference is primarily where path decisions and network state live.
| Aspect | Datagram approach | Virtual circuit approach |
|---|---|---|
| Setup phase | None (connectionless) | Yes (call/VC establishment) |
| Forwarding basis | Destination address (per packet) | Stored per-VC state + VCI label |
| Router state | Typically minimal (no per-flow forwarding state) | Maintains per-VC state mappings |
| Path behavior | May vary packet-to-packet | Fixed path during VC lifetime |
| Failure handling | Reroute logic may handle failures per packet | VC may need teardown/re-establishment or defined behavior |
Key terms reinforced:
- connectionless
- connection-oriented
- VCI
- next hop
Datagram Forwarding: How a packet travels hop-by-hop
- 1Step 1
The source creates a packet with a header containing a destination (and other fields needed for forwarding).
- 2Step 2
When a router gets the packet, it parses the header and identifies the destination.
- 3Step 3
The router performs a forwarding decision (e.g., via a routing table/lookup) independently for this packet.
- 4Step 4
The router sends the packet to the selected next hop; no end-to-end session state is required.
- 5Step 5
Each router repeats the same independent decision for the next packet arriving (even if it belongs to the same application flow).
Virtual Circuit Forwarding: Setup then reuse a labeled path
- 1Step 1
The source (or signaling) requests creation of a virtual circuit to the destination.
- 2Step 2
Each router on the route creates/records a mapping from the incoming VCI to an outgoing next hop.
- 3Step 3
The routers agree on labels/identifiers so subsequent data packets can be forwarded consistently.
- 4Step 4
The source sends packets carrying the active VCI in their headers.
- 5Step 5
Routers forward by consulting their stored VC mapping rather than recomputing end-to-end routing per packet.
- 6Step 6
When communication ends, the VC may be torn down and router state removed.
Mental model for exams
If you see “independent routing per packet” think datagram. If you see “setup + labeled path reused” think virtual circuit.
Be careful with the word “connection”
A virtual circuit is a connection at the network/packet-forwarding model. It is not necessarily the same as a transport-layer connection in the end hosts (e.g., TCP). Always specify the layer.
Conceptual Trade-off Summary (Qualitative)
Relative tendencies to change across datagram vs virtual circuit models
Virtual Circuit Lifecycle
Create virtual circuit
1) SetupSignaling establishes a path and router state mapping using a VCI."
Send data packets
2) TransferPackets carry the VCI; routers forward using stored next-hop mappings."
Release resources
3) TeardownState is removed after completion or failure handling per design."
Common Edge Questions
Datagram vs Virtual Circuit Flashcards
Knowledge Check
In the datagram approach, how do routers typically forward packets?