ISIS——LSP刷新情况

本文介绍了IS-IS路由域内路由器产生的LSP及触发LSP更新的事件,包括邻居状态变化、接口状态变化、引入的IP路由变化等,并说明了LSP的周期性更新机制。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


IS-IS路由域内的所有路由器都会产生LSP,以下事件会触发一个新的LSP:

  • 邻居Up或Down

  • IS-IS相关接口Up或Down

  • 引入的IP路由发生变化

  • 区域间的IP路由发生变化

  • 接口被赋了新的metric值

  • 周期性更新 :LSP的刷新间隔为15分钟;老化时间为20分钟。但是一条LSP的老化除了要等
    待20分钟外,还要等待60秒的零老化时延;LSP重传时间为5秒。

### ISIS 协议中 LSP 的扩散时间 在 IS-IS 中,当一台路由器接收到新的或更新后的链路状态数据包(LSP),会立即将其加入到本地的链路状态数据库(LSDB)并标记为待泛洪[^1]。随后,该路由器会在一定时间内向邻近节点发送这些变化的信息。 具体而言,在将新接收的 LSP 合入到自己的 LSDB 数据库之后,IS-IS 使用一个定时器来控制何时以及如何传播这个最新的拓扑变更信息给其他邻居节点。通常情况下,这一过程几乎是即时发生的;然而为了避免网络震荡和不必要的带宽消耗,实际操作中有最小间隔时间和最大生存期的概念: - **最小间隔时间**:为了防止短时间内频繁更新造成过多流量,规定了两次连续泛洪之间最短的时间间隔。 - **最大生存期**:指定了每条 LSP 在网络传播过程中允许存在的最长时限,超过此期限则会被认为过期而不再转发。 此外,对于某些特定条件下的快速收敛机制,比如检测到直连链路失效时,可能会触发立即重传而不是等待常规计时结束[^2]。 ```python import time def flood_lsp(lsp, min_interval=0.5, max_age=900): """ Simulate flooding an updated Link State PDU with timing constraints. :param lsp: The new or refreshed Link State Protocol Data Unit to be flooded. :param min_interval: Minimum interval between consecutive floods (in seconds). :param max_age: Maximum age of the LSP before it is considered expired and removed from LSDB. """ current_time = time.time() # Check if enough time has passed since last flood if not hasattr(flood_lsp, "last_flood") or (current_time - flood_lsp.last_flood >= min_interval): print("Flooding updated LSP:", lsp) # Record when this function was called successfully flood_lsp.last_flood = current_time # Schedule removal after reaching maximum age cleanup_timer = threading.Timer(max_age, remove_expired_lsp, args=[lsp]) cleanup_timer.start() def remove_expired_lsp(lsp): """Remove expired LSPs from the database.""" print("Removing expired LSP:", lsp) # Example usage demonstrating immediate vs scheduled behavior based on conditions flood_lsp('New_LSP') # Immediate action due to first-time invocation time.sleep(0.3) # Wait less than minimum interval flood_lsp('Another_New_LSP') # This will wait until at least 'min_interval' has elapsed ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值