Today, I learned about the switch.
What is switch?? π€¨
Features:
- Hosts have dedicated direct connection to switch.
- Switches buffer packets.
- Ethernet protocol used on each incoming link, but no collisions; full duplex.
- Each link is its own collision domain.
- Example: 'A-to-A' and 'B-to-B' can transmit simultaneously, without collision.
Here is the question: how does switch know A' reachable via interface 4, B' reachable via interface 5?
Answer is "each switch has a switch table, each entry":
- (MAC address of host, interface to reach host, time stamp)
- It looks like a forwarding table!
Now, we are gonna talk about the self-learning of switch.
Switch learns which hosts can be reached through which interfaces.
- When frame received, swich learns location of sender: it is reachable through the incoming interface.
- Switch records (sender, interface) pair in its table like this.
When a frame arrives at switch:
- Switch compares the frame's Source MAC address to the switch's MAC address table.
- If the source is unknow Switch adds (Source MAC address, incoming port# the frame was received on switch) to the switch MAC address table.
- Switch compares the frame's Destination MAC address to the switch's MAC address table.
- If there is an entry, switch forwards the frame out the associated port (through a unicast message).
- If there is no entry, switch floods (it forwards the frame out all its ports except the port that the frame was received on).
Note: a switch has a switch table and a node has an APR table.
Here is the example of self-learning, forwarding.
Now, we are gonna talk about the interconnecting switches.
- A switch can be connected to other switches
Question: sending from A to G - how does S1 know to forward frame destined to G via S1, S4 and S3?
Answer: self learning! (works exactly the same as in single-switch case!)
This is the table figuring out the interconnecting switches.
Switches vs routers
Both are stored-and-forward:
- Routers: network-layer devices (examine network-layer headers)
- Switches: link-layer devices (examine link-layer headers)
Both have forwarding tables:
- Routers: compute forwarding table using routing algorithms, IP addresses
- Switches: learn forwarding table using self-learning, flooding, MAC addresses
'Computer Science π > Network Programming π°οΈ' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
A day in life network (0) | 2023.04.27 |
---|---|
VLAN (0) | 2023.04.25 |
Ethernet (0) | 2023.04.20 |
LAN address & APR (0) | 2023.04.20 |
IP address vs MAC address (0) | 2023.04.19 |