资源描述
NPMS系统体系结构、功能及接口
一、 系统功能定义
1、 接收V5格式的NetFlow。
2、 接收V7格式的NetFlow。
3、 接收V8格式的NetFlow。
4、 接收V9格式的NetFlow。
5、 对NetFlow的处理能力不低于10,000条/秒。
6、 能基于源IP地址、目的IP地址、源端口号、目的端口号、协议类型等条件对接收到的NetFlow流过滤。
7、 将过滤(或不过滤)后的NetFlow流,写入二进制文件。
8、 支持zlib压缩。
9、 写入的文件长度可以按时间或大小来选择。
10、 文件名能按照某种规则命名。
11、 后台多进程方式运行。
12、 自适应、健壮性。自适应一方面是指当网络设备发出的NetFlow流的速率超过设定值,则采取定时采样方式来接收NetFlow流,并将相关信息写入日志文件,以保证设备正常运行;另一方面是指系统能根据网络资源情况能动态地启动不同数量的子进程来工作。健壮性是指当启动的多个写入文件进程中的某个进程,由于各种原因成为僵死进程时,其父进程应及时将其杀死,以保证系统的健壮性。
13、 日志。日志内容包括系统开关机时间,异常情况记录。
14、 对自身服务器资源的监控。其内容包括CPU、内存、I/O等。
15、 支持转发功能。
16、 能接收多个网络设备发送的NetFlow。
工具软件功能定义:
1、特定要求发送特定类型的NetFlow流。
2、模拟DDOS攻击。
3、查看NetFlow流文件内容。
二、 系统体系结构
1、 硬件体系结构
2、 软件体系结构
FlowCollecter体系结构-1
设计说明:
1、 FlowCollecter分成4大部分:Manager、FlowWriteFile、FlowWriteDB,FlowRedirect。
2、 Manager处于该模块的总控部分。功能定义如下:
(1)、负责接受网络设备或探针RTProbe以UDP方式发送来的NetFlow数据包。
(2)、创建消息队列MQ。
(3)、fork多个子进程,在每一个子进程中执行FlowWriteFile。
(4)、创建共享内存ShMem,并将简单的NetFlow信息或统计信息存放在ShMem中。这里简单的定义是做这些工作对Manager的影响不大。
(5)、根据配置文件中的过滤规则,实现对NetFlow的过滤。过滤规则,可以基于源IP地址、目的IP地址、源端口号、目的端口号、协议类型等。
(6)、采用心跳(heartbeat)机制实现对子进程FlowWirteFile的监管。即当子进程没有在规定的时间(应定义为多少?),向定义的端口(1212)发送“子进程标识”信息,就认为该子进程为僵死进程,父进程监控该端口,然后杀死该子进程。
3、 FlowWirteFile处于该模块的第二部分。功能定义如下:
(1)、从Manager创建的消息队列中取出NetFlow数据。
(2)、拆分NetFlow包。
(3)、打包。将NetFlow数据按照我们自定义的协议格式xFlow,重新打包。
注:拆包和打包的任务也可以考虑在Manager部分完成。
(4)、写入文件。将xFlow写入文件。注:应考虑文件格式(二进制文件,类似RRD循环文件格式等)。
(5)、实现zlib压缩功能。
(6)、能按照命名规则自动取文件名。
(7)、能按照接收流的时间或文件长度规则,自动截取文件长度。也就是说NetFlow流文件不会是一个文件,而是一系列文件的集合。
4、 FlowWriteDB处于该模块的第三部分。功能定义如下:
(1)、从FlowFile文件中读取NetFlow数据。
(2)、写入到PostgreSQL数据库。
5、 FlowRedirect处于该模块的第四部分。功能定义如下:
(1)、从FlowFile文件中读NetFlow数据。
(2)、将NetFlow数据以UDP的方式转发到某台主机。
FlowCollecter体系结构-2:
设计说明:
1、 FlowCollecter分成3大部分:Manager、FlowWriteFile、FlowWriteDB。
2、 Manager处于该模块的总控部分。功能定义如下:
(1)、负责接受网络设备或探针RTProbe以UDP方式发送来的NetFlow数据包。
(2)、创建消息队列n个有名管道。
(3)、fork多个子进程,在每一个子进程中执行FlowWriteFile。
(4)、创建共享内存ShMem,并将简单的NetFlow信息或统计信息存放在ShMem中。这里简单的定义是做这些工作对Manager的影响不大。
(5)、根据配置文件中的过滤规则,实现对NetFlow的过滤。过滤规则,可以基于源IP地址、目的IP地址、源端口号、目的端口号、协议类型等。
(6)、采用心跳(heartbeat)机制实现对子进程FlowWirteFile的监管。即当子进程没有在规定的时间(应定义为多少?),向定义的端口(1212)发送“子进程标识”信息,就认为该子进程为僵死进程,父进程监控该端口,然后杀死该子进程。
3、 FlowWirteFile处于该模块的第二部分。功能定义如下:
(1)、从Manager创建的管道中取出NetFlow数据。
(2)、拆分NetFlow包。
(3)、打包。将NetFlow数据按照我们自定义的协议格式xFlow,重新打包。
注:拆包和打包的任务也可以考虑在Manager部分完成。
(4)、写入文件。将xFlow写入文件。注:应考虑文件格式(二进制文件,类似RRD循环文件格式等)。
(5)、实现zlib压缩功能。
(6)、能按照命名规则自动取文件名。
(7)、能按照接收流的时间或文件长度规则,自动截取文件长度。也就是说NetFlow流文件不会是一个文件,而是一系列文件的集合。
4、 FlowWriteDB处于该模块的第三部分。功能定义如下:
(1)、从FlowFile文件中读取NetFlow数据。
(2)、写入到PostgreSQL数据库。
5、 FlowRedirect处于该模块的第四部分。功能定义如下:
(1)、从FlowFile文件中读NetFlow数据。
(2)、将NetFlow数据以UDP的方式转发到某台主机。
三、 系统接口定义
1、 Manager部分接口定义:
(1)、NetFlow V5格式
V5头格式(24个字节)
字节
内容
英文描述
中文描述
0 ~ 1
version
NetFlow export format version number
NetFlow导出格式的版本号
2 ~ 3
count
Number of flows export in this packet (1 ~ 30)
包中导出的流数目(1~30)
4 ~ 7
SysUptime
Current time in milliseconds since the export device booted
从路由器启动以来的当前时间,以毫秒为单位
8 ~ 11
unix_secs
Current count of seconds since 0000 UTC 1970
从0000UTC1970开始的秒数
12~ 15
unix_nsecs
Residual nanoseconds since 0000 UTC 1970
从0000UTC1970开始的剩余纳秒时间
16~19
flow_sequence
Sequence counter of total flows seen
所有能看到的流的顺序计数器
20
engine_type
Type of flow-switching engine
Flow交换设备的类型
21
engine_id
Slot number of the flow-switching engine
Flow交换设备的插槽号
22~23
reserved
reserved
未使用的字节
V5记录格式 (48个字节)
字节
内容
英文描述
中文描述
0 ~ 3
srcaddr
Source IP address
源IP地址
4 ~ 7
dstaddr
Destination IP address
目的IP地址
8 ~ 11
nexthop
IP address of next hop router
下一跳的路由器IP地址
12 ~ 13
input
SNMP index of input interface
接入接口的SNMP索引
14 ~ 15
output
SNMP index of output interface
输出接口的SNMP索引
16 ~ 19
dPkts
Packets in the flow
流中的报文
20 ~ 23
dOctets
Total number of layer 3 bytes in the packets of the flow
在流的报文中第3层字节总数
24 ~ 27
First
SysUptime at start of flow
流开始处的SysUptime
28 ~31
Last
SysUptime at the time the last packet of the flow was received
流中最后一个报文被接收时的SysUptime
32 ~ 33
srcport
TCP/UDP source port number or equivalent
TCP/UDP源端口号或等价值
34 ~ 35
dstport
TCP/UDP destination port number or equivalent
TCP/UDP目的端口号或等价值
36
pad1
Unused(zero)bytes
没有使用的字节
37
tcp_flags
Cumulative OR of TCP flags
TCP标记的累积OR
38
prot
IP protocol type (for example, TCP = 6; UDP = 17)
IP协议(例如, TCP=6, UDP=17)
39
tos
IP type of service (ToS)
服务的IP类型
40 ~ 41
src_as
Autonomous system number of the source, either origin or peer
源的AS,原来的或对等的
42 ~ 43
dst_as
Autonomous system number of the destination, either of peer
目的AS,原来的或对等的
44
src_mask
Source address prefix mask bits
源地址前缀的掩码位
45
dst_mask
Destination address prefix mask bits
目的地址前缀的掩码位
46 ~ 48
pad2
Unused (zero) bytes
未使用的字节
(2)、NetFlow V7格式(Catalyst 5000)
V7头格式(24个字节)
字节
内容
英文描述
中文描述
0 ~ 1
version
NetFlow export format version number
NetFlow导出格式的版本号
2 ~ 3
count
Number of flows export in this packet (1 ~ 30)
包中导出的流数目(1~30)
4 ~ 7
SysUptime
Current time in milliseconds since the export device booted
从路由器启动以来的当前时间,以毫秒为单位
8 ~ 11
unix_secs
Current count of seconds since 0000 UTC 1970
从0000UTC1970开始的秒数
12~ 15
unix_nsecs
Residual nanoseconds since 0000 UTC 1970
从0000UTC1970开始的剩余纳秒时间
16~19
flow_sequence
Sequence counter of total flows seen
所有能看到的流的顺序计数器
20
engine_type
Type of flow-switching engine
Flow交换设备的类型
21
engine_id
Slot number of the flow-switching engine
Flow交换设备的插槽号
22~23
reserved
reserved
未使用的字节
V7记录格式 (52个字节)
字节
内容
英文描述
中文描述
0 ~ 3
srcaddr
Source IP address
源IP地址
4 ~ 7
dstaddr
Destination IP address
目的IP地址
8 ~ 11
nexthop
IP address of next hop router
下一跳的路由器IP地址
12 ~ 13
input
SNMP index of input interface
接入接口的SNMP索引
14 ~ 15
output
SNMP index of output interface
输出接口的SNMP索引
16 ~ 19
dPkts
Packets in the flow
流中的报文
20 ~ 23
dOctets
Total number of layer 3 bytes in the packets of the flow
在流的报文中第3层字节总数
24 ~ 27
First
SysUptime at start of flow
流开始处的SysUptime
28 ~31
Last
SysUptime at the time the last packet of the flow was received
流中最后一个报文被接收时的SysUptime
32 ~ 33
srcport
TCP/UDP source port number or equivalent
TCP/UDP源端口号或等价值
34 ~ 35
dstport
TCP/UDP destination port number or equivalent
TCP/UDP目的端口号或等价值
36
flags
Flags indicating, among other things, what flow fields are invalid.
37
tcp_flags
TCP flags; always set to zero
TCP标志
38
prot
IP protocol type (for example, TCP = 6; UDP = 17)
IP协议(例如, TCP=6, UDP=17)
39
tos
IP type of service (ToS)
服务的IP类型
40 ~ 41
src_as
Autonomous system number of the source, either origin or peer
源的AS,原来的或对等的
42 ~ 43
dst_as
Autonomous system number of the destination, either of peer
目的AS,原来的或对等的
44
src_mask
Source address prefix mask bits
源地址前缀的掩码位
45
dst_mask
Destination address prefix mask bits
目的地址前缀的掩码位
46 ~ 47
flags
Flags indicating, among other things, what flow fields are invalid.
48 ~ 51
router_sc
IP address of the router that is bypassed by the Catalyst 5000 series switch. This is the same address the router uses when it sends NetFlow export packets. This IP address is propagated to all switches bypassing the router through the FCP protocal
2、 FlowWriteFile部分接口定义:
3、 FlowWriteDB部分接口定义:
4、 FlowRedirect部分接口定义:
展开阅读全文