Chapter 3: Switching

The main topic here is how LAN switching works; first, in 3.1, a very generic approach to switching (much of which also applies to IP routing), and then in 3.2 a specific application of switching to Ethernet (also called bridging). These two sections are the main part of the chapter.

This chapter also includes Section 3.3 on ATM ("asynchronous transfer mode"), which is an important and very different approach to LANs and switching.

We'll omit section 3.4 on switching hardware.

Section 3.1

The main issue for switches, which just connect different physical LANs, is to figure out which way packets get forwarded; that is, to look at the address and decide to where that switch will send the packet. Each switch makes a decision only for the next hop of the route, but, with a little coordination, the packets get routed along the correct global path.

There are two main approaches to switching: datagram switching and virtual circuits. There is also a third technique, source routing, that is seldom used in practice. The Internet is built using datagram switching, as are switched Ethernets. ATM is a technique based on virtual circuits; the idea was to support the requirements for both data and voice. The essential idea behind datagram switching is that the switches do not maintain any state information about endpoint-to-endpoint connections; they keep a huge table of every destination and look up the next hop to that destination for every packet. This means they spend a lot of time on lookup, and the per-packet overhead is very high, but there is zero setup overhead for sending a packet. Virtual circuit mechanisms, on the other hand, require that a "virtual circuit" be set up for every connection, which is a lot of setup overhead. The tradeoff is that then the tables used to forward each individual packet can be kept very small and compact (because they contain entries only for the active connections, not for every destination in the world), and per-packet overhead is negligible.

Study questions:

Why would datagram switching work better with relatively large packets? (Think about where the overhead is.) Why would virtual circuits be a better choice if packets were small?

Exercises:

1    Give VC tables, given the connections
2    Give datagram tables
3    datagram tables with a "default" entry
4    From VC tables, figure out the connections

Section 3.2 - Ethernet bridging/switching

Just read 3.2.1, on how Ethernet bridges work. ("Bridge" is an older term for "switch".) The basic idea is datagram routing, and every switch maintains a table of all the known Ethernet hosts in the LAN (an Ethernet switch generally has enough memory for at least 10,000 entries). The twist here is how bridges build these tables: by entering the source of each packet they see. Initially the tables are empty. This strategy depends on a crucial feature: if an Ethernet bridge doesn't know how to deliver a packet, it has a fallback delivery strategy of broadcasting it on all links. That strategy is not available on the Internet at large, and so we'll see in chapter 4 that IP routing -- which also uses datagram routing -- has to use a much more upfront algorithm for building the routing tables.

Nowadays, it is routine for bridges to join Ethernet to Token Ring.

Study Questions

What are the limitations on how big a switched Ethernet can grow? Why can't the entire Internet be one big switched Ethernet?

Exercises

13    Learning bridge example

Section 3.3 - ATM

Actually you are just to read 3.3.1 on the general strategy of cells. Cells are tiny packets, relative to the IP/Ethernet world. In the latter, packet sizes start at 512 bytes and go up to 1500 bytes, or more; in ATM, cells (packets) are 53 bytes (48 bytes of data following 5 bytes of header). The IP world, in general, believes in large packets. Cells are an important example of the merits of small packets. Most (but not all) IP people have been relatively uninterested in ATM.

ATM is usually installed today as a LAN alternative, but its original proponents really had in mind using it to replace IP entirely; the Internet would become a global ATM network and ATM's routing and congestion algorithms would rule the world. At the present time, this seems unlikely to come to pass.

Study questions

People have said that "ATM" stands for "A Tariffing Mechanism" and "A Technological Mistake". Explain these. Can you propose another?
Why are cells good for voice traffic?

Exercises

28    Why does cell switching always use virtual circuits?