Basic Switch Operation 閱讀筆記

這篇閱讀筆記主要是閱讀文章過程中的一些摘錄和總結,主要以英文呈現,因爲我覺得強行把英文翻譯爲中文,麻煩且不說,還會丟失一些信息。不過後面考慮到要給小組成員共享,漸漸寫成中文。

Basic Switch Operation, by Joann Zimmerman, Charles E. Spurgeon


  • Ethernet switches perform their linking function by bridging Ethernet frames between Ethernet segments. To do this, they copy Ethernet frames from one switch port to another, based on the Media Access Control (MAC) addresses in the Ethernet frames.
  • Ethernet switches are designed so that their operations are invisible to the devices on the network, which explains why this approach to linking networks is also called transparent bridging. “Transparent” means that when you connect a switch to an Ethernet system, no changes are made in the Ethernet frames that are bridged. The switch will automatically begin working without requiring any configuration on the switch or any changes on the part of the computers connected to the Ethernet network, making the operation of the switch transparent to them.
  • every port on a switch has a unique factory-assigned MAC address.

However, unlike a normal Ethernet device that accepts only frames addressed directed to it, the Ethernet interface located in each port of a switch runs in promiscuous mode. In this mode, the interface is programmed to receive all frames it sees on that port, not just the frames that are being sent to the MAC address of the Ethernet interface on that switch port.

1. How switch works?

1.1 Address learning

  • When switch receives a frame, records the port ID and its corresponding station MAC. This end up a forwarding database.
  • This database(forwarding database) is used by the switch to make a packet forwarding decision in a process called adaptive filtering. Without an address database, the switch would have to send traffic received on any given port out all other ports to ensure that it reached its destination (so call flooding).

1.2 Traffic Filtering

  • Each port in the switch has the ability to hold frames in memory, before transmitting them onto the Ethernet cable connected to the port.
  • A frame will only be sent to its destined port, other ports will not see this frame. This switch logic keeps traffic isolated to only those ethernet cables/segments, prevents flow of unnecessary trafiic on other segments.

1.3 Frame Flooding

  • Switches automatically delete entries in their forwarding database after a period of time – typically 5 mins – if they do not see any frames from a station. This keeps the forwarding database from growing full of stale entries that useless.
  • When recieves a unknown destination address frame, just flood it to all other ports.

1.4 Broadcast and Multicast Traffic

  • Enable broadcast and multicast, so that a frame can be sent to a group of stations.
  • Group address always begin with a specific bit pattern defined in the Ethernet standard.
  • The Ethernet software, also called “interface driver” software, programs the interface to accept frames sent to the group address, so that the interface is now a member of that group. The Ethernet interface address assigned at the factory is called a unicast address, and any given Ethernet interface can receive unicast frames and multicast frames.

1.4.1 Broadcast and multicast forwarding

  • Multicast is more complicated and expensive than broadcast. Stations should tell if they want the multicast frames. And then switches just forward the frames to the indicated ports.
  • Broadcast and Multicast usage: 發現新地址,新開機station動態註冊地址。
  • In large LAN, broadcast and multicast may cause heavy traffic.
    Solution:
    * Limit the total number of stations linked to a single networks;
    * Divide into VLAN

2. Combining Switches

2.1 Forwarding Loops

  • 多個交換機組成的大型Ethernet中,可能出現Loops,and then packets will circulate endlessly around the loop, building up to very high levels of traffic and causing an overload && causing the network to be fully occupied with sending broadcast, multicast, and unknown frames, and it becomes very difficult for stations to send actual traffic.

3. Spanning Tree Protocol

3.1. Spanning tree packets

  • 生成樹協議的操作基於Bridge Protocol Data Units, or BPDUs. Each BPDU packet is sent to a destination multicast address that has been assigned to spanning tree operation.

3.2. Choosing a root bridge

  • 每個交換機都有個system MAC. BridgeID = priority + system MAC. BID最小的,選作STP算法的根節點。

3.3. Choosing the least-cost path

  • 每個BPDU通過線路時,記錄經過的port數量和時間。

3.4. Blocking loop paths

3.5. Spanning tree port states

  • States include: disable, blocking, listening, learning, forwarding. 每個狀態的作用以及狀態之間切換的條件。
  • 在快速生成樹算法(RSTP)中,增加了新state “edge”,意味着該port直接連接的是終端而非switch,從而允許跳過 listening 和 learning ,直接進入 forwarding 。

3.6. Spanning tree versions

  • 802.1D中定義了基本的STP,各廠商都有自己的版本。如 Cisco 的 per-VLAN spanning tree (PVST)
  • The 802.1Q standard includes both RSTP and a new version of spanning tree called Multiple Spanning Tree (MST), which is also designed to provide backward compatibility with previous versions. MST is discussed further in Virtual LANs.

4. Switch Performance Issues

  • 以太網性能取決於網絡的拓撲結構、交換機性能等。
  • 當交換機無法及時處理所有port持續接收到的數據時,即性能不足時,會開始丟棄frame,此之謂blocking

4.1 Packet forwarding performance

  • 輔助電路(support circuits) 和 高速緩存都能提高switch的性能,但是貴,所以性能與價格存在 trade-off 。Some less expensive devices may have lower packet forwarding performance, smaller address filtering tables, and smaller buffer memories.

4.2 Switch port memory

  • 一般是 store-and-forward 機制。memory越大越好。設計時一般 A common switch design includes a pool of high-speed buffer memory that can be dynamically allocated to individual switch ports as needed.

4.3 Switch CPU & RAM

  • 交換機在轉發最小以太網幀(64 bytes)時,達到傳輸速率峯值;And then larger frames will have a lower packet rate per second.
  • Latency: is the amount of time it takes to move an Ethernet frame from the receiving port to the transmitting port, assuming that the transmitting port is available and not busy transmitting some other frame.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章