250 likes | 406 Views
L2 Switching Overview. 主讲:孟宁 电话:0512-68839302 E-mail:mengning@ustc.edu.cn 主页:http://staff.ustc.edu.cn/~mengning 地址:苏州工业园区独墅湖高等教育区仁爱路166号明德楼A302室. 2010年11月. Content. OSI Protocol Stack Network Device Packet Flow Physical Layer Auto Negotiation MII Registers Frame Format Bridging
E N D
L2 Switching Overview 主讲:孟宁 电话:0512-68839302 E-mail:mengning@ustc.edu.cn 主页:http://staff.ustc.edu.cn/~mengning 地址:苏州工业园区独墅湖高等教育区仁爱路166号明德楼A302室 2010年11月
Content • OSI Protocol Stack • Network Device • Packet Flow • Physical Layer • Auto Negotiation • MII Registers • Frame Format • Bridging • Question • Reference
OSI Protocol Stack Application (Message/Stream) Providing user-application services and procedures OSI7 Presentation Arranging data in a mutually agreed format such as data encryption and data compression OSI6 Session Controlling process communication responsible for buffering, and synchronization OSI5 Transport (Segment/Datagram) Proposing end to end control about partitioning and reassembling messages OSI4 Network (Packet) Supporting routing services for transferring user packet data and network management data OSI3 Data Link (Frame) Organizing frame format; provides flow initialization, flow control, flow termination and error control OSI2 Physical (Bits) Transferring data bits across link; defines physical characteristics of media OSI1
Network Device(1) OSI7 OSI7 OSI6 OSI6 OSI5 OSI5 OSI4 OSI4 OSI3 OSI3 OSI2 OSI2 OSI1 OSI1 OSI1 Hub/Repeater
Network Device(2) OSI7 OSI7 OSI6 OSI6 OSI5 OSI5 OSI4 OSI4 OSI3 OSI3 OSI2 OSI2 OSI2 OSI1 OSI1 OSI1 Bridge/Switch
Network Device(3) OSI7 OSI7 OSI6 OSI6 OSI5 OSI5 OSI4 OSI4 OSI4 OSI3 OSI3 OSI3 OSI2 OSI2 OSI2 OSI1 OSI1 OSI1 Router/Router Switch
Packet Flow Telnet FTP POP I MAP SMTP HTTP SNMP ( Presentation Format ) ( Session Control ) Email: POP, IMAPSMTP HTTP: WWW FTP: File Transfer Protocol Telnet: Remote Login SNMP: Network Management ARP: Address Resolution for MAC Address based on IP Address RARP: Address Resolution for IP Address based on MAC Address TCP UDP ICMP IP ARP RARP Ethernet FDDI Token Ring Token Bus Coaxial Cable Twisted Pair Optical Fiber
PC Hub Switch Router PC Hub Switch Router Physical Layer -Twisted Pair(1) • Crossover • Data Circuit Equipment (DCE) • Data Terminating Equipment (DTE) • MDI-II/MDI-X
Physical Layer -Twisted Pair(2) • Cable type Category Transfer Rate Description CAT 1 < 4 Mbps Voice CAT 2 Voice and Data 4 Mbps 10 Mbps Ethernet CAT 3 CAT 4 Token Ring 16 Mbps CAT 5 Fast Ethernet 100 Mbps 1 Gbps CAT 5e Gigabit Ethernet 1 Gbps Gigabit Ethernet CAT 6
Physical Layer - Layout Signal/Pin TX_CLK RX_CLK TX_EN TXD<3:0> TX_ER RX_DV RXD<3:0> RX_ER CRS COL MDC MDIO LLC MAC MII/GMII 即媒体独立接口 PHY (Physical Layer Interface ) IEEE802.3ab
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) Ethernet Trailer Ethernet Trailer Ethernet Payload Ethernet Payload Ethernet Header Ethernet Header 7 bytes 1 byte 6 bytes 6bytes 2bytes < 1500 bytes 4 bytes Preamble Preamble Delimiter Delimiter DA DA SA SA Type Type CRC CRC Upper Layer Protocol ( ULP ) Upper Layer Protocol ( ULP ) Maximum Frame size 1518 bytes Minimum Frame size 64 bytes Maximum Frame size 1518 bytes Minimum Frame size 64 bytes DA: Destination Address SA: Source Address Type: EtherType CRC: Cyclic Redundancy Check DA: Destination Address SA: Source Address Type: EtherType CRC: Cyclic Redundancy Check
Frame Format(2) 7 bytes Preamble: 1010 1010 . . . 1010 1010 Purpose: achieve receiver synchronization with sender 1 byte Delimiter: 1010 1011 Purpose: denote frame starting point
A B C Frame Format(3) DA: MAC Address SA: MAC Address ( MAC: Media Access Control ) DA SA mac_c mac_a mac_a mac_c mac_a mac_c mac_b
Frame Format(4) Vendor ID ( e.g. Cisco 00:00:0c ) Serial No 6 bytes 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) ICMP OSI 3 IP ARP RARP Ethernet OSI 2 EtherType = 0800 for IP EtherType = 0806 for ARP EtherType = 8035 for RARP
Bridging • Filtering Database • Forwarding Algorithm • Learning Algorithm • Operation Process
E (DA or SA ) Age MAC Address Corresponding Port A 2 53 B 2 40 1 C 2 9 B D 2 100 2 E 1 65 (DA or SA ) Age MAC Address Corresponding Port A 3 100 1 B 1 65 C 2 44 2 3 D 3 96 E 1 29 C D A Filtering Database
X equal to Corresponding Port Start Receive frame from incoming port X DAin Filtering Database no Broadcastincoming frame to all ports except for X yes yes Filtering incoming frame no Forward incoming frame to Corresponding Port End Forwarding Algorithm
Start SA in Filtering Database yes Reset Age to Default Age no Write SA、X and Default Age into Filtering Database End Learning Algorithm
C B A E D Operation Process(1) Ethernet Header Ethernet Frame DA SA port port port MAC MAC MAC I II III 2 2 3 1 1 1 2
D B A C E A D D D A A A A A A A A A D E E B B B B E B C C C C E C E port port port MAC MAC MAC D I II III 2 2 3 1 1 1 2 Operation Process(2) B -> D C -> A E -> A B 2 B 2 B 1 C 2 C 1 C 1 E 2 E 2 E 3
常见二层协议 • VLAN 虚拟局域网 • STP 生成树协议 - RSTP MSTP • LA 链路聚合,也称为trunking • IGMP Snooping 多播组的二层支持 • PNAC 基于端口的认证802.1X • ......