In Fig.3.8, four PCs each connect to a single switch by a twisted pair cable. The four ports on the switch are numbered 1 through 4. For information about how the cables connect between PC and switch, see Sect.3.1. Assume that the MAC addresses of PCs 1 through 4’s computer network card are MAC1 through MAC4, respectively, and that the MAC address table is currently empty.
78 3 Ethernet
If PC 1 knows the MAC address of PC 3’s network card and sends a unicast frame, frame X, to PC 3, PC 1 is deemed the source host and PC 3 the destination host. The process to transfer frame X from PC 1 to PC 3 is as follows:
1. The application software running on PC 1 generates data, which passes through the application, transport, and network layers of the TCP/IP model for pro- cessing. The network layer generates a packet from the data, and then transmits it to the CU of PC 1’s network card, which in turn encapsulates it into a frame— frame X. The CU specifies its MAC address (MAC1) as the source MAC address of frame X, and MAC3 as the destination MAC address. For now, we can ignore the content of the otherfields in frame X.
2. Frame X is forwarded as follows: CU of PC 1’s network card → OB of PC 1’s network card→ LC of PC 1’s network card → TX of PC 1’s network card→ twisted pair → RX of Port 1’s network card → LD of Port 1’s net- work card→ IB of Port 1’s network card → CU of Port 1’s network card. This process is explained in Sect.3.1.
3. Upon frame X’s arrival at the CU of Port 1’s network card, the switch queries the MAC address table for the frame’s destination MAC address, MAC3. However, the MAC address table is currently empty. The switch, therefore, floods frame X out of all ports except the port on which frame X is received.
MAC address Port No.
Switch
Port 1 Port 2 Port 3 Port 4
PC 1 MAC1 PC 2 MAC2 PC 3 MAC3 PC 4 MAC4
Fig. 3.8 Single switch networking
Because frame X arrived at the switch on Port 1 and frame X’s source MAC address is MAC1, the switch maps MAC1 to Port 1 and stores this mapping in the MAC address table.
4. After frame X is flooded, the CU of Port n’s (n = 2, 3, or 4) network card receives a copy of the frame. The copies are forwarded as follows: CU of Port n’s network card → OB of Port n’s network card → LC of Port n’s network card→ TX of Port n’s network card → twisted pair → RX of PC n’s network card→ LD of PC n’s network card → IB of PC n’s network card → CU of PC n’s network card. This process is explained in Sect.3.1.
5. The CUs of PC 2, 3, and 4’s network cards compare whether their MAC address is the same as the destination MAC address of the received frame X. Both PC 2 and 4 discard frame X because the MAC addresses are not the same.
6. Because the MAC address of PC 3’s network card is the same as the destination MAC address of frame X, the CU of PC 3’s network card extracts the packet from frame X. Based on the value of frame X’s Type field, the CU sends the packet to the relevant processing module on the network layer of the TCP/IP model. After the network, transport, and application layers process the data, it arrives at the intended application software running on PC 3.
The current status of the example network is shown in Fig.3.9. Frame X has been successfully sent from source host PC 1 to destination host PC 3. The traffic generated by frame X on PC 2 and 4’s twisted pairs was of no practical use and was immediately discarded. Such traffic, generated by a switch’s flooding operation, is known as junk traffic.
Based on the network status shown in Fig.3.9, assume that PC 4 knows the MAC address of PC 1’s network card and sends frame Y, a unicast frame, to PC 1. In this scenario, PC 4 is the source host, and PC 1 is the destination host. The process to transfer frame Y from PC 4 to PC 1 is as follows:
1. The application software running on PC 4 generates data, which passes through the application, transport, and network layers of the TCP/IP model for pro- cessing. The network layer generates a packet from the data, and then transmits it to the CU of PC 4’s network card, which in turn encapsulates it into a frame— frame Y. The CU specifies its MAC address (MAC4) as the source MAC address of frame Y, and MAC1 as the destination MAC address. For now, we can ignore the content of the otherfields in frame Y.
2. Frame Y is forwarded as follows: CU of PC 4’s network card → OB of PC 4’s network card→ LC of PC 4’s network card → TX of PC 4’s network card→ twisted pair → RX of Port 4’s network card → LD of Port 4’s net- work card→ IB of Port 4’s network card → CU of Port 4’s network card. 3. Upon frame Y’s arrival at the CU of Port 4’s network card, the switch queries
the MAC address table for the frame’s destination MAC address, MAC1. The result of the query indicates that MAC1 maps to Port 1. Port 1 is not the port on which frame Y arrived, so the switch performs a point-to-point for- warding operation for frame Y and sends it to the CU of Port 1’s network card.
Because frame Y arrived at the switch on Port 4 and frame Y’s source MAC address is MAC4, the switch maps MAC4 to Port 4 and stores this mapping in the MAC address Table
4. The CU of Port 1’s network card forwards the received frame Y as follows: CU of Port 1’s network card → OB of Port 1’s network card → LC of Port 1’s network card→ TX of Port 1’s network card → twisted pair → RX of PC 1’s network card→ LD of PC 1’s network card → IB of PC 1’s network card→ CU of PC 1’s network card.
5. The CU of PC 1’s network card compares whether its MAC address is the same as the destination MAC address of the received frame Y. Because the MAC addresses are the same, the CU extracts the packet from frame Y. Based on the
MAC address Port No.
MAC1 1
Switch
Port 1 Port 2 Port 3 Port 4
PC 1
MAC1PC 2
MAC2PC 3
MAC3PC 4
MAC4 Frame XFrame X: The destination MAC address is MAC3, and the
source MAC address is MAC1.
Frame X Frame X
Frame X Flooding
Frame X Frame X Frame X
Fig. 3.9 Unicast frame sent from PC 1 to PC 3
value of frame Y’s Type field, the CU sends the packet to the relevant pro- cessing module on the network layer of the TCP/IP model. After the network, transport, and application layers process the data, it arrives at the intended application software running on PC 1.
The current status of the example network is shown in Fig.3.10. Frame Y has been successfully sent from source host PC 4 to destination host PC 1, and because the switch performed a point-to-point forwarding operation for frame Y, no junk traffic was generated.
Based on the network status shown in Fig.3.10, assume that PC 1 sends a unicast frame, frame Z. However—due to a bug, for example—the CU of PC 1’s network card specifies MAC1 as frame Z’s destination MAC address and MAC5 as the source MAC address during frame creation. The process to transfer frame Z is as follows:
MAC address Port No.
MAC1 1
MAC4 4
Switch
Port 1 Port 2 Port 3 Port 4
PC 1 MAC1 PC 2 MAC2 PC 3 MAC3 PC 4 MAC4 Frame Y
Frame Y: The destination MAC address is MAC1, and the source MAC address is MAC4.
Frame Y Frame Y
Forwarding
Fig. 3.10 Unicast frame sent from PC 4 to PC 1
1. CU of PC 1’s network card → OB of PC 1’s network card → LC of PC 1’s network card→ TX of PC 1’s network card → twisted pair → RX of Port 1’s network card→ LD of Port 1’s network card → IB of Port 1’s network card→ CU of Port 1’s network card.
2. Upon frame Z’s arrival at the CU of Port 1’s network card, the switch queries the MAC address table for the frame’s destination MAC address, MAC1. The result of the query indicates that MAC1 maps to Port 1. However, because Port 1 is the port on which frame Z arrived, the switch discards the frame. The switch also maps MAC5 to Port 1 and stores this mapping in the MAC address table. The current status of the example network is shown in Fig.3.11.
The preceding examples have shown and described how a switchfloods, for- wards, and discards a unicast frame sent from a PC. Now, let’s look at an example of a broadcast frame sent from a PC. Based on the network status shown in Fig.3.11, assume that PC 3 sends a broadcast frame, frame W. The process to transfer frame W is as follows:
MAC address Port No.
MAC1 1
MAC4 4
MAC5 1
Switch
Port 1 Port 2 Port 3 Port 4
PC 1 MAC1 PC 2 MAC2 PC 3 MAC3 PC 4 MAC4 Frame Z
Frame Z: The destination MAC address is MAC1, and the source MAC address is MAC5.
Frame Z
Discarding
Fig. 3.11 PC 1 sending a unicast frame
1. The application software running on PC 3 needs to simultaneously send data to all other computers. It generates the data, which passes through the application, transport, and network layers of the TCP/IP model for processing. The network layer generates a packet from the data, and then transmits it to the CU of PC 3’s network card, which in turn encapsulate it into a broadcast frame—frame W. The CU specifies its MAC address (MAC3) as the source MAC address of frame W, and the broadcast MAC address as the destination MAC address. For now, we can ignore the content of the otherfields in frame W.
2. Frame W is forwarded as follows: CU of PC 3’s network card → OB of PC 3’s network card→ LC of PC 3’s network card → TX of PC 3’s network card→ twisted pair → RX of Port 3’s network card → LD of Port 3’s net- work card→ IB of Port 3’s network card → CU of Port 3’s network card. 3. Upon frame W’s arrival at the CU of Port 3’s network card, the switch floods the
frame to all ports other than the port on which the frame is received, without querying the MAC address table. Because frame W arrived at the switch on Port 3 and frame W’s source MAC address is MAC3, the switch maps MAC3 to Port 3 and stores this mapping in the MAC address table.
4. After frame W isflooded to all ports, the CU of Port n’s (n = 1, 2, 4) network card receives a copy of the frame. The copies are forwarded as follows: CU of Port n’s network card → OB of Port n’s network card → LC of Port n’s net- work card→ TX of Port n’s network card → twisted pair → RX of PC n’s network card→ LD of PC n’s network card → IB of PC n’s network card→ CU of PC n’s network card.
5. Because frame W is a broadcast frame, the CU of PC n’s network card extracts the packet from frame W. Based on the value of frame W’s Type field, the CU sends the packet to the relevant processing module on the network layer of the TCP/IP model. After the network, transport, and application layers process the data, it arrives at the intended application software running on PC n.
The current status of the example network is shown in Fig.3.12. The application software running on PCs 1, 2, and 4 have successfully received the same data broadcast from PC 3’s application software.
As multicast frames go beyond the scope of this book, no examples are provided of forwarding multicast frames.
In concluding this section, we must emphasize the following points:
1. Upon receipt of a unicast frame, a computer network card compares its own MAC address with the destination MAC address of the frame. If the MAC addresses are the same, the network card sends the payload data to the relevant processing module on the network layer, depending on the value of the unicast frame’s Type field. Otherwise, the network card discards the unicast frame. 2. Upon receipt of a broadcast frame, a computer network card directly sends the
payload data to the relevant processing module on the network layer, depending on the value of the broadcast frame’s Type field.
3. Upon receipt of a unicast frame, a switch network card directly queries the MAC address table and then implements one of the three forwarding operations on the unicast frame.
4. Upon receipt of a broadcast frame, a switch network cardfloods the frame out of all ports other than the port on which the frame was received.