In this section, we will see about basic switching. The LAN switching technology is L2 (data-link layer) of the OSI model.
The "switching means forwarding frames. In the data communication, all switching devices (namely the switches) implement two basic tasks:
- Frame forwarding: forward the frames received from the input media to the corresponding output media.
- Address learning process: construct and maintain the switching address table to maintain the switch operation. The following describes the details of the two basic operations.
Frame Forwarding
The switch forwards frames according to the MAC address. When the switch forwards frames, the switch works based on following rules:
- If the destination MAC address of the frame is broadcasting address or multicasting address, the frame is forwarded to all ports of the switch (except the source port of the frame).
- If the destination address of the frame is a unicast address, but the address is not in the address table of the switch, the frame is forwarded to all ports (except the source port of the frame).
- If the destination address of the frame is in the address table of the switch, forward the frame to the corresponding port according to the address table.
- If the destination address and the source address of the frame are in the same network segment, the frame is discarded and switching is not performed.
Address Learning Process
Below flow chart illustrates the forwarding and learning of the received frames.
When a frame reaches from a specific port, the switch gets the conclusion according to the two items: from port X, the workstation specified by the frame source address domain can be reached.
Therefore, the switch can update the forwarding database for the MAC address. To allow the change of the network topology, each item of the database is configured with a life timer.
When a new item is added to the database, the timer is started. The default value of the timer is 30 seconds. If the scheduled time is up, the item searches the database to check whether any item with the same address field value and frame address exists.
If such item exists in the database, the content of the item is updated. Reset the timer. If such item does not exist in the database, add a new item in the database.
The address in the new item is the MAC address of the received frame.The port number is the port of the received frame, the timer value is set to the original value.
This was the basic information about working flow of switch. In coming posts we will see about VLAN Technology.