diff options
author | Pradosh Mohapatra <pmohapat@cumulusnetworks.com> | 2014-01-15 06:57:57 +0000 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2014-06-03 15:08:32 +0200 |
commit | 8c71e481dae11b7ae3f1ef561a989624b2ae84b6 (patch) | |
tree | 4c13b76e1b9aedc45ad9b086be972ba4999ada03 /bgpd/bgpd.h | |
parent | 2c13299a05e5544a5e79c2a970256a21f488a3fa (diff) | |
download | quagga-8c71e481dae11b7ae3f1ef561a989624b2ae84b6.tar.bz2 quagga-8c71e481dae11b7ae3f1ef561a989624b2ae84b6.tar.xz |
bgpd: efficient NLRI packing for AFs != ipv4-unicast
ISSUE:
Currently, for non-ipv4-unicast address families where prefixes are
encoded in MP_REACH/MP_UNREACH attributes, BGP ends up sending one
prefix per UPDATE message. This is quite inefficient. The patch
addresses the issue.
PATCH:
We introduce a scratch buffer in the peer structure that stores the
MP_REACH/MP_UNREACH attributes for non-ipv4-unicast families. This
enables us to encode multiple prefixes. In the end, the two buffers
are merged to create the UPDATE packet.
Signed-off-by: Pradosh Mohapatra <pmohapat@cumulusnetworks.com>
Reviewed-by: Daniel Walton <dwalton@cumulusnetworks.com>
[DL: removed no longer existing bgp_packet_withdraw prototype]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'bgpd/bgpd.h')
-rw-r--r-- | bgpd/bgpd.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index 3d516d35..688f459f 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -313,6 +313,12 @@ struct peer struct stream_fifo *obuf; struct stream *work; + /* We use a separate stream to encode MP_REACH_NLRI for efficient + * NLRI packing. peer->work stores all the other attributes. The + * actual packet is then constructed by concatenating the two. + */ + struct stream *scratch; + /* Status of the peer. */ int status; int ostatus; |