ELEC3506

Physical LayerLecture 218 min

Switching — Circuit, Datagram and Virtual-Circuit Networks

Three ways a network moves your data from source to destination, and what each one gives up to get there.

By the end of this page you should be able to

  • Describe the three phases of circuit switching and what a dedicated path costs
  • Distinguish datagram (connectionless) switching from virtual-circuit switching
  • Explain the two addressing schemes a virtual-circuit network uses, and why one of them changes at every hop
  • Name the four components of a packet switch and what each one does

The idea

A phone call and a web request both move data from one point to another, but they do it in opposite ways. A phone call reserves a path for the whole conversation before either side says a word. A web request has no such reservation — every packet finds its own way, independently, and the network figures out the rest as it goes.

Those are two ends of a spectrum, and tutorial 2 asks you to name three traditional switching methods: circuit switching, packet switching (itself split into virtual-circuit and datagram), and message switching — named in the tutorial’s list, but not otherwise described in the material available here.

The two ends of the spectrum — circuit and datagram — are opposites. Virtual circuit sits between them on purpose, borrowing a piece from each.

Three switching strategies over the same small network of a source, two alternative intermediate nodes, and a destination. Circuit switching reserves a single dedicated path for the whole call. Datagram switching sends each packet independently, so packets 1, 2 and 3 take different routes and can arrive out of order. Virtual-circuit switching sets up one path once, and every packet in the connection follows that same path in order.Circuit-switched — one dedicated path, reserved for the callSourceDestDatagram — no reserved path, each packet routed independentlySourceDest123Virtual circuit — path set up once, packets numbered and kept in orderSourceDest123
Virtual circuit sits between the other two on purpose: it gets datagram switching's per-packet structure and circuit switching's ordering guarantee, at the cost of a setup phase neither pure approach needs.

Circuit switching

How it works

A dedicated path, reserved for the whole call

A physical circuit is established before any data moves, and stays reserved for the entire connection. Three phases, always in this order: setup, data transfer, teardown. Resources — bandwidth on every link along the path — are allocated at setup and held until teardown, whether or not data is actually flowing at any given instant.

This is how the telephone network works, and it is the reason a phone call gets consistent quality: the path is exclusively yours for as long as the call lasts.

Datagram networks

How it works

No reservation, no fixed path

Datagram networks — also called connectionless — make no resource reservation. Resources are allocated on demand, first come first served, and each datagram is treated independently of every other one, even datagrams belonging to the same conversation.

There is no circuit establishment and no control messages before data moves — the first packet can simply be sent. Every router along the way must make its own routing decision on each packet, which is why this style of switching is done at the Network Layer. Because no packet depends on a previously-established path, a failed link does not take down an existing connection the way it would in circuit switching — the next packet is simply routed around it. The lecture calls this inherently more reliable, and it is better suited to short messages, where the overhead of setting up a circuit would outweigh the data being sent.

Virtual-circuit networks

How it works

A hybrid — usually built at the data link layer

Virtual-circuit networks combine circuit switching and packet switching, and are usually implemented at the data link layer.

Similar to circuit switching: three phases (setup, transfer, teardown), resources allocated at setup, and every packet follows the same path, preserving order.

Similar to datagram switching: data is still packetized into datagrams — this is not a single continuous stream the way a circuit is.

The trade-off is complexity. A virtual circuit requires circuit establishment and control messages exchanged before any data transmission. Once set up, subsequent packets are all treated the same way and need no further routing decision — that decision was made once, at setup, for the whole connection. This makes virtual circuits well suited to longer messages, where paying the setup cost once is worth the saving on every packet after it.

There are two kinds:

  • Switched Virtual Circuit (SVC) — established on demand, the way a modem connection is set up.
  • Permanent Virtual Circuit (PVC) — established by prior arrangement, used for control signalling.
Circuit-switchedDatagram (connectionless)Virtual-circuit
Connection establishmentRequired — dedicated physical pathNoneRequired — control messages before data
PhasesSetup, transfer, teardownNone — data sent immediatelySetup, transfer, teardown
Resource allocationReserved at setup, held for the callOn demand, first come first servedReserved at setup
Data formatContinuous stream on a dedicated pathIndependent datagramsPacketized, but following one fixed path
Routing decisionMade once, at setupMade per packet, at every hopMade once, at setup — none needed after
Layer of operationA real physical path, not a layered protocolNetwork LayerUsually Data Link Layer
Best suited toSustained, real-time traffic (voice)Short messagesLonger messages, where order matters
This is tutorial 2's seven-aspect comparison (Q27), laid out in one table.

Addressing — the part that trips people up

How it works

Datagram: one address, unchanged. Virtual circuit: two addresses, one of them changing

Datagram addressing. The source and destination IP addresses are examined at every router, looked up against a routing table to find the output port. The address itself stays the same for the entire journey.

Virtual-circuit addressing uses two distinct kinds of address:

  • Global addressing — the source and destination IP, used to identify the connection during setup only.
  • Local addressing — the VCI (virtual-circuit identifier), assigned during the setup acknowledgement and used during data transfer. The VCI changes at every hop, while the global address remains constant throughout.

Where marks get lost

It is the VCI that changes, not the global address

The natural assumption is that an address either changes at every hop or it does not. Virtual-circuit switching does both at once, for two different addresses: the global (IP) address is fixed for the life of the connection, while the local VCI is deliberately re-assigned hop by hop — it is cheaper for a switch to swap a short local label than to re-examine a full IP address on every packet. Get the two addresses backwards and the whole answer to Q29 is wrong.

Check yourself

A virtual circuit has been set up between two hosts. During data transfer, which address does an intermediate switch actually use to forward the packet — and does that address stay the same at the next switch?

The VCI (local address). No — it changes at every hop; a new VCI is assigned by each switch along the path. Only the global (IP) address, used during setup, stays constant end to end.

Inside a packet switch

How it works

Four components

Every packet switch is built from four parts:

  • Input Port — buffers incoming data as it arrives.
  • Output Port — queues and transmits outgoing data.
  • Routing/Switching Processor — performs the routing-table lookup that decides where a packet goes.
  • Switching Fabrics — physically move packets between the input and output queues.

In the exam

  • Circuit vs datagram vs virtual-circuit. The seven-row comparison table above — connection establishment, phases, resource allocation, data format, routing decision, layer, and best use — is close to a guaranteed question in some form.
  • The three phases. Setup, data transfer, teardown — for both circuit switching and virtual circuits. Datagram networks have none of these.
  • Addressing. Datagram: one address, unchanged. Virtual circuit: global address (setup, fixed) plus VCI (data transfer, changes every hop). Do not mix these up.
  • SVC vs PVC. On-demand versus prior arrangement — one line each, with an example (modem connection; control signalling).
  • Four packet-switch components. Input Port, Output Port, Routing/Switching Processor, Switching Fabrics — and what each one does.
  • Why datagram is “more reliable.” Because no packet depends on a previously-established path, a single failed link does not take an ongoing connection down with it.

Check yourself

  1. What are the three phases every circuit-switched connection goes through?
  2. In a datagram network, what happens to a packet's address field as it travels from source to destination?
  3. In a virtual-circuit network, what changes at every hop, and what stays constant?
  4. Why is virtual-circuit switching described as more complex than pure datagram switching, given that both eventually send packetized data?
  5. A packet switch has four components. Which one performs the routing-table lookup?