Skip to content

Commit

Permalink
* Introducing support for BGP Large Communities (7)
Browse files Browse the repository at this point in the history
  • Loading branch information
paololucente committed Oct 16, 2016
1 parent d5aa92d commit 514c44e
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 21 deletions.
42 changes: 25 additions & 17 deletions CONFIG-KEYS
Expand Up @@ -46,14 +46,14 @@ KEY: aggregate (-c)
VALUES: [ src_mac, dst_mac, vlan, cos, etype, src_host, dst_host, src_net, dst_net,
src_mask, dst_mask, src_as, dst_as, src_port, dst_port, tos, proto, none,
sum_mac, sum_host, sum_net, sum_as, sum_port, flows, tag, tag2, label,
class, tcpflags, in_iface, out_iface, std_comm, ext_comm, as_path,
peer_src_ip, peer_dst_ip, peer_src_as, peer_dst_as, local_pref, med,
src_std_comm, src_ext_comm, src_as_path, src_local_pref, src_med, mpls_vpn_rd,
mpls_label_top, mpls_label_bottom, mpls_stack_depth, sampling_rate,
src_host_country, dst_host_country, pkt_len_distrib, nat_event, fw_event,
post_nat_src_host, post_nat_dst_host, post_nat_src_port, post_nat_dst_port,
timestamp_start, timestamp_end, timestamp_arrival, export_proto_seqno,
export_proto_version ]
class, tcpflags, in_iface, out_iface, std_comm, ext_comm, lrg_comm,
as_path, peer_src_ip, peer_dst_ip, peer_src_as, peer_dst_as, local_pref,
med, src_std_comm, src_ext_comm, src_lrg_comm, src_as_path, src_local_pref,
src_med, mpls_vpn_rd, mpls_label_top, mpls_label_bottom, mpls_stack_depth,
sampling_rate, src_host_country, dst_host_country, pkt_len_distrib, nat_event,
fw_event, post_nat_src_host, post_nat_dst_host, post_nat_src_port,
post_nat_dst_port, timestamp_start, timestamp_end, timestamp_arrival,
export_proto_seqno, export_proto_version ]
FOREWORDS: Individual IP packets are uniquely identified by their header field values (a
rather large set of primitives!). Same applies to uni-directional IP flows, as
they have at least enough information to discriminate where packets are coming
Expand Down Expand Up @@ -84,15 +84,16 @@ NOTES: * Some primitives (ie. tag2, timestamp_start, timestamp_end) are not par
enabled this field will report a value of one (1); otherwise it will report
the rate that is passed by the protocol or sampling_map. A value of zero (0)
means 'unknown' and hence no rate is applied to original counter values.
* src_std_comm, src_ext_comm, src_as_path are based on reverse BGP lookups;
peer_src_as, src_local_pref and src_med are by default based on reverse BGP
lookups but can be alternatively based on other methods, for example maps
(ie. bgp_peer_src_as_type). Internet traffic is by nature asymmetric hence
reverse BGP lookups must be used with caution (ie. against own prefixes).
* Communities (ie. std_comm, ext_comm) and AS-PATHs (ie. as_path) are fixed
size (96 and 128 chars respectively at time of writing). Directives like
bgp_stdcomm_pattern and bgp_aspath_radius are aimed to keep length of these
strings under control but sometimes this is not enough. While the longer
* src_std_comm, src_ext_comm, src_lrg_comm, src_as_path are based on reverse
BGP lookups; peer_src_as, src_local_pref and src_med are by default based on
reverse BGP lookups but can be alternatively based on other methods, for
example maps (ie. bgp_peer_src_as_type). Internet traffic is by nature
asymmetric hence reverse BGP lookups must be used with caution (ie. against
own prefixes).
* Communities (ie. std_comm, ext_comm, lrg_comm) and AS-PATHs (ie. as_path)
are fixed size (96 and 128 chars respectively at time of writing). Directives
like bgp_stdcomm_pattern and bgp_aspath_radius are aimed to keep length of
these strings under control but sometimes this is not enough. While the longer
term approach will be to define these primitives as varchar, the short-term
approach is to re-define default size, ie. MAX_BGP_STD_COMMS MAX_BGP_ASPATH
in network.h, to the desired size (blowing extra memory). This will require
Expand Down Expand Up @@ -2069,6 +2070,13 @@ DESC: Defines the method to use to map incoming traffic to a set of ex
which is often not the case, affecting their accuracy.
DEFAULT: none

KEY: bgp_src_lrg_comm_type [GLOBAL]
VALUES: [ bgp ]
DESC: Defines the method to use to map incoming traffic to a set of large communities. Only
native BGP RIB lookups are currently supported. BGP lookups assume traffic is symmetric,
which is often not the case, affecting their accuracy.
DEFAULT: none

KEY: bgp_src_as_path_type [GLOBAL]
VALUES: [ bgp ]
DESC: Defines the method to use to map incoming traffic to an AS-PATH. Only native BGP RIB lookups
Expand Down
7 changes: 4 additions & 3 deletions QUICKSTART
Expand Up @@ -1078,10 +1078,11 @@ NOTES:
(or egress sFlow) as it mainly relies on either the input interface index
(ifIndex), the source MAC address, a reverse BGP next-hop lookup or a combination
of these.
* "Source" MED, local preference, communities and AS-PATH have all been dedicated an
* "Source" MED, local preference, communities and AS-PATH have all been allocated
aggregation primitives. Each carries its own peculiarities but the general concepts
highlighed in this paragraph apply to these aswell. Check CONFIG-KEYS out for the
src_[med|local_pref|as_path|std_comm|ext_comm]_[type|map] configuration directives.
highlighed in this chapter apply to these aswell. Check CONFIG-KEYS out for the
src_[med|local_pref|as_path|std_comm|ext_comm|lrg_comm]_[type|map] configuration
directives.

XIVc. Tracking entities on the own IP address space
It might happen that not all entities attached to the service provider network are
Expand Down
2 changes: 2 additions & 0 deletions sql/README.mysql
Expand Up @@ -73,11 +73,13 @@ Similarly, BGP tables:
* mpls_vpn_rd => mpls_vpn_rd (CHAR(18) NOT NULL)
* std_comm => comms (CHAR(24) NOT NULL)
* ext_comm => ecomms (CHAR(24) NOT NULL)
* lrg_comm => lcomms (CHAR(24) NOT NULL)
* as_path => as_path (CHAR(21) NOT NULL)
* local_pref => local_pref (INT(4) UNSIGNED NOT NULL)
* med => med (INT(4) UNSIGNED NOT NULL)
* src_std_comm => comms_src (CHAR(24) NOT NULL)
* src_ext_comm => ecomms_src (CHAR(24) NOT NULL)
* src_lrg_comm => lcomms_src (CHAR(24) NOT NULL)
* src_as_path => as_path_src (CHAR(21) NOT NULL)
* src_local_pref => local_pref_src (INT(4) UNSIGNED NOT NULL)
* src_med => med_src (INT(4) UNSIGNED NOT NULL)
Expand Down
2 changes: 2 additions & 0 deletions sql/README.pgsql
Expand Up @@ -82,11 +82,13 @@ CHAR fields because making use of IP prefix labels, transparently to pmacct.
* mpls_vpn_rd => mpls_vpn_rd (CHAR(18) NOT NULL DEFAULT ' ')
* std_comm => comms (CHAR(24) NOT NULL DEFAULT ' ')
* ext_comm => ecomms (CHAR(24) NOT NULL DEFAULT ' ')
* lrg_comm => lcomms (CHAR(24) NOT NULL DEFAULT ' ')
* as_path => as_path (CHAR(21) NOT NULL DEFAULT ' ')
* local_pref => local_pref (BIGINT NOT NULL DEFAULT 0)
* med => med (BIGINT NOT NULL DEFAULT 0)
* src_std_comm => comms_src (CHAR(24) NOT NULL DEFAULT ' ')
* src_ext_comm => ecomms_src (CHAR(24) NOT NULL DEFAULT ' ')
* src_lrg_comm => lcomms_src (CHAR(24) NOT NULL DEFAULT ' ')
* src_as_path => as_path_src (CHAR(21) NOT NULL DEFAULT ' ')
* src_local_pref => local_pref_src (BIGINT NOT NULL DEFAULT 0)
* src_med => med_src (BIGINT NOT NULL DEFAULT 0)
Expand Down
2 changes: 2 additions & 0 deletions sql/README.sqlite3
Expand Up @@ -74,11 +74,13 @@ Similarly, BGP tables:
* mpls_vpn_rd => mpls_vpn_rd (CHAR(18) NOT NULL DEFAULT ' ')
* std_comm => comms (CHAR(24) NOT NULL DEFAULT ' ')
* ext_comm => ecomms (CHAR(24) NOT NULL DEFAULT ' ')
* lrg_comm => lcomms (CHAR(24) NOT NULL DEFAULT ' ')
* as_path => as_path (CHAR(21) NOT NULL DEFAULT ' ')
* local_pref => local_pref (INT(8) NOT NULL DEFAULT 0)
* med => med (INT(8) NOT NULL DEFAULT 0)
* src_std_comm => comms_src (CHAR(24) NOT NULL DEFAULT ' ')
* src_ext_comm => ecomms_src (CHAR(24) NOT NULL DEFAULT ' ')
* src_lrg_comm => lcomms_src (CHAR(24) NOT NULL DEFAULT ' ')
* src_as_path => as_path_src (CHAR(21) NOT NULL DEFAULT ' ')
* src_local_pref => local_pref_src (INT(8) NOT NULL DEFAULT 0)
* src_med => med_src (INT(8) NOT NULL DEFAULT 0)
Expand Down
2 changes: 1 addition & 1 deletion src/pmacct-build.h
@@ -1 +1 @@
#define PMACCT_BUILD "20161015-01"
#define PMACCT_BUILD "20161016-00"

0 comments on commit 514c44e

Please sign in to comment.