Search this blog

Monday, January 4, 2010

Day 24: Switch Operation

As a reminder each switch port is its own collision domain. A switch maintains a MAC table, when it doesn't know the port for a frame's destination MAC address it will then flood the frame out all other ports. It will not forward frames with errors or with the same source and destination. When we connect a hub to a switch port, the switch will associate all MAC addresses of devices connected to that hub with that port.

A switch port can operate in full-duplex mode which allows is to alternately send and receive data simultaneously. They can also work in half-duplex mode allowing it to alternately send and receive data but not simultaneously.

Switches attempt to autonegotiate the speed and either full- or half-duplex transmission when devices connect. If the device doesn't support autonegotiation, the switch will default to the speed of the other device and half-duplex. We can turn autonegotiation off and manually set a switch to full or half duplex and speed of the connection.

Switches can operate in store and forward mode which means that the entire frame is received before sending plus computes the CRC (introduces latency). It can also use cut-through mode in which switches look at the first part of the frame (destination address) and immediately beings forwarding the frame out the approprate port. We also have modified cut-through, known as fragment-free switching. This means checking the first 64 bytes before forwarding the frame. Ethernet specs state that collisions should be detected during the first 64 bytes of the frame, late collissions are still possible.
Switches use Spanning Tree Protocol (STP) to avoid switching loops and set ports as blocking, listening, learning or forwarding. This is needed when you have redundant links between switches, which is normal in modern network design.

To summarize we can use Layer 2 switches for address learning, packet forwarding and filtering, loop avoidance with the Spanning Tree Protocol.

No comments:

Post a Comment