I read and read the information and somehow it is inconsistent or incomplete. The specification of 802.1Q also read, but to me as a person who has not previously read the specification is difficult. I draw a diagram. The diagram shows an illustration of the included ingress filtering. Is this a correct opinion? What is mapped at all, what are the "variables", maybe there is some sort of VLAN memberset where multiple allowed VLANs can be entered. Need a direct understanding of how this works.
In pseudocode, it can be illustrated like this:
fvid = frame.tag8021q.VLAN
isUntagged = fvid == 0
if isUntagged {
if egressPort.Mode&ACCESS != 0 {
if ingressPort.PVID() != egressPort.PVID() {
return 0
}
}
if egressPort.Mode&TRUNK != 0 {
isMatched = egressPort.AllowedVlans().Contains(ingressPort.PVID())
if !isMatched {
return 0
}
}
} else {
if fvid != ingressPort.PVID() {
return 0
}
}
EDIT:
Unknown moment #1: We are searching in FDB, check frame source address and frame VID, if there is an entry and data match - we continue frame processing, otherwise - we discard. Is that correct?
Unknown moment #2: If ingress filtering is turned off on the egress port, so there will be no VLAN member set, what should we match the VID of the frame with?
Completely scheme of three phases processing of frame: