IEEE802.1ag 20章 前3小节, 再上图 MEP / MIP / MD MA/
Figure 18-7—MEPs, MIPs, and MD Levels
# PDU
DUT shall not accept the CCM frame that source MAC address is “Group MAC address”.
DUT shall not accept the CCM frame that destination MAC address is different with MD Level.
DUT shall always ignore the Version field that is unknowable.
// Ingnore的意思是,接收方不对该字节进行检查,忽略此字段,若该包中其他格式正确则接收方对此包正常处理, 记录信息到MEPDB中等.
# MD/ MA / VLAN 连通性之间的关系;
1) 一个MD可以包含多个MA;
2) 一个MA中可以指定多个vlan,但是只有primary生效;
3) CFM的目的在于检查链路的连通性, 所以被检测的链路必须在同一个vlan中的MEP才有意义;
4) 所以一个MA中主机必须在一个vlan中, 确认联通性才有意义;
5) 案例, 一个MD中有多个MA,每个MA有不同的Primary Vlan, 所以当MEP确认联通性时, 为每个MA单独确认, 不同vlan间互不影响.
# MEP/MIP , MA , MD
1) MEP/MIP是由端口组成的, MA 是由相同或者不同BRIDGE上的端口(MEP/MIP) 组成的, 而MD 是由一个或者多个MD组成的.
2) 在同一个Bridge的同一个MA中, 如果某个端口被配置成UP(down) MEP,则该MA中该Bridge上的所有端口必须是UP(dwon) MEP.
3) Mep是绑定端口的, MA是绑定VLAN的.
# MEP / MHF 发送LBM/LBR, LTM/LMR, CCM 时的SMAC和DMAC, 以及这些MAC地址和Bridge的关系?
# CCM reception
Any CFM PDU received that is too short to contain an MD Level header field shall be discarded.
Those PDUs that do not match any of the OpCodes recognized by an MP OpCode Demultiplexer, or that are too
short to contain an OpCode, are discarded by either of a MEP’s MP OpCode Demultiplexers, and passed to
the Passive MHF Multiplexer by an MHF’s MP OpCode Demultiplexer.
# Port Status and Interface Status
# MIP Creation
cfm中有两个值, 分别在MD和MA下, 为CfmMdMhfCreation和CfmMaMhfCreation: 具体使用ma的值. ma的值可以单独指定或者指向MD中的值.
CfmMdMhfCreation: MD下有3个值, 分别是 defMHFnone, defMHFdefault和defMHFexplicit; 标准指定的默认值为defMHFnone. 而目前DUT上使用的是defMHFdefault;
CfmMaMhfCreation: MA下游4个值, 分别是 defMHFnone, defMHFdefault和defMHFexplicit, 加上defMHFdefer.且标准指出默认值为 defMHFdefer, 但是目前dut上默认值为defMHFdefault;
· defMHFnone: 不自动创建MIP;
· defMHFdefault: 当mip creation为default时, 会在属于ma所在vlan的所有端口下自动创建MIP, 如果 该端口没有属于更低等级的active MD或者
· 该端口是 更低级别的MEP.
· defMHFexplicit: 当mip creation为Explicit时, 会在属于ma所在vlan的所有端口下自动创建MIP, 如果 该端口是更低级别的MEP. 并不是所有所有
· 口 都创建.
· defMHFdefer: 只有在MA下存在的值, 也是标准中指定的CfmMaMhfCreation的默认值, 当CfmMaMhfCreation被设定成defMHFdefer时, 表明该值从CfmMdMhfCreation中取值 .
Referenc ieee802.1ag P220.
# First TLV Offset (1 octet)
The First TLV Offset field of the Common CFM Header in a CCM is transmitted as 70.
The First TLV Offset field of the Common CFM Header in an LBM or LBR is transmitted as 4.
The First TLV Offset field of the Common CFM Header in an LTM is be transmitted as 17.
The First TLV Offset field of the Common CFM Header in an LTR is transmitted as 6.
defMHFnone: No
defMHFdefault:
VID(s) can pass
i) There are no
ii) There is a MEP
defMHFexplicit:
Only the highest priority defect is reported in the Fault Alarm.
# Highest Defect: Lowest Alarm :
Console#show ethernet cfm fault-notify-generator mep 1
MD Name MA Name Highest Defect Lowest Alarm Alarm Time Reset Time
------------ ------------ -------------- ------------- ---------- ----------
md1p ma1p defXconCCM macRemErrXcon 10 sec. 8 sec.
Highest Defect: 表示目前DUT发生的或者检测到的, 并且已经alarm的错误类型; 标准规定:Only the highest priority defect is reported in the Fault Alarm.
Lowest Alarm : 定义需要report错误的最低等级, 及低于定义的等级则不需要报告.
Lowest Alarm 值
------------------------------------------------
allDef 1
macRemErrXcon 2
remErrXcon 3
errXcon 4
xcon 5
noDef 6
----------------------------- // DUT ASF4528B
allDef (1),
macRemErrXcon (2),
remErrXcon (3),
errXcon (4),
xcon (5),
noXcon (6)
----------- // From 802.1ag
#
# RDI (Remote Defect Indication)
20.33.7 someRDIdefect
A Boolean indicating the aggregate health of the remote MEPs. True indicates that at least one of the
Remote MEP state machines is receiving valid CCMs from its remote MEP that has the RDI bit set, and
false that no Remote MEP state machines are receiving valid CCMs with the RDI bit set. someRDIdefect is
the logical OR of all of the rMEPlastRDI variables for all of the Remote MEP state machines on this MEP.
This variable is readable as a managed object [item o) in 12.14.7.1.3].
Read MEP Database
e) A Boolean value indicating the state of the RDI bit in the last received CCM (true for RDI = 1), or
false, if none has been received (20.19.2);
20.19.2 rMEPlastRDI
Boolean flag. Contains the RDI flag from the last-received CCM. This variable is readable as a managed
object [item e) in 12.14.7.6.3].
20.11.1 xmitCCM()
g) Fills the RDI field (21.6.1.1) with the presentRDI variable (20.9.6);
20.9.6 presentRDI
A Boolean value indicating the state of the RDI bit in CCMs transmitted by this MEP. presentRDI is true if
and only if one or more of the variables someRMEPCCMdefect, someMACstatusDefect, errorCCMdefect,
or xconCCMdefect is true, and if the corresponding priority of that variable, from Table 20-1, is greater than
or equal to the value of the variable lowestAlarmPri.
# LTM / LTR 实体/ 处理函数调用/ 状态机
实体: MEP DOWN / MEP UP / MHF UP / MHF DOWN ;
Linktrace Responder : 负责接收LTM和发送LTR; 牵涉到函数为ProcessLTM, enqueLTR/xmitOldestLTR和 ForwardLTM;
MEP Linktrace Initiator:负责发送LTM和接收LTR; 牵涉到的函数有ProcessLTR() , xmitLTM() .
实体接收到LTM的处理过程:
1) 任意实体接收到LTM包都由 ProcessLTM 处理. 并由其决定是调用ForwardLTM 来转发LTM包和/或enqueLTR来回复LTR包;
2) 先校验包格式. Dmac应该为table-8-10; ttl !=0 ;
3) 若Target mac = received mp's mac, 则认为该LTM到达地点, 回复LTR并丢弃LTM, 不对LTM再进行转发. 则ProcessLTM调用enqueLTR处理. enqueLTR负责制造LTR包根据收到的LTM包, 并将需要发送的LTR包放入到队列中(enqueue), 将nPendingLTRs 值+1. 当且仅当nPendingLTRs !=0时, 触发 xmitOldestLTR 发送LTR包. ( 为什么为Oldest呢? 因为该队列为FIFO.);
4) 若Target mac != received mp' mac. 则对LTM包进行Forward. 则ProcessLTM调用ForwardLTM 重组一个LTM包( 包括将TTL-1; 修改Source mac为mp's mac等. )并转发. 在转发LTM的时,如何选择出端口?
5) LTM包出端口的选择. 首先使用LTM包中的vid 和target mac( not dmac) 在mac-address table中查找Egress端口, 若没有找到唯一出口, 则其次是要MIPDatebase来进行查找唯一出口. 如果LTM未找到唯一的Egress出口, 则LTM包被discard掉; ( 因为有可能存在同一个mac地址被两个端口同时学习 或者target mac 未被学习到的情况??. )
6) 被选中的Egress端口可能存在以下四种情况. with UP MEP , with UP MHF, with Down MEP, with Down MHF, without MEP or MIP;
with UP MHF: 若指定的egress端口中有up mhf存在, 则 先回复LTR包(调用enqueLTR)从ingress端口发出; 并确认是否Forward LTM包, 如果Target mac != mp's mac, 则LTM从该Egress port发出;
with UP MEP: 若指定的egress 端口上有up mep存在, 则只回复LTR包(调用enqueLTR)从ingress端口发出且丢弃LTM包.
剩下的3种 with Down MEP, with Down MHF, without MEP or MIP. 情况一样(因为从cpu发出的LTM包在经过Down MEP 和Down MEP时会被透传), 则通知Ingress port 调用 enqueLTR 发送LTR包;
总结:
· UP MEP/DOWN MEP 和UP MHF 在active 方向上收到LTM, 无论其target mac是否等于自己的mac 都会回复LTR,前提是能找到唯一的egress port,否则则丢弃; 但是UP MEP和Down MEP会drop LTM,不会Forward LTM. 但是UP MHF 是否Forward LTM取决 target mac != received MP's MAC(不同则forward ) ;
· DOWN MHF 在mac不同时不会回复LBR, 而LBR则是由被选定的Egress端口的被遇到的MP发出.(with Down MEP, with Down MHF, without MEP or MIP除外)
· 当一个LTM从DUT的外部进入DUT内部后, 有没有可能回复两个或者多个LBR. 多个MP回复?
##
1) 当任意实体收到LTM包时, 回复LTR和转发LTM是两个独自的进程来处理. 可以理解为两个独立的线路; 相互之间没有必然的联系
2) 暂时可以理解为所有的LTR包都从接收到LTM的口发送出去. 但是从该口收到的LTM包绝对不能从ingress口再转发出去.
具体实例:
LTM is received by a Down MEP
if target mac = received MP's MAC, 回复LTR 并丢弃LTM;
otherwise, 寻找egress port. 如果该端口未被stp block 且在同一个vlan中.
otherwise, 在ingress port发送LBR, 并discard LTM包;
LTM is received by a Down MHF or originated by an Up MEP
20.42 LTM Receiver procedures
The procedures local to the LTM Receiver state machine are:
a) ProcessLTM() (20.42.1);
b) clearPendingLTRs() (20.42.2);
c) ForwardLTM() (20.42.3); and
d) enqueLTR() (20.42.4).
20.41 Linktrace Responder variables
The following variables are local to the Linktrace Responder:
a) nPendingLTRs (20.41.1);
b) LTMreceived (20.41.2); and
c) LTMPDU (20.41.3).
20.39 MEP Linktrace Initiator receive procedures
The following procedure is local to the MEP Linktrace Initiator receive state machine:
a) ProcessLTR() (20.39.1).
20.37 MEP Linktrace Initiator procedures
The following procedure is local to the MEP Linktrace Initiator:
a) xmitLTM() (20.37.1).
20.39 MEP Linktrace Initiator receive procedures
The following procedure is local to the MEP Linktrace Initiator receive state machine:
a) ProcessLTR() (20.39.1).
#############################################################
dot1agCfmMepUpNotification
dot1agCfmMepDownNotification
dot1agConnectivityCheckConfigureFailNotification
dot1agConnectivityCheckLoopNotification
dot1agCrosscheckMEPUnknownNotification
dot1agCrosscheckMEPMissingNotification
dot1agCrosscheckMAUpNotification
1, dot1agCfmMepUpNotification
//配置完成后即可收到 dot1agCfmMepUpNotification和dot1agCrosscheckMAUpNotification; 或也可参照 7 dot1agCrosscheckMAUpNotification;
con
no span
no b g
int vl 1
ip add 192.168.1.17 255.0.0.0
exit
int e 1/1-26
no sw br
no sw mu
no sw un
no sw gvrp
exit
snmp-server host 192.168.1.8 public ver 2c
snmp-server enable traps ethernet cfm cc
snmp-server enable traps ethernet cfm crosscheck
ethernet cfm enable
ethernet cfm domain index 1 name md1 level 1 mip-creation explicit
ma index 1 name ma1 vlan 1 mip-creation explicit
mep crosscheck mpid 4094 ma ma1
exit
int eth 1/11
ethernet cfm port-enable
ethernet cfm mep mpid 2 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 4094 ma index 1
oam remote 5 cfm enable
exit
2, dot1agCfmMepDownNotification
// 参考 6 dot1agCrosscheckMEPMissingNotification
3, dot1agConnectivityCheckConfigureFailNotification
// cfg error, 使dut收到的ccm包中带的mep id等于自身端口的mep id即可, 所以使用下面配置就能发出dot1agConnectivityCheckConfigureFailNotification
con
no span
no b g
int vl 1
ip add 192.168.1.17 255.0.0.0
exit
int e 1/1-26
no sw br
no sw mu
no sw un
no sw gvrp
exit
snmp-server host 192.168.1.8 public ver 2c
snmp-server enable traps ethernet cfm cc
snmp-server enable traps ethernet cfm crosscheck
ethernet cfm enable
ethernet cfm domain index 1 name md1 level 1 mip-creation explicit
ma index 1 name ma1 vlan 1 mip-creation explicit
exit
int eth 1/11
ethernet cfm port-enable
ethernet cfm mep mpid 4094 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 4094 ma index 1
oam remote 5 cfm enable
exit
4, dot1agConnectivityCheckLoopNotification
// 此trap为收到自己发出的ccm时发送, 但是因为RD在1528中加入安全规则,将source mac属于自己端口mac的数据包丢失掉,所以数据包无法进入CFM 状态机,无法发送此trap;
5, dot1agCrosscheckMEPUnknownNotification
//配置完成后即可收到 dot1agCrosscheckMEPUnknownNotification;
con
no span
no b g
int vl 1
ip add 192.168.1.17 255.0.0.0
exit
int e 1/1-26
no sw br
no sw mu
no sw un
no sw gvrp
exit
snmp-server host 192.168.1.8 public ver 2c
snmp-server enable traps ethernet cfm cc
snmp-server enable traps ethernet cfm crosscheck
ethernet cfm enable
ethernet cfm domain index 1 name md1 level 1 mip-creation explicit
ma index 1 name ma1 vlan 1 mip-creation explicit
mep crosscheck mpid 4094 ma ma1
exit
int eth 1/11
ethernet cfm port-enable
ethernet cfm mep mpid 2 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 1 ma index 1 up
oam remote 5 cfm enable
exit
6, dot1agCrosscheckMEPMissingNotification
// 配置完成后, 等待发出dot1agCfmMepUpNotification 和 dot1agCrosscheckMAUpNotification 后,拔掉CO和CPE间 VDSL port 11的线路, 即可看到 dot1agCrosscheckMEPMissingNotification和dot1agCfmMepDownNotification
con
no span
no b g
int vl 1
ip add 192.168.1.17 255.0.0.0
exit
int e 1/1-26
no sw br
no sw mu
no sw un
no sw gvrp
exit
snmp-server host 192.168.1.8 public ver 2c
snmp-server enable traps ethernet cfm cc
snmp-server enable traps ethernet cfm crosscheck
ethernet cfm enable
ethernet cfm domain index 1 name md1 level 1 mip-creation explicit
ma index 1 name ma1 vlan 1 mip-creation explicit
mep crosscheck mpid 4094 ma ma1
mep crosscheck mpid 4093 ma ma1
exit
int eth 1/11
ethernet cfm port-enable
ethernet cfm mep mpid 2 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 4094 ma index 1
oam remote 5 cfm enable
exit
int eth 1/12
ethernet cfm port-enable
ethernet cfm mep mpid 3 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 4093 ma index 1
oam remote 5 cfm enable
ex
7, dot1agCrosscheckMAUpNotification
//配置完成后即可收到 dot1agCfmMepUpNotification和dot1agCrosscheckMAUpNotification
con
no span
no b g
int vl 1
ip add 192.168.1.17 255.0.0.0
exit
int e 1/1-26
no sw br
no sw mu
no sw un
no sw gvrp
exit
snmp-server host 192.168.1.8 public ver 2c
snmp-server enable traps ethernet cfm cc
snmp-server enable traps ethernet cfm crosscheck
ethernet cfm enable
ethernet cfm domain index 1 name md1 level 1 mip-creation explicit
ma index 1 name ma1 vlan 1 mip-creation explicit
mep crosscheck mpid 4094 ma ma1
mep crosscheck mpid 4093 ma ma1
exit
int eth 1/11
ethernet cfm port-enable
ethernet cfm mep mpid 2 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 4094 ma index 1
oam remote 5 cfm enable
exit
int eth 1/12
ethernet cfm port-enable
ethernet cfm mep mpid 3 ma ma1
oam remote cfm enable
oam remote cfm domain index 1 name md1 level 1
oam remote cfm ma index 1 name ma1 md index 1 vlan 1 interval 4
oam remote 5 cfm mep mepid 4093 ma index 1
oam remote 5 cfm enable
ex
#########
ASV1528 's trap defintion,
Syntax Description
mep-up (option) Generates a trap when a new remote maintenance end point (MEP) has been discovered and learned by the device or when a change occurs in the port state of a previously discovered remote MEP.
mep-down (option) Generates a trap when a device has lost connectivity with a remote MEP or when connectivity from a previously learned remote MEP is restored after interruption.
config (option) Generates a trap when a CFM misconfiguration exists in the network
loop (option) Generates a trap when a forwarding loop exists in the network.
Syntax Description
mep-unknown
(Optional) Generates a trap when an unexpected (unconfigured) MEP comes up. One trap is generated per remote MEP.
mep-missing
(Optional) Generates a trap when the cross-check enable timer expires and no CCMs were received from an expected (configured) MEP. One trap is generated per remote MEP.
ma-up
(Optional) Generates a trap when all remote MEPs belonging to a MA come up.