Switching
Switching vs routing
- Routing identifies the route that data traverses from source to destination.
- Switching transfers data from one network or link to another.
Routing finds the path, and switching moves the data along it.
Why switching?
- Switching is needed to get signals to the correct destination when the source and destination are not directly connected. It is used when the network is large in size or number of stations. The slide's analogy is travelling by bus.
- Unswitched networks: point-to-point, multi-point or broadcast.
- Switched networks: data passes through one or more intermediate nodes between sender and receiver.
- Unswitched networks with many nodes are unfeasible. It is not cost-effective to connect every node directly to every other. Nodes may be spread out and vast in number, so the signal can't just be broadcast.
A full mesh of nodes needs this many links (clarification):
| Nodes | Links |
|---|---|
| 3 | 3 |
| 4 | 6 |
| 5 | 10 |
| 10 | 45 |
The slide shows the first three rows and asks for .
Switch types
- Circuit switching
- Space-division
- Time-division
- Message switching
- Packet switching
- Virtual circuit
- Datagram
- Label switching
- Cell switching
1. Circuit switching
- A dedicated communications path is pre-allocated.
- The caller, the callee and all intervening links and nodes must be available at the same time.
- Once established, the circuit capacity must be paid for, whether or not it is used.
Phases (the slide's figure): Connect, then Data transfer, then Disconnect. The total delay is the sum of the three (clarification):
Space-division switching
- Each call takes a different path through the switch.
- Each sample takes a different path depending on its destination.
- Crossbar is the simple space-division switch. Its crosspoints can be turned on or off.
- Slide example: sessions , , , . Each session is one input-to-output pair, so each turns on one crosspoint.
Time-division switching
- Each call is divided into small pieces, and each piece is assigned a time slot.
- The contents of each time slot are switched independently.
- Multiplexer: aggregates sessions. There are input lines, and the output runs times as fast as an input.
- Demultiplexer: distributes sessions. There is one input line and outputs that run times slower.
- Multiplexers can be cascaded.
- TSI (Time Slot Interchange): write to shared memory, then read in a different order.
Slide example: sessions , , , .
Inputs written in order : 1 2 3 4
Memory read in order : 2 4 1 3
Output slot 1 = input 2, slot 2 = input 4, slot 3 = input 1, slot 4 = input 3The sequence on the slide is each input's destination. Input goes to , input to , input to and input to (clarification).
Pros and cons
| Pros | Cons |
|---|---|
| Low transmission delay once the circuit is set up | The route, once set up, can't be optimised |
| Suits human-to-human telephone communication | Less suitable for computer communication: set-up time, and it can't handle data bursts |
| Efficiency: the circuit may be idle much of the time, especially in computer communication | |
| Delay: time needed to set up the circuit |
2. Message switching
- Entire messages are sent store-and-forward, hop by hop. A node stores the whole message, then forwards it (clarification).
- The message makes intermittent progress as each hop becomes available.
| Pros | Cons |
|---|---|
| End-to-end delivery time can't be guaranteed | |
| Very long messages can hog buffer space at intermediate nodes | |
| Very long messages can hog the links between nodes |
3. Packet switching
- The network is a set of nodes (switches or routers), which are intermediate stations.
- Links are point-to-point or broadcast.
- The data stream is divided into packets. Each packet comprises a header and data.
- Data is sent from one host (end station) to another. Each intermediate station switches each incoming packet through a link to another node.
- Packets make their way through the network from node to node, and finally to the destination.
Data stream
| divide, add header
v
Packet 1: [Header | Data]
Packet 2: [Header | Data]
Packet 3: [Header | Data]3a. Virtual circuit switching
- A connection is set up between the end stations before data is transferred.
- Packets are sent along a pre-chosen route.
- There is a set-up delay before sending data.
- Each packet is assigned to a virtual circuit. Each VC has a VCI (Virtual Circuit Identifier), and the VCI is different on each link.
- Each switch has a table from incoming (port, VCI) to outgoing (port, VCI):
| In port | In VCI | Out port | Out VCI |
|---|---|---|---|
| 1 | 14 | 3 | 22 |
| 1 | 77 | 2 | 41 |
A packet in on port with VCI goes out on port with VCI . The label is rewritten at each hop (clarification). The slide's other tables are garbled in the extracted text, so check the original figure.
| Pros | Cons |
|---|---|
| Packets are sent along a pre-chosen route | Set-up delay before sending data |
3b. Datagram switching
- Packets are routed independently.
- A switch uses a routing table based on the destination address.
- The destination address in the header stays the same during the packet's whole journey.
| Destination address | Output port |
|---|---|
| 1232 | 1 |
| 4150 | 2 |
| 9130 | 3 |
| Pros | Cons |
|---|---|
| No initial circuit set-up costs or delays | Switching each packet is relatively expensive |
| Adapts to node and link failures during transmission | Datagrams may arrive out of order |
3c. Label switching
- Motto: "Route at edges, switch in core."
- A label is attached to each packet when it arrives at a label-switched network.
- Each core switch switches the packet based on the label, then substitutes a new label for the next hop (label swapping).
- The label is removed at the far edge. The slide's figure shows a label sequence of , then , then along the path.
IP --> [LER] --L=5--> [LSR] --L=9--> [LSR] --L=2--> [LER] --> IP
assign label swap 5>9 swap 9>2 remove labelThe slide's abbreviations are LER, LSR and LSP: Label Edge Router, Label Switching Router and Label Switched Path (clarification). The slide's per-switch tables are garbled in the extracted text.