简体   繁体   English

路由表的关系数据库设计

[英]relational database design for a routing table

I am trying to build relational database to store IPv4 routing table (unicast for now). 我正在尝试建立关系数据库来存储IPv4路由表(目前为单播)。 Can anyone suggest how do I go about doing that following best practices? 有人可以建议我按照最佳做法去做吗?

Requirements: This database will store routing table for multiple routers/devices (1000+) 要求:该数据库将存储多个路由器/设备(1000台以上)的路由表

I am thinking this... 我在想这个...

  1. have a routers table that stores only routerid, hostname, etc. 有一个只存储routerid,主机名等的routers表。
  2. have a interfaces table that stores only interface names (along with interfaceid) for each routerid 有一个接口表,该表仅存储每个routerid的接口名称(以及interfaceid)
  3. have a routingTable table that stores columns: IP prefix (subnet/route with mask); 有一个routingTable表,该表存储列:IP前缀(带掩码的子网/路由); router (as routerid); 路由器(作为routerid); outgoing interfaces as list of intefaceids (in case of load balancing) 传出接口作为接口列表(在负载平衡的情况下)

My question is basically, how do I store the outgoing interfaces - as a list or multiple tables? 我的问题基本上是,如何存储传出接口-作为一个列表还是多个表?

Similar concept applies to multicast routing table too. 类似的概念也适用于多播路由表。

I think i might have figured it out myself. 我想我可能自己想通了。 I realized that storing the outgoing interface ids (aka OIL, outgoing interface List) in a list is not the best way, instead I would store the OIL in a table as oil_id, route_id, out_interface_id (which route_id, out_interface_id as unique) and assuming that out_interface_id is globally unique 我意识到将传出接口ID(又名OIL,传出接口列表)存储在列表中不是最好的方法,相反,我会将OIL存储在表中为oil_id,route_id,out_interface_id(其中route_id,out_interface_id为唯一),并假设那out_interface_id是全局唯一的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM