l2 switching overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 e-mail :...
TRANSCRIPT
L2 Switching Overview
2009 年 12 月
主讲:孟宁电话: 0512-68839302E-mail : [email protected]主页: http://staff.ustc.edu.cn/~mengning地址:苏州工业园区独墅湖高等教育区仁爱路 166 号明德楼 A302室
Content
♦ OSI Protocol Stack♦ Network Device♦ Packet Flow♦ Physical Layer♦ Auto Negotiation♦ MII Registers♦ Frame Format♦ Bridging♦ Question♦ Reference
OSI Protocol StackApplication (Message/Stream)Providing user-application services and procedures
PresentationArranging data in a mutually agreed format such as data encryption and data compressionSessionControlling process communication responsible for buffering, and synchronization
Network (Packet)Supporting routing services for transferring user packet data and network management data
Transport (Segment/Datagram)Proposing end to end control about partitioning and reassembling messages
Data Link (Frame)Organizing frame format; provides flow initialization, flow control, flow termination and error controlPhysical (Bits)Transferring data bits across link; defines physical characteristics of media
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1
Network Device(1)
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1
Hub/Repeater
OSI1
Network Device(2)
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1
Bridge/Switch
OSI1
OSI2
Network Device(3)
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1
OSI7
OSI6
OSI5
OSI4
OSI3
OSI2
OSI1OSI1
Router/Router Switch
OSI3
OSI2
OSI4
Packet Flow
Coaxial Cable Twisted Pair Optical Fiber
Ethernet FDDI Token Ring Token Bus
IP ARP RARPICMP
Telnet FTP POP I MAP SMTP HTTP SNMP
TCP UDP
( Session Control )
( Presentation Format )
Email: POP, IMAPSMTPHTTP: WWWFTP: File Transfer ProtocolTelnet: Remote LoginSNMP: Network ManagementARP: Address Resolution for MAC Address based on IP AddressRARP: Address Resolution for IP Address based on MAC Address
Physical Layer -Twisted Pair(1)
♦ Crossover– Data Circuit Equipment (DCE) – Data Terminating Equipment (DTE) – MDI-II/MDI-X
PC
Hub
Switch
Router
PC Hub Switch Router
Physical Layer -Twisted Pair(2)
♦ Cable type
Category Description Transfer Rate
CAT 1
CAT 2
CAT 3
CAT 4
CAT 5
Voice and Data
Voice
4 Mbps
10 Mbps
16 Mbps
100 Mbps
Ethernet
Token Ring
Fast Ethernet
CAT 5e Gigabit Ethernet 1 Gbps
< 4 Mbps
CAT 6 Gigabit Ethernet 1 Gbps
Physical Layer - Layout
LLC
MAC
Signal/Pin
PHY (Physical Layer Interface )
IEEE802.3ab
TX_CLK
RX_CLK
TX_EN
TXD<3:0>
TX_ER
RX_DV
RXD<3:0>
RX_ER
CRS
COL
MDC
MDIO
MII/GMII 即媒体独立接口
Auto Negotiation
♦ AN is an optional standard function defined in the 1998 IEEE 802.3 specification.
♦ Its purpose is to enable device interface to achieve their highest possible mode of operation over a line segment.
♦ It does this by providing a means for the interfaces to exchange information about their capability (such as speed and duplex) over a link.
♦ PHY transceiver uses MII to store information about its capability.
MII Registers
♦ 32 PHY registers♦ 16-bit value of each register♦ Register table
Frame Format(1)
Preamble Delimiter DA SA Type Upper Layer Protocol ( ULP ) CRC
Maximum Frame size 1518 bytesMinimum Frame size 64 bytes
Ethernet HeaderEthernet Payload
Ethernet Trailer
DA: Destination AddressSA: Source AddressType: EtherTypeCRC: Cyclic Redundancy Check
Preamble Delimiter DA SA Type Upper Layer Protocol ( ULP )
7 bytes 1 byte 6 bytes 6bytes 2bytes < 1500 bytes 4 bytes
CRC
Maximum Frame size 1518 bytesMinimum Frame size 64 bytes
Ethernet HeaderEthernet Payload
Ethernet Trailer
DA: Destination AddressSA: Source AddressType: EtherTypeCRC: Cyclic Redundancy Check
Frame Format(2)
Preamble: 1010 1010 . . . 1010 1010
7 bytes
Purpose: achieve receiver synchronization with sender
Delimiter: 1010 1011
1 byte
Purpose: denote frame starting point
Frame Format(3)
DA: MAC Address SA: MAC Address( MAC: Media Access Control )
A
B
C
mac_a
mac_b
mac_c
mac_c mac_a
DA SA
mac_a mac_c
Frame Format(4)
6 bytes
Vendor ID( e.g. Cisco 00:00:0c ) Serial No
Note: 1. MAC address saved in NIC for PC should not be modified by user. It is created by NIC vendor. 2. For network device such as bridge or router, it is saved in NVRAM. There exist a distinct MAC address for each bridge ( or router ) port.
Frame Format(5)
Ethernet
ICMPIP ARP RARP
EtherType = 0800 for IPEtherType = 0806 for ARPEtherType = 8035 for RARP
OSI 3
OSI 2
Bridging
♦ Filtering Database
♦ Forwarding Algorithm
♦ Learning Algorithm
♦ Operation Process
Filtering Database
MAC Address Corresponding Port
E
Age
(DA or SA )
2
1
B
MAC Address Corresponding Port Age
(DA or SA )
2
1
3
DC
A 3 100B 1 65C 2 44D 3 96E 1 29
A 2 53B 2 40C 2 9D 2 100E 1 65
A
Forwarding Algorithm
End
Start
Receive frame from incoming port X
DA in Filtering Database
Broadcast incoming frameto all ports except for X
Filtering incoming frame
Forward incoming frame toCorresponding Port
X equal toCorresponding Port
yes
no
yes
no
Learning Algorithm
SA in Filtering Database
Reset Age to Default Age
Write SA 、 X and Default Age into Filtering Database
End
Start
yes
no
Operation Process(1)
MAC port MAC port MAC port
DA SA
Ethernet Header
Ethernet Frame
EC
I II III
A
B D
1 2
1 3 2 1
2
Operation Process(2)
EC
I II III
A
B D
1 2
1 3 2 1
2
MAC port MAC port MAC port
B -> D
D B D B
D BD BD B
B 2 B 1 B 2
C -> A
A C
A C A C
A CA C
C 2 C 1 C 1
E -> A
A E
A E
E 3 E 2
A E
A E
A E
E 2
常见二层协议♦ VLAN 虚拟局域网♦ STP 生成树协议 - RSTP MSTP
♦ LA 链路聚合,也称为 trunking
♦ IGMP Snooping 多播组的二层支持♦ PNAC 基于端口的认证 802.1X
♦ ......
谢谢大家!