Bridge Mechanism in Junos and MAC table example
06.02 2024 | by massimilianoEthernet Switching oppure Ethernet Lan, indica un meccanismo di Bridging (IEEE 802.1D-2004) attraverso il quale uno switch costruisce una tabella […]
Ethernet Switching oppure Ethernet Lan, indica un meccanismo di Bridging (IEEE 802.1D-2004) attraverso il quale uno switch costruisce una tabella di forwarding (bridge table) basata su indirizzi MAC (Media Access Control), per mezzo di un processo di Learning and Forwarding state.
Il processo di Learning consiste nell’imparare da parte dello switch indirizzi MAC dei nodi ad esso collegati.
Il processo di Forwarding è utilizzato dallo switch per trasmettere traffico da una interfaccia di incoming verso una interfaccia di outcoming guidandolo verso la destinazione.
Il processo di Flooding è un meccanismo trasparente utilizzato per trasmettere pacchetti di tipo unknown MAC addresses.
Il processo di Filtering è un meccanismo per limitare il traffico all’interno del proprio dominio di broadcast (VLAN).
Il processo di Aging permette di avere nella propria tabella MAC solo indirizzi attivi.
Architettura di esempio (lab)
root@vQFX-RE1> show configuration vlans VL100 | display set
set vlans VL100 vlan-id 100
!
root@vQFX-RE1> show configuration interfaces xe-0/0/3 | display set
set interfaces xe-0/0/3 unit 0 family ethernet-switching interface-mode access
set interfaces xe-0/0/3 unit 0 family ethernet-switching vlan members VL100
!
root@vQFX-RE1> show configuration interfaces xe-0/0/4 | display set
set interfaces xe-0/0/4 unit 0 family ethernet-switching interface-mode access
set interfaces xe-0/0/4 unit 0 family ethernet-switching vlan members VL100
!
root@vQFX-RE1> show configuration interfaces xe-0/0/0 | display set
set interfaces xe-0/0/0 unit 0 family ethernet-switching interface-mode trunk
set interfaces xe-0/0/0 unit 0 family ethernet-switching vlan members VL100
Verifica Output (tabella MAC Address Learning)
root@vQFX-RE1> show ethernet-switching table
MAC flags (S – static MAC, D – dynamic MAC, L – locally learned, P – Persistent static, C – Control MAC
SE – statistics enabled, NM – non configured MAC, R – remote PE MAC, O – ovsdb MAC)
Ethernet switching table : 2 entries, 2 learned
Routing instance : default-switch
Vlan MAC MAC Age Logical NH RTR
name address flags interface Index ID
VL100 00:50:79:66:68:03 D – xe-0/0/3.0 0 0
VL100 00:50:79:66:68:04 D – xe-0/0/4.0 0 0
Nota:
Il processo di MAC Learning può essere disabilitato su ciascuna porta di uno switch EX.
Il comando è: set ethernet-switching-options interface xe-0/0/3.0 no-mac-learning
Verifica Output (tabella MAC Address Forwarding and Flooding process)
root@vQFX-RE1> show ethernet-switching table
MAC flags (S – static MAC, D – dynamic MAC, L – locally learned, P – Persistent static, C – Control MAC
SE – statistics enabled, NM – non configured MAC, R – remote PE MAC, O – ovsdb MAC)
Ethernet switching table : 4 entries, 4 learned
Routing instance : default-switch
Vlan MAC MAC Age Logical NH RTR
name address flags interface Index ID
VL100 00:50:79:66:68:03 D – xe-0/0/3.0 0 0
VL100 00:50:79:66:68:04 D – xe-0/0/4.0 0 0
VL100 00:50:79:66:68:07 D – xe-0/0/0.0 0 0
VL100 00:50:79:66:68:08 D – xe-0/0/0.0 0 0
Nota:
Il processo di Forwarding è utilizzato per trasmettere traffico da una interfaccia di ingress ad una di egress verso la corretta destinazione consultando la sua bridge table.
Se la destinazione ha un indirizzo di tipo unknow, lo switch esegue il processo di flooding, trasmettendo la frame a tutte le porte di tipo outcoming [meno quella da cui ha ricevuto la frame (Ingress interface)]
MAC Address Filtering Mechanism
Il processo di Filtering è impiegato per limitare traffico da associare ad una determinata porta.
In questo esempio lo switch evidenzia il processo di filtering associato al traffico con sorgente il PC10 e con destinazione il PC12.
Poiché la destinazione è associata alla stessa porta attraverso la quale ha ricevuto il pacchetto, lo switch consultando la sua bridge table decide di filtrare e/o scartare (drop) il pacchetto.
MAC Address Aging Mechanism
Il processo di Aging è utilizzato da uno switch per assicurare che solo i MAC address attivi sono presenti nella sua bridge table.
Per ogni MAC address presente nella sua tabella, lo switch registra un timestamp da quando l’informazione è stata imparata; ogni volta che lo switch rileva traffico attivo da un MAC address, esso aggiorna il suo timestamp. Un timer periodicamente controlla il timestamp e se questo dovesse risultare vecchio rispetto ad un valore preimpostato da configurazione, lo switch rimuove l’indirizzo di MAC dalla sua bridge table.
Il valore di defaut per l’aging timer = 300 secondi e può essere configurato per tutte le vlans oppure per-vlan base
Comandi:
set ethernet-switching-options mac-table-aging-time < seconds >
root@vQFX-RE1> show route forwarding-table family ethernet-switching
Routing table: __juniper_private1__.bridge
VPLS:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 241 1
Routing table: default-switch.bridge
VPLS:
Destination Type RtRef Next hop Type Index NhRef Netif
default perm 0 dscd 1686 1
xe-0/0/3.0 intf 0 ucst 1729 4 xe-0/0/3.0
xe-0/0/4.0 intf 0 ucst 1730 4 xe-0/0/4.0
xe-0/0/0.0 intf 0 ucst 1734 5 xe-0/0/0.0
Routing table: default-switch.bridge
Bridging domain: VL100.bridge
VPLS:
Enabled protocols: Bridging, ACKed by all peers,
Destination Type RtRef Next hop Type Index NhRef Netif
00:50:79:66:68:03/48 user 0 ucst 1729 4 xe-0/0/3.0
00:50:79:66:68:04/48 user 0 ucst 1730 4 xe-0/0/4.0
00:50:79:66:68:07/48 user 0 ucst 1734 5 xe-0/0/0.0
00:50:79:66:68:08/48 user 0 ucst 1734 5 xe-0/0/0.0
root@vQFX-RE1> show interfaces terse | match xe-0/0/3
xe-0/0/3 up up
xe-0/0/3.0 up up eth-switch # layer 2 interface è configurata per Ethernet switching protocol
root@vQFX-RE1> show interfaces extensive xe-0/0/3
Physical interface: xe-0/0/3, Enabled, Physical link is Up
Interface index: 653, SNMP ifIndex: 527, Generation: 144
Link-level type: Ethernet, MTU: 1514, LAN-PHY mode, Speed: 10Gbps,
Duplex: Full-Duplex, BPDU Error: None, Loop Detect PDU Error: None,
Ethernet-Switching Error: None, MAC-REWRITE Error: None, Loopback: Disabled,
Source filtering: Disabled, Flow control: Disabled, Media type: Fiber
Device flags : Present Running
Interface flags: SNMP-Traps Internal: 0x4000
Link flags : None
CoS queues : 8 supported, 8 maximum usable queues
Hold-times : Up 0 ms, Down 0 ms
Current address: 02:05:86:71:ba:0f, Hardware address: 02:05:86:71:ba:0f
Last flapped : 2023-10-02 10:00:30 UTC (2d 22:46 ago)
Statistics last cleared: Never