CREATE TABLE hostnames (
hostname varchar(255),
ip int unsigned,
PRIMARY KEY (hostname)
) PACK_KEYS=1;
--
-- Table of flows tables
--
CREATE TABLE flow_tables (
table_name varchar(64), -- name of the table
src_ip int unsigned, -- IP source address
slice varchar(32), -- slice that sent these flows
start_time datetime, -- start time of the earliest flow in the table
end_time datetime, -- end time of the latest flow in the table
flows int unsigned, -- total number of flows in this table
packets bigint unsigned, -- total number of packets sent in all flows in this table
bytes bigint unsigned, -- total number of bytes sent in all flows in this table
INDEX (src_ip),
INDEX (slice),
PRIMARY KEY (table_name)
) PACK_KEYS=1;
--
-- Template for a flows table
--
CREATE TABLE flow_template (
protocol tinyint unsigned, -- IP protocol
src_port smallint unsigned, -- IP source port
dst_ip int unsigned, -- IP destination address
dst_port smallint unsigned, -- IP destination port
start_time datetime, -- start time of the earliest packet in the flow
end_time datetime, -- end time of the latest packet in the flow
packets bigint unsigned, -- number of packets sent in this flow
bytes bigint unsigned, -- number of bytes sent in this flow
INDEX (dst_ip),
PRIMARY KEY (protocol, src_port, dst_ip, dst_port)
) PACK_KEYS=1;