l2 switching overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 e-mail :...

25
L2 Switching Overview 2009 年 12 年 年年 年年 年年0512-68839302 E-mail [email protected] 年年http://staff.ustc.edu.cn/~mengning 年年 年年年年年年年年年年年年年年年年年 166 年年年年 A302 年

Upload: dustin-floyd

Post on 14-Jan-2016

308 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

L2 Switching Overview

2009 年 12 月

主讲:孟宁电话: 0512-68839302E-mail : [email protected]主页: http://staff.ustc.edu.cn/~mengning地址:苏州工业园区独墅湖高等教育区仁爱路 166 号明德楼 A302室

Page 2: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Content

♦ OSI Protocol Stack♦ Network Device♦ Packet Flow♦ Physical Layer♦ Auto Negotiation♦ MII Registers♦ Frame Format♦ Bridging♦ Question♦ Reference

Page 3: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 4: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Network Device(1)

OSI7

OSI6

OSI5

OSI4

OSI3

OSI2

OSI1

OSI7

OSI6

OSI5

OSI4

OSI3

OSI2

OSI1

Hub/Repeater

OSI1

Page 5: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Network Device(2)

OSI7

OSI6

OSI5

OSI4

OSI3

OSI2

OSI1

OSI7

OSI6

OSI5

OSI4

OSI3

OSI2

OSI1

Bridge/Switch

OSI1

OSI2

Page 6: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Network Device(3)

OSI7

OSI6

OSI5

OSI4

OSI3

OSI2

OSI1

OSI7

OSI6

OSI5

OSI4

OSI3

OSI2

OSI1OSI1

Router/Router Switch

OSI3

OSI2

OSI4

Page 7: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 8: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 9: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 10: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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 即媒体独立接口

Page 11: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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.

Page 12: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

MII Registers

♦ 32 PHY registers♦ 16-bit value of each register♦ Register table

Page 13: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 14: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 15: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 16: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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.

Page 17: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Frame Format(5)

Ethernet

ICMPIP ARP RARP

EtherType = 0800 for IPEtherType = 0806 for ARPEtherType = 8035 for RARP

OSI 3

OSI 2

Page 18: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Bridging

♦ Filtering Database

♦ Forwarding Algorithm

♦ Learning Algorithm

♦ Operation Process

Page 19: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 20: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 21: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

Learning Algorithm

SA in Filtering Database

Reset Age to Default Age

Write SA 、 X and Default Age into Filtering Database

End

Start

yes

no

Page 22: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 23: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

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

Page 24: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

常见二层协议♦ VLAN 虚拟局域网♦ STP 生成树协议 - RSTP MSTP

♦ LA 链路聚合,也称为 trunking

♦ IGMP Snooping 多播组的二层支持♦ PNAC 基于端口的认证 802.1X

♦ ......

Page 25: L2 Switching Overview 2009 年 12 月 主讲:孟宁 电话: 0512-68839302 E-mail : mengning@ustc.edu.cn 主页: mengning 地址:苏州工业园区独墅湖高等教育区仁爱路

谢谢大家!