距离向量路由算法matlab,距离向量路由算法

mr1311:配置端口安全性有很多方法。下面描述可在Cisco交换机上配置端口安全性的方法。|@||@|静态安全MAC地址:静态MAC地址是使用switchport port-security mac-address mac-address接口配置命令手动配置的。以此方法配置的MAC地址存储在地址表中,并添加到交换机的运行配置中。|@||@|动态安全MAC地址:动态MAC地址是动态获取的,并且仅存储在地址表中。以此方式配置的MAC地址在交换机重新启动时将被移除。|@||@|粘滞安全MAC地址:可以将端口配置为动态获得MAC地址,然后将这些MAC地址保存到运行配置中。|@||@|粘滞安全MAC地址有以下特性。|@||@|当使用switchport port-security mac-address sticky接口配置命令在接口上启用粘滞获取时,接口将所有动态安全MAC地址(包括那些在启用粘滞获取之前动态获得的MAC地址)转换为粘滞安全MAC地址,并将所有粘滞安全MAC地址添加到运行配置。|@||@|如果使用no switchport port-security mac-address sticky接口配置命令禁用粘滞获取,则粘滞安全MAC地址仍作为地址表的一部分,但是已从运行配置中移除。已经被删除的地址可以作为动态地址被重新配置和添加到地址表。|@||@|如果使用switchport port-security mac-address sticky mac-address接口配置命令配置粘滞安全MAC地址时,这些地址将添加到地址表和运行配置中。 如果禁用端口安全性,则粘滞安全MAC地址仍保留在运行配置中。|@||@|如果将粘滞安全MAC地址保存在配置文件中,则当交换机重新启动或者接口关闭时,接口不需要重新获取这些地址。如果不保存粘滞安全地址,则它们将丢失。如果粘滞获取被禁用,粘滞安全MAC地址则被转换为动态安全地址,并被从运行配置中删除。|@||@|如果禁用粘滞获取并输入switchport port-security mac-address sticky mac-address接口配置命令,则会出现错误消息,并且粘滞安全MAC地址不会添加到运行配置。|@||@|当出现以下任一情况时,则会发生安全违规。|@||@|地址表中添加了最大数量的安全MAC地址,有工作站试图访问接口,而该工作站的MAC地址未出现在该地址表中。|@||@|在一个安全接口上获取或配置的地址出现在同一个VLAN中的另一个安全接口上。|@||@|根据出现违规时要采取的操作,可以将接口配置为3种违规模式之一。|@||@|保护:当安全MAC地址的数量达到端口允许的限制时,带有未知源地址的数据包将被丢弃,直至移除足够数量的安全MAC地址或增加允许的最大地址数。不会得到发生安全违规的通知。|@||@|限制:当安全MAC地址的数量达到端口允许的限制时,带有未知源地址的数据包将被丢弃,直至您移除足够数量的安全MAC地址或增加允许的最大地址数。在此模式下,您会得到发生安全违规的通知。具体而言就是,将有SNMP陷阱发出、syslog消息记入日志,以及违规计数器的计数增加。|@||@|关闭:在此模式下,端口安全违规将造成接口立即变为错误禁用(error-disabled)状态,并关闭端口LED。该模式还会发送SNMP陷阱、将syslog消息记入日志,以及增加违规计数器的计数。当安全端口处于错误禁用状态时,先输入shutdown再输入no shutdown接口配置命令可使其脱离此状态。此模式为默认模式。|@||@|

Inputs: [AorV] Either A or V where A is a NxN adjacency matrix, where A(I,J) is nonzero if and only if an edge connects point I to point J NOTE: Works for both symmetric and asymmetric A V is a Nx2 (or Nx3) matrix of x,y,(z) coordinates [xyCorE] Either xy or C or E (or E3) where xy is a Nx2 (or Nx3) matrix of x,y,(z) coordinates (equivalent to V) NOTE: only valid with A as the first input C is a NxN cost (perhaps distance) matrix, where C(I,J) contains the value of the cost to move from point I to point J NOTE: only valid with A as the first input E is a Px2 matrix containing a list of edge connections NOTE: only valid with V as the first input E3 is a Px3 matrix containing a list of edge connections in the first two columns and edge weights in the third column NOTE: only valid with V as the first input [SID] (optional) 1xL vector of starting points. If unspecified, the algorithm will calculate the minimal path from all N points to the finish point(s) (automatically sets SID = 1:N) [FID] (optional) 1xM vector of finish points. If unspecified, the algorithm will calculate the minimal path from the starting point(s) to all N points (automatically sets FID = 1:N) Outputs: [costs] is an LxM matrix of minimum cost values for the minimal paths [paths] is an LxM cell containing the shortest path arrays [showWaitbar] (optional) a scalar logical that initializes a waitbar if nonzero Note: If the inputs are [A,xy] or [V,E], the cost is assumed to be (and is calculated as) the point to point Euclidean distance If the inputs are [A,C] or [V,E3], the cost is obtained from either the C matrix or from the edge weights in the 3rd column of E3 Example: % Calculate the (all pairs) shortest distances and paths using [A,C] inputs n = 7; A = zeros(n); xy = 10*rand(n,2) tri = delaunay(xy(:,1),xy(:,2)); I = tri(:); J = tri(:,[2 3 1]); J = J(:); IJ = I + n*(J-1); A(IJ) = 1 a = (1:n); b = a(ones(n,1),:); C = round(reshape(sqrt(sum((xy(b,:) - xy(b',:)).^2,2)),n,n)) [costs,paths] = dijkstra(A,C) Example: % Calculate the shortest distance and path from point 3 to 5 n = 15; A = zeros(n); xy = 10*rand(n,2) tri = delaunay(xy(:,1),xy(:,2)); I = tri(:); J = tri(:,[2 3 1]); J = J(:); IJ = I + n*(J-1); A(IJ) = 1 [cost,path] = dijkstra(A,xy,3,5) gplot(A,xy,'b.:'); hold on; plot(xy(path,1),xy(path,2),'ro-','LineWidth',2) for k = 1:n, text(xy(k,1),xy(k,2),[' ' num2str(k)],'Color','k'); end Example: % Calculate the shortest distances and paths from the 3rd point to all the rest n = 7; V = 10*rand(n,2) I = delaunay(V(:,1),V(:,2)); J = I(:,[2 3 1]); E = [I(:) J(:)] [costs,paths] = dijkstra(V,E,3) Example: % Calculate the shortest distance and path from points [1 3 4] to [2 3 5 7] n = 7; V = 10*rand(n,2) I = delaunay(V(:,1),V(:,2)); J = I(:,[2 3 1]); E = [I(:) J(:)] [costs,paths] = dijkstra(V,E,[1 3 4],[2 3 5 7]) Revision Notes: (3/13/15) Previously, this code ignored edges that have a cost of zero, potentially producing an incorrect result when such a condition exists. I have solved this issue by using NaNs in the table rather than a sparse matrix of zeros.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值