Dulranga's Notes
Semester 3Data Communication and Networking

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.
Trap

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 nn nodes needs this many links (clarification):

links=n(n−1)2\text{links} = \frac{n(n-1)}{2}
Nodes nnLinks
33
46
510
1045

The slide shows the first three rows and asks for n=10n=10.

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):

Ttotal=Tconnect+Ttransfer+TdisconnectT_{total} = T_{connect} + T_{transfer} + T_{disconnect}

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 (1,2)(1,2), (2,4)(2,4), (3,1)(3,1), (4,3)(4,3). 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 NN input lines, and the output runs NN times as fast as an input.
  • Demultiplexer: distributes sessions. There is one input line and NN outputs that run NN times slower.
  • Multiplexers can be cascaded.
  • TSI (Time Slot Interchange): write to shared memory, then read in a different order.

Slide example: sessions (1,3)(1,3), (2,1)(2,1), (3,4)(3,4), (4,2)(4,2).

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 3

The sequence 3,1,4,23,1,4,2 on the slide is each input's destination. Input 11 goes to 33, input 22 to 11, input 33 to 44 and input 44 to 22 (clarification).

Pros and cons

ProsCons
Low transmission delay once the circuit is set upThe route, once set up, can't be optimised
Suits human-to-human telephone communicationLess 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.
ProsCons
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 portIn VCIOut portOut VCI
114322
177241

A packet in on port 11 with VCI 1414 goes out on port 33 with VCI 2222. The label is rewritten at each hop (clarification). The slide's other tables are garbled in the extracted text, so check the original figure.

ProsCons
Packets are sent along a pre-chosen routeSet-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 addressOutput port
12321
41502
91303
ProsCons
No initial circuit set-up costs or delaysSwitching each packet is relatively expensive
Adapts to node and link failures during transmissionDatagrams 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 55, then 99, then 22 along the path.
IP --> [LER] --L=5--> [LSR] --L=9--> [LSR] --L=2--> [LER] --> IP
       assign label    swap 5>9       swap 9>2      remove label

The 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.

On this page