MT7621A Switch

You might also like

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 25

MT7621A’s Switch

and Application in Multi-Service


Presenter: Hoangtu1
Content
1.Hardware Description

2.Switch Configuration

3.Application in Multi-Service
Hardware Description

MT7621A SoC includes a Gigabit Switch


to provide several Ethernet Ports with
only 2 CPU interfaces

MT7621A functional blocks


Hardware Description
The switch includes:
• 7-port Gigabit Ethernet MAC
• 5-port Gigabit Ethernet PHY

To CPU
Ports

To Physical Ports
Hardware Description

Our AP uses only 5 Ports


Switch Configuration

• Method of Configuration

• Switch Concepts

• Examples
Method of Configuration
• By “switch” command from console
Method of Configuration
• Also by “switch” command – but get/set directly to the
switch’s register

• By API in kernel: see /linux-kernel/drivers/net/raeth/raether.c


Switch Concepts
• PVID
• VLAN Table
• VLAN Security Mode
• Egress Port Tag Setting
• VLAN Port Attribute
Switch Concepts 1
PVID (Port VID):
• Use as the default VID to for each Port
• Usage:
• switch vlan pvid [port] [vid]
• Or switch reg w 0x2p14 0x1000v
p: port 0-6
v: vid
Switch Concepts 2
VLAN Table – VLAN Member Setting
• Each entry includes vid and
portmap => decide which port
packet is forwarded to.
• Usage:
• switch vlan set [vlan idx]
[vid] [portmap]
Switch Concepts 3
VLAN Security Mode
• If port is set to security mode, discard packets if they
violate ingress membership or are missed on VLAN Table
Þ Always set port to security mode
• Usage: see the source code
Switch Concepts 4
Egress port tag setting:
• Whether strip tags of the packets when go out from the port.
• Detailed behavior depends on VLAN Port Attribute
Switch Concepts 5
VLAN Port Attribute
• Can be: User Port, Transparent Port, Translation Port, Stack Port
• Should only care about User Port and Transparent Port
Switch Concepts 5
VLAN Port Attribute: User Port
Incoming Direction
- Untagged Packet: PVID is treated as VID1
- Tagged Packet: outer tag is treated as
VID1

Þ Use VID1 to lookup for VLAN Table

(shouldn’t care about VID0 because we


don’t use it)
Switch Concepts 5
VLAN Port Attribute: Transparent Port
Incoming Direction:
Don’t care about the original
tagged/untagged status
Always use PVID as VID1 to look up in
VLAN Table
Switch Concepts 5
VLAN Port Attribute: Transparent Port
Outgoing Direction:
“Can accept ‘UNTAG’ control to send the original frame”

Presenter Note:
There’re no picture in the documents about Transparent Port egress side, but from what I
learnt, packet sent from Transparent port with untagged setting may include VLAN tags if
the original packet has VLAN tags.
Examples
Original Configuration
Port 2 Port 3 Port 4 Port 5 Port 6

PVID 2 1 1 2 1

Egress port tag untagged untagged untagged untagged untagged


setting
Port Attribute transparent transparent transparent transparent transparent

VLAN Table

VID Port Map


1 3, 4, 6
2 2, 5
Examples
Original Configuration

Port 2 Port 3 Port 4 Port 5 Port 6

PVID 2 1 1 2 1

Egress untagge untagge untagge untagge untagge


eth1 eth0
port tag d d d d d
setting

Port transpar transpar transpar transpar transpar


Attribut ent ent ent ent ent
e

VID Port Map


1 3, 4, 6
2 2, 5
Examples
Multi-Service Configuration
Port 2 Port 3 Port 4 Port 5 Port 6

PVID 3 1 2 3 1 (?)

Egress port tag untagged untagged untagged untagged tagged


setting
Port Attribute transparent transparent transparent transparent User port

VLAN Table
VID Port Map
1 3, 6
2 4, 6
3 2, 5
Examples
Multi-Service
Configuration
Port 2 Port 3 Port 4 Port 5 Port 6
PVID 3 1 2 3 1 (?)
eth1.35 eth1.2501 eth0.1 eth0.2
Egress untagg untagg untagg untagg tagged
port ed ed ed ed
tag
setting
Vlan 35
Port transp transp transp transp User
Attribu arent arent arent arent port
te

VID Port Map


Vlan 35; VID1 = 3
1 3, 6
2 4, 6
3 2, 5

Vlan 35
Examples
Multi-Service
Configuration
Port 2 Port 3 Port 4 Port 5 Port 6
PVID 3 1 2 3 1 (?)
eth1.35 eth1.2501 eth0.1 eth0.2
Egress untagg untagg untagg untagg tagged
port ed ed ed ed
tag
setting
VID = 1
Port transp transp transp transp User
Attribu arent arent arent arent port
te

VID Port Map


1 3, 6 Untagged; VID1 = 1
2 4, 6
3 2, 5

untagged
Examples
Multi-Service
Configuration
Port 2 Port 3 Port 4 Port 5 Port 6
PVID 3 1 2 3 1 (?)
eth1.35 eth1.2501 eth0.1 eth0.2
Egress untagg untagg untagg untagg tagged
port ed ed ed ed
tag
setting
VID = 1
Port transp transp transp transp User
Attribu arent arent arent arent port
te
Untagged; VID1 = 1

VID Port Map


1 3, 6
2 4, 6
3 2, 5
untagged
Application in Multi-Service

Wifi Interfaces eth0.1 eth0.2

br-lan

br-wan0
routing
eth1.2501

eth1.35
References

You might also like