2 Ethernet Switches

Crossover vs. Straight-through Cable

On a NIC - Network Interface Card OR Wireless Adapter theres's a TX and RX pin on both sides:

How do we know which one to use?

The idea is:

So switch and switch would use crossover. If it's switch to router, then it's straight-through.

The Plan for Today

We'll be looking at ethernet switches. It's a layer 2 device (creates frame). It looks like:

Ethernet used to be Broadcast Connection, so then:

  1. There was lots of throttling for access to the hub
  2. Unsecure viewing of all traffice
    Instead, a switch will learn about this network. If PC1 and PC2 talk a lot ot each other, then it directs traffic only between these PCs, and creates a direct connection.

The way it does this is address learning:

address learning

This is done on the ethernet switches. It is passive (done passively) and generates the MAC address table, with columns "Destination MAC | Physical Interface".

Let's look at how the MAC address table is generated. Say PC1 has MAC1 and talking to PC2 with MAC2. Say it does a ping to IP2 (PC2's IP). At some point it'll create a frame with the destination, source, and type. Here:

  1. Learn the source address (MAC1 in this case is with physical interface 1 in our picture)
  2. Try to find the destintation MAC address.
    1. If it's not in the table, then broadcast the frame to all other interfaces (it'll hope for the best).
    2. The other PCs will effectively throw it away.
  3. PC2 sees this and make a frame response:
    1. Source: MAC2
    2. Dest: MAC1
    3. ... (all other stuff is the same)
  4. MAC2 is thus added to the table.
  5. Now MAC1 can be found in the MAC table to the interface, and then is sent directly over that interface.

Doing this is not a security feature (they would always break), but it works.

Consider the following network toplogy:

The loops in here create a broadcast storm (due to the loops, so it keeps getting sent over and over and never dies) which takes down the whole network. With switches instead:

you'll also get the same problem. Ethernet in general doesn't do well with loops, but we like loops for redundancy. That's where the spanning tree comes into play.

Here it's an active algorithm. It essentially take out loops and reconfigures when the traffic requires it to take a faster path. The steps are:

  1. Pick a root node
  2. Determine shortest path based on time from each switch back to the root node.
  3. Administratively, take down any link that is not on that shortest path.
Note

This why there's a difference between physical and logical Network Topologies. While they may be wired up physically in these loops, we only want to turn some of these on over time.