40
Address Resolution Logic (for NCTU) 呂呂呂 呂呂呂呂呂呂呂呂呂呂呂 TEL : (03)591-5708 Email : [email protected]

Address Resolution Logic (for NCTU)

Embed Size (px)

DESCRIPTION

Address Resolution Logic (for NCTU). 呂國正 工研院電通所高速網路部 TEL : (03)591-5708 Email : [email protected]. Agenda. Position of ARL in L3S Chip Concept of IP Routing & Multi-Layer Switching Introduction to CIDR and Longest Prefix Matching ARL Architecture and I/O interface - PowerPoint PPT Presentation

Citation preview

Address Resolution Logic(for NCTU)

呂國正工研院電通所高速網路部

TEL : (03)591-5708

Email : [email protected]

Confidential & Proprietary2

Agenda

• Position of ARL in L3S ChipPosition of ARL in L3S Chip• Concept of IP Routing & Multi-Layer Switching• Introduction to CIDR and Longest Prefix Matching• ARL Architecture and I/O interface• ARL Detailed Design• Forwarding Table Management

Confidential & Proprietary3

Position of ARL in L3S Chip

ARLARL

Header Pre-Processor

...

Result Processor

Routing Header

Routing Result

Queue Processor

Packet Memory

Header updating

Port map ...

Routing Result (from CPU)

Header Queues

Forw

arding Table

Scheduler

Post Processor

MAC

To PM

Confidential & Proprietary4

ARL Specification

Layer 2 1.Support Spanning Tree Protocol port states (IEEE 802.1D)2.Support 8 K MAC address entries(automatic learning/aging)3.Support BPDU/GMRP/GVRP packet filtering4.Support 256 port /IP subnet based VLAN5.Support IEEE 802.1p/q tagging6Support access or trunk port setting7.Support port mirroring8.Automatic Layer 2 address learning & aging9.Support statistical counters for network management

Layer 3 1. Wire speed IP longest prefix(CIDR)lookup(1.2 Mpps)2. Support 10K unicast IP routes3. Support 4K ARP entries4. Support 2K IP multicast entries5. Bridging or CPU based routing for non-IP packets6. Support ARP/RARP/IGMP packet filtering7. Support DHCP relay through broadcast packet filtering8. Flexible configuration for switch/router(i.e. can group several ports to

a subnet)9. Support Multi-Home routing(i.e. a port can belong to several subnets)10.Support statistical counters for network management

CoS/QoS 1. Packet prioritization based on IP TOS/IEEE 802.1p tag/Protocol field2. Can prioritize UDP/ICMP traffic over TCP

ForwardingTable I/F

32-bit Flow Through SSRAM (66Mhz)

Support portNumbers

Up to 16 Fast Ethernet ports or 8 FE +1GE or 2GE

Confidential & Proprietary5

ARL Functions (1/2)

• Layer 2 Forwarding Decision– DA Lookup

– SA Learning

– VID Lookup

– BPDU/GMRP/GVRP Handling

– STP Port State Handling

– Port Mirroring

– Non-IP Packet Handling (ARP, IPX …)

– Statistical Counters

– Decide to Route or to Switch

Confidential & Proprietary6

ARL Functions (2/2)

• Layer 3 Forwarding Decision– Version and Header Length Check

– IP Unicast Lookup (find next hop MAC)

– TTL check

– IP Multicast Lookup

– IGMP & 224.0.0.X Filtering

– Statistic Counters

• Packet Classification– IEEE 802.1p Priority Tag

– IP TOS bits

– Layer 4 Protocols

Confidential & Proprietary7

Agenda

• Position of ARL in L3S Chip• Concept of IP Routing & Multi-Layer SwitchingConcept of IP Routing & Multi-Layer Switching• Introduction to CIDR and Longest Prefix Matching• ARL Architecture and I/O interface• ARL Detailed Design• Forwarding Table Management

Confidential & Proprietary8

Router v.s. Bridge/Switch

L2Switch

Router

CollisionDomain

CollisionDomain

CollisionDomain

CollisionDomain

CollisionDomain

CollisionDomain

L2Switch

Broadcast Doamin(Subnet) A Broadcast Doamin(Subnet) B

140.96.115.X 140.96.116.X

PHY PHY

LINK

PHY PHY

LINK LINK

IP

Confidential & Proprietary9

Router does packet modification

Preamble SFDDest.

AddressSource

AddressLEN/TPE

Data FCS

Ver IHL Typ of Serv Total Length

Identifier Flg Fragment Offset

Time To Live Protocol Header Checksum

Source Address

Destination Address

Options + Padding

Data

Ethernet Frame

IP Packet

IP Header

MAC DA MAC SA TTL Checksum CRC(Org. Vtag)

CRC(VtagChanged)

Same subnet ˙ ˙ ˙ ˙ ˙ RecalculateL3 unicast Next hop Router Decrement Recalculate Recalculate RecalculateL3 subnet

directed BC˙ Router Decrement Recalculate Recalculate Recalculate

L3 multicast ˙ Router Decrement Recalculate Recalculate Recalculate

These two maybe occur at the same time

in a multilayer SW

These two maybe occur at the same timeif subnet directed broadcast is supported

Packet modification summary

Confidential & Proprietary10

A Typical IP Routing Table

• Entry in a typical routing table

• An ARP table entry

Network Address for This Route

Subnet Mask for This Route

IP Address of the Next Hop

Distance Metric Interface Port ID

Sort Key Time to Live

0 31

IP Address of the Next Hop or Local Host

MAC Address [47:16]

MAC Address [15:0] Time to Live

Confidential & Proprietary11

A Sample Network

Internet

NN=140.96.115.0NM=255.255.255.0

NN=140.96.116.0NM=255.255.255.0

NN=140.96.117.0NM=255.255.255.0

NN=140.96.118.0NM=255.255.255.0

140.96.115.254 140.96.116.254

140.96.117.254

140.96.118.253

192.10.1.253

192.10.1.254

140.96.115.147 140.96.116.182

140.96.118.56

140.96.116.17

Router #1

Router #2

PC #1 PC #2 PC #3

PC #4

140.96.118.254

140.96.117.20

PC #5

Confidential & Proprietary12

Routing Tables

• Routing table of router #1

• Routing table of router #2

目的網路 網路遮罩 下一站 埠號 距離(Metric)140.96.115.0 255.255.255.0 直接相連 1 0140.96.116.0 255.255.255.0 直接相連 2 0140.96.118.0 255.255.255.0 直接相連 3 0140.96.117.0* 255.255.255.0 140.96.118.254 3 1

0.0.0.0(預設路由) 0.0.0.0 140.96.118.254 3 1

目的網路 網路遮罩 下一站 埠號 距離(Metric)140.96.117.0 255.255.255.0 直接相連 2 0140.96.118.0 255.255.255.0 直接相連 1 0140.96.115.0* 255.255.255.0 140.96.118.253 1 1140.96.116.0* 255.255.255.0 140.96.118.253 1 1

0.0.0.0(預設路由) 0.0.0.0 192.10.1.254 3 1

Confidential & Proprietary13

What’s Multi-Layer Switching

• Very Flexible Configuration

VLAN

R

L2 Switch(VLAN)R

L2 Switch(VLAN)

R

VLAN 1VLAN2/3

: port組態一 每個 皆為Layer 2 Switching

: port組態二 每個 皆為Layer 3 Routing

: Layer 3 Routing組態三VLAN運作於多個 之間

: Trunk port to an組態四external router/switch

VLAN 2

R

VLAN 1

Confidential & Proprietary14

VLAN , IP Subnet, and Port

• Support Port Based VLAN • A Port can belong to Multiple IP Subnets but only one

VLAN(exception : trunk port)• Multiple ports can group into a Subnet or VLAN• Each subnet has a unique router IP address• Ports of the same subnet have the same router

MAC address

But …• VLAN boundary defines the broadcast domain,

not the subnet boundary !!• If Explicit Tag is applied, a packet can arrive any member

ports of the L3S chip– Trunk port delivery– confused VLAN & subnet limitation !

Subnet 1

VLAN

Subnet N

Confidential & Proprietary15

VLAN , IP Subnet, and Port

In Short,• VLAN (VID) is just a method to defines the broadcast

domain of a IP subnet in our L3S design– Actually, there is only VLAN boundary but no subnet boundary !!

– Or, Subnet boundary is virtually contained by the same router MAC address

• Set VLAN Boundary = Subnet boundary you want to be -> normal operation

聽無 ?!

Confidential & Proprietary16

When to route? When to switch ?

• If (IP & DA = Router’s MAC of the source port)– Route Receive a packet

(layer 2 SA learning)

MAC DA = L3S portMAC address ?

Dest. IP = L3S portIP address ?

Routing table lookupto find next hopMAC address

Yes

No

Find andTTL > 1 ?

MAC DA/SAreplacement

TTL decrement,recalculate IPchecksum & CRC

Send the packet to thenext hop

Layer 2 switching(using MAC DA)

Send the packetto CPU

Yes

No

A

A

No

Yes

Confidential & Proprietary17

Non-IP Packet Handling

• Method #1 : Local Bridging– share the same VLAN boundary with IP packets

– can use trunk port to connect to an external router

– suitable for overlay of IP subnet & non-IP subnet environment

• Method #2 : Local Bridging to all-port VLAN– may cause broadcast storm

– not support in this version !

• Method #3 : Send to CPU if DA=router’s MAC– set NIPR = 1 to enable non-IP packet routing

– need non-IP routing protocol running on the system

Confidential & Proprietary18

IP Multicast Forwarding

DVMRP Multicast Forwarding Table

MOSFP Multicast Forwarding Cache

Reverse Path Forwarding(used by DVMRP)

TTL Based Scoping

DVMRP,MOSPF :Two popular inter-gateway multicast Routing Protocols

Build shortest path tree from source to each destination!

Confidential & Proprietary19

Agenda

• Position of ARL in L3S Chip• Concept of IP Routing & Multi-Layer Switching• ARL Architecture and I/O interface• Introduction to CIDR and Longest Prefix MatchingIntroduction to CIDR and Longest Prefix Matching• ARL Detailed Design• Forwarding Table Management• ARL Performance Estimation• Configuration Registers and Statistical Counters• ARL Pin Assignment• Q & A

Confidential & Proprietary20

What’s CIDR

• CIDR(Classless Inter-Domain Routing) is introduced to overcome the following problems– exhausting of class B network

– explosion of internet routing table

• CIDR allows any length of subnet mask– e.g. TWNIC can assign 2 class C networks(subnet mask length =

23) to a company if he has only 300 hosts=> efficient for IP address allocation

– Router can aggregate several routes to a big route with less mask length=> reduce core router’s routing table size

Confidential & Proprietary21

Route Aggregation by CIDR

• CIDR permits route aggregation– reduce the Internet routing table

Confidential & Proprietary22

CIDR and Longest Prefix Matching

• With CIDR, a router has to perform longest prefix matching to find the next hop

• This is what wire-speed routing does !

e.g. dest_ IP: 1100 0001 1110 0001 0011 1110 1010 1111entry_IP 1: 1100 0001 1110 0001 0011 0000 0000 0000 mask : 1111 1111 1111 1111 1111 0000 0000 0000entry_IP 2: 1100 0001 1110 0001 0011 1100 0000 0000 mask : 1111 1111 1111 1111 1111 1100 0000 0000entry_IP 3: 1100 0001 1110 0000 0000 0000 0000 0000 mask : 1111 1111 1111 1111 1111 1111 1100 0000

Confidential & Proprietary23

Algorithm for Longest Prefix Matching

Confidential & Proprietary24

An Example

Confidential & Proprietary25

Agenda

• Position of ARL in L3S Chip• Concept of IP Routing & Multi-Layer Switching• Introduction to CIDR and Longest Prefix Matching• ARL Architecture and I/O interfaceARL Architecture and I/O interface• ARL Detailed Design• Forwarding Table Management

Confidential & Proprietary26

ARL Architecture - Overview

Multi-Layer Search Engine

ARL_CIUAging

Controller

Arbitration /MUX

Forwarding Table

CPU IFHeader

Pre-ProcessorResult

Processor

Confidential & Proprietary27

ARL Architecture - Block Diagram

Confidential & Proprietary28

Multi-Layer Search Engine

L2 Search Engine

L3 Search Engine

PacketClassifier

MSE Controller

L2/L3 MuxRoutingResult

To forwarding table arbiter

Start_L2_PC

Start_L3

Req/ack

Rlt

_val

idR

lt_a

ckH

dr_v

alid

Hdr

_val

id

Routing Header &Relay Info.(e.g. fptr,flen)

L2_

Hdr

L3_

Hdr 802.1p

ToSProtocol

Confidential & Proprietary29

Agenda

• Position of ARL in L3S Chip• Concept of IP Routing & Multi-Layer Switching• Introduction to CIDR and Longest Prefix Matching• ARL Architecture and I/O interface• ARL Detailed DesignARL Detailed Design• Forwarding Table Management

Confidential & Proprietary30

Overall Lookup Flow

Confidential & Proprietary31

Forwarding Table Entry Format

Confidential & Proprietary32

Layer 2 Search Engine- Flow Chart

Confidential & Proprietary33

Layer 2 Search Engine- State Machine

Confidential & Proprietary34

When to enter L3 search engine

• A Valid IP Packet – header checksum OK & length check OK…(by HPP)

&

• Routing Enable on this ort– configured by REM

&

• Destination MAC = Router port’s MAC or = Broadcast/Multicast MAC

Confidential & Proprietary35

Layer 3 Search Engine- Flow Chart

Confidential & Proprietary36

Layer 3 Search Engine- State Machine

Confidential & Proprietary37

Packets to CPU• Layer 2 Control packets

– BPDU,GMRP,GVRP

• ARP packets• !IP & DA=Router’s MAC or Multicast MAC & RE & NIPR=1

– e.g. IPX packets

• IP & DA=Router’s MAC or Multicast MAC & !RE– disable hardware routing but enable CPU routing for IPpackets

• Layer 3 Lookup with AT=00,01,10 or an invalid ARP entry– black hole, ARP age out,router’s IP(s), broadcast IP(s)

• Layer 3 Lookup with TTL < 2• Layer 3 Lookup with a Miss in IP Multicast lookup• Layer 3 Lookup with Ver != 4 or Hlen != 5• IGMP or IP=224.x.x.0

Confidential & Proprietary38

Packet Classifier - Circuit

Confidential & Proprietary39

Agenda

• Position of ARL in L3S Chip• Concept of IP Routing & Multi-Layer Switching• ARL Architecture and I/O interface• Introduction to CIDR and Longest Prefix Matching• ARL Detailed Design• Forwarding Table ManagementForwarding Table Management

Confidential & Proprietary40

Think ….

• The result from the combination of routing table & ARP Table

Route to R1Route to R2

…Route to ?

...Router #1 IP

Router #2 IP(aged)Router #15 IP

….Host #1 IPHost #k IP

Route to R1Route to R2

…Route to ?

...Router #1 IP

Router #2 IP(aged)Router #15 IP

….Host #1 IPHost #k IP

L3 TableARP Table

MAC of DRMAC of R1

MAC of R2(invalid)...

MAC of R15

MAC of H1MAC of H2invalid entry

…..MAC of H3

...invalid entry

...MAC of Hk