Hoạt động như một điểm tập trung kết nối của các máy trạm, server, router, Hub và các switch khác... Học địa chỉ Address learning Chuyển tiếp và lọc các Frame Forward/filter decisi
Trang 1Nội dung
Giới thiệu về Switch
Các chế độ truyền frame qua switch
Trang 2Giới thiệu Switch
Switch là một loại máy tính
đặc biệt, nó cũng có các thành
phần cơ bản giống như máy tính
đó là: CPU, Ram, NVRAM,
Flash, Rom và HĐH Switch có
các Port dùng để quản lý (cosole
port).
Hoạt động như một điểm tập trung kết nối của các máy
trạm, server, router, Hub và các switch khác
Trang 3• Configurations can come
from many sources
• Configurations will act in
Virtual terminal Telnet
TFTP
External Configuration Sources
Trang 4Kết nối vào cổng quản lý trên Switch
Trang 5Kết nối vào cổng quản lý trên Switch
Trang 6Kết nối vào cổng quản lý trên Switch
Trang 7Đèn báo hiệu trên Switch
System LED Green - System powered and operational
Amber - System malfunction
Redundant power
supply (RPS) Green Amber - RPS operational - RPS installed, not operational
Flashing amber - Indicates that the internal power supply and RPS are powered up, and the internal power supply is powering the switch.
Trang 8Port LED display
Port Status (STAT
LED on) Green - Link present, flashing green – activity, Alternating green and amber - Link fault
Amber - Port not forwarding Bandwidth utilization
(UTL LED on) 1 to 8 LEDs on-0.1 to <6 Mbps 9 to 16 LEDs on-6 to <120 Mbps
17 to 24 LEDs on-120 to 280 Mbps
Note: The values shown are for a 24-port switch For a 12-port switch, the values are: 1 to 4 = 0.1 to <1.5; 5 to
8 = 1.5 to < 20; 9 to 12 = 20 to 120 Mbps.
Full duplex (FDUP
LED on) Green - Ports are configured in full-duplex mode Off - Ports are half-duplex
Đèn báo hiệu trên Switch
Trang 9 Học địa chỉ (Address learning)
Chuyển tiếp và lọc các Frame (Forward/filter decision)
Tránh lặp vòng (Loop avoidance)
Các chức năng của switch
Trang 10Switch xác định vị trí của các Host như thế nào
(How Switches Learn Hosts Locations)
MAC address table
Trang 11How Switches Learn Hosts Locations
• máy A gửi một frame tới máy C
• Switch xác định được máy A kết nối vào port E0 dựa trên địa MAC nguồn trong
Frame nhận được.
• Frame từ máy A tới máy C được gửi ra các cổng trừ cổng E0 (The frame from station
A to station C is flooded out to all ports except port E0)
• Máy C nhận được Frame và gửi trả lời tới máy A (báo đã nhận Frame) Switch đọc địa chỉ MAC trên Fame do máy C gửi và xác định được Máy C nối vào port E2
MAC address table
E2: 0260.8c01.2222
Trang 12How Switches Learn Host Locations
• Máy D g i frame t i máy C ử ớ
• Switch xác nh máy D n i v i E3 đị ố ớ
• Frame đượ c chuy n th ng ra c ng E2 t i máy C ể ẳ ổ ớ
MAC address table
Trang 13How Switches Filter Frames
Máy A gửi frame máy C
Đích đã biết, Frame được chuyển ra E2 tới Máy C (không gửi ra các cổng)
E0: 0260.8c01.1111
E2: 0260.8c01.2222
E1: 0260.8c01.3333 E3: 0260.8c01.4444 0260.8c01.1111
Trang 14Frames Broadcast and Multicast
• máy D gửi một frame broadcast or multicast
• Frame Broadcast and multicast được chuyển ra tất cả các port thay vì gởi ra một cổng xác định
Trang 15Cấu trúc chuyển mạch dự phòng
Tránh mô hình chỉ có một điểm trung tâm của sự cố
Có thể gây ra bão quảng bá, Frame được chuyển nhiều lần
và bảng địa chỉ không ổn định.
Segment 1
Segment 2
Trang 19Multiple Frame Copies
Segment 1
Segment 2
Server/host X Unicast Router Y
• Host X g i m t unicast frame t i router Y ử ộ ớ
• C hai switch không bi t ả ế Đị a ch MAC c a router Y ỉ ủ
Trang 20Multiple Frame Copies
Host X gửi một unicast frame tới router Y
Cả hai switch không biết Địa chỉ MAC của router Y
Router Y sẽ nhận được 2 bản copy của cùng một
Frame
Unicast
Unicast
Trang 21Dữ liệu trong bảng địa chỉ không ổn định
• Host X g i m t unicast frame t i Router Y ử ộ ớ
• Cả hai switch không biết Địa chỉ MAC của router Y
• Switch A và B nh n ậ đượ c Frame này và h c ọ đượ đị c a
ch MAC c a Host X n m trên port 0 ỉ ủ ằ
Port 0
Port 1
Port 0
Port 1
Trang 22• Cả Switch A và B chuyển frame ra tất cả các port (vì chưa xác định được địa chỉ
MAC của router Y)
• Switch A lại nhận được gói dữ liệu này từ Switch B trên port 1 và ngược lại Switch
B lại nhận được gói dữ liệu từ Switch A trên port 1
• Khi đó cả Switch A và B lại học được địa chỉ MAC của Host X nằm trên port 1
Trang 23 Topo mạng phức tạp với các đường kết nối dự phòng
Trang 24Giao thức Spanning-Tree (Phân nhánh cây)
Trang 25Ho t ạ độ ng c a Spanning-Tree ủ
• M t root bridge trên m t network ộ ộ
• Một root port trên m t non-root bridge ộ
• Một designated port trên m t segment ộ
x
Designated port (F) Root port (F)
Designated port (F) Nondesignated port (B)
100baseT
10baseT
Trang 26Switch Y Default priority 32768 (8000 hex)
BPDU = Bridge protocol data unit
(default = sent every 2 seconds) Root bridge = Bridge with the lowest bridge ID
Bridge ID = Bridge priority + bridge MAC address
In the example, which switch has the lowest bridge ID?
Trang 27Switch Y Default priority 32768 MAC 0c0022222222
10baseT
Designated port (F) Root port (F)
Nondesignated port (B) Designated port (F)
Trang 28Switch Y MAC 0c0022222222 Default priority 32768
Can you figure out:
• What is the root bridge?
• What are the designated, nondesignated, and root ports?
• Which are the forwarding and blocking ports?
100baseT
100baseT Spanning-Tree:
Trang 29Switch Y MAC 0c0022222222 Default priority 32768
Can you figure out:
• What is the root bridge?
• What are the designated, nondesignated, and root ports?
• Which are the forwarding and blocking ports?
Root port (F)
Trang 30Blocking Listening Learning Forwarding
Spanning-Tree Port States
Spanning-tree transitions each port through several different state:
Trang 31Thay đổ i Bridge ID
Bridge ID = Bridge priority + bridge MAC address
Để can thiệp vào quá trình bầu root bridge bạn có thể thực hiện bằng cách thay đổi priority
Switch(config)# Spanning-tree vlan 1 properity?
<0-61440> bridge priority increments of 4096
Switch(config)# Spanning-tree vlan 1 properity 4096
Switch(config)#sh Spanning-tree
Trang 32 Primarily software based
Usually up to 16 ports per bridge
Bridging
Primarily hardware based
More ports on a switch
LAN Switching
Bridging Compared to LAN Switching
Trang 33Truyền Frames qua Switch
Cut-through
Switch checks destination
address and immediately begins
forwarding frame
Frame
Trang 34 Store and forward
Complete frame is received and checked before forwarding
Cut-through
Switch checks destination
address and immediately begins
forwarding frame
Frame
Frame Frame
Trang 35 Cut-through
Kiểm tra địa chỉ đích của frame
và chuyển frame đi ngay không
cần chờ nhận hết frame
Frame
Fragment free
(modified cut-through)—Cat1900 Default
Nhận vào đủ 64 byte đầu tiên của frame rồi bứt
đầu chuyển frame đi.
Frame
Store and forward
Nhận toàn bộ Frame, kiểm tra lỗi sau đó mới chuyển fame đi.
Trang 36Half duplex (CSMA/CD)
• Unidirectional data flow
• Higher potential for collison
Trang 37Truy n song công và bán song công ề
Half duplex (CSMA/CD)
• Unidirectional data flow
• Higher potential for collison
• Attached to dedicated switched port
• Requires full-duplex support on both ends
• Collision free
• Collision detect circuit disabled
Trang 38Với catalyst 1900 đặt password cho chế độ user mode và enable mode như sau:
Switch1900(config)# enable password level 1 abcde
Switch1900(config)# enable password level 15 abcde
Trang 39Console Password (user mode)
Switch2950(config)# line console 0
Switch2950(config-line)# login
Switch2950(config-line)# password cisco
Virtual Terminal Password (user mode)
Switch2950(config)# line vty 0 4
Trang 40Secret Password
Switch(config)# enable secret cisco1
Mặc định: Chỉ có secret Password là được mã hóa
Cấu hình Switch
Đặt Secret Password Cho cả catalyst 1900 và 2950 như sau:
Enable Password cho catalyst 2950
Switch2950(config)# enable password cisco
Trang 41S2950(config-if)#ip default-gateway 172.16.10.1
Trang 43Cấu hình port bảo vệ
Switch(config-if)switchport port-security mac-address mac-address
Switch(config)int fa0/5
Switch(config-if)
Switch(config-if)switchport port-security mac-address 1111.a101.2222
switch(config)#interface e0/1
switch(config-if)#port secure max-mac-count 4
(số địa chỉ mac tối đa là ở đây đặt là 4)
switch(config-if)#exit
switch(config)#address-violation ignore
switch(config)#exit
switch #show mac-address-table security
Hạn chế số địa chỉ mac trên một cổng (1900)
Cố định địa chỉ mac duy nhất cho một port
Trang 44SwitchA(config) int fa0/4
SwitchA(config-if)#switchport mode access
SwitchA(config-if)#switchport port-security
SwitchA(config-if)#switchport port-security maximum 1
SwitchA(config-if)#switchport port-security mac-address sticky SwitchA(config-if)#switchport port-security violetion shutdown
Cấu hình port bảo vệ
Hạn chế số địa chỉ mac trên một cổng (2950)
Trang 45Xóa thông tin cấu hình Switch