Class BmpPeer

  • All Implemented Interfaces:
    IPacket

    public class BmpPeer
    extends BasePacket
    The per-peer header follows the common header for most BMP messages. The rest of the data in a BMP message is dependent on the Message Type field in the common header.

    Peer Type (1 byte): Identifies the type of peer. Currently, three types of peers are identified:

    * Peer Type = 0: Global Instance Peer * Peer Type = 1: RD Instance Peer * Peer Type = 2: Local Instance Peer

    o Peer Flags (1 byte): These flags provide more information about the peer. The flags are defined as follows:

    0 1 2 3 4 5 6 7 +-+-+-+-+-+-+-+-+ |V|L|A| Reserved| +-+-+-+-+-+-+-+-+

    * The V flag indicates that the Peer address is an IPv6 address. For IPv4 peers, this is set to 0.

    The L flag, if set to 1, indicates that the message reflects the post-policy Adj-RIB-In (i.e., its path attributes reflect the application of inbound policy). It is set to 0 if the message reflects the pre-policy Adj-RIB-In. Locally sourced routes also carry an L flag of 1. See Section 5 for further detail. This flag has no significance when used with route mirroring messages.

    * The A flag, if set to 1, indicates that the message is formatted using the legacy 2-byte AS_PATH format. If set to 0, the message is formatted using the 4-byte AS_PATH format [RFC6793]. A BMP speaker MAY choose to propagate the AS_PATH information as received from its peer, or it MAY choose to reformat all AS_PATH information into a 4-byte format regardless of how it was received from the peer. In the latter case, AS4_PATH or AS4_AGGREGATOR path attributes SHOULD NOT be sent in the BMP UPDATE message. This flag has no significance when used with route mirroring messages.

    The remaining bits are reserved for future use. They MUST be transmitted as 0 and their values MUST be ignored on receipt.

    Peer Distinguisher (8 bytes): Routers today can have multiple instances (example: Layer 3 Virtual Private Networks (L3VPNs) [RFC4364]). This field is present to distinguish peers that belong to one address domain from the other.

    If the peer is a "Global Instance Peer", this field is zero- filled. If the peer is a "RD Instance Peer", it is set to the route distinguisher of the particular instance the peer belongs to. If the peer is a "Local Instance Peer", it is set to a unique, locally defined value. In all cases, the effect is that the combination of the Peer Type and Peer Distinguisher is sufficient to disambiguate peers for which other identifying information might overlap.

    Peer Address: The remote IP address associated with the TCP session over which the encapsulated PDU was received. It is 4 bytes long if an IPv4 address is carried in this field (with the 12 most significant bytes zero-filled) and 16 bytes long if an IPv6 address is carried in this field.

    Peer AS: The Autonomous System number of the peer from which the encapsulated PDU was received. If a 16-bit AS number is stored in this field [RFC6793], it should be padded with zeroes in the 16 most significant bits.

    Timestamp: The time when the encapsulated routes were received (one may also think of this as the time when they were installed in the Adj-RIB-In), expressed in seconds and microseconds since midnight (zero hour), January 1, 1970 (UTC). If zero, the time is unavailable. Precision of the timestamp is implementation- dependent.

    4.3. Initiation Message

    The initiation message provides a means for the monitored router to inform the monitoring station of its vendor, software version, and so on. An initiation message MUST be sent as the first message after the TCP session comes up. An initiation message MAY be sent at any point thereafter, if warranted by a change on the monitored router.

    The initiation message consists of the common BMP header followed by two or more Information TLVs containing information about the monitored router. The sysDescr and sysName Information TLVs MUST be sent, any others are optional. The string TLV MAY be included multiple times.

    • Field Detail

      • PEER_HEADER_MINIMUM_LENGTH

        public static final short PEER_HEADER_MINIMUM_LENGTH
        See Also:
        Constant Field Values
      • type

        protected byte type
      • flags

        protected byte flags
      • peerDistinguisher

        protected byte[] peerDistinguisher
      • peerAs

        protected int peerAs
      • peerBgpId

        protected int peerBgpId
      • seconds

        protected int seconds
      • microseconds

        protected int microseconds
    • Constructor Detail

      • BmpPeer

        public BmpPeer()
    • Method Detail

      • getType

        public byte getType()
        Returns Peer Type.
        Returns:
        the peer type
      • getFlag

        public byte getFlag()
        Returns Peer Flag.
        Returns:
        the peer flag
      • getPeerDistinguisher

        public byte[] getPeerDistinguisher()
        Returns Peer Distinguisher.
        Returns:
        the peer distingusiher
      • getIntAddress

        public InetAddress getIntAddress()
        Returns Peer IP Address.
        Returns:
        the peer ip address
      • getPeerAs

        public int getPeerAs()
        Returns Peer Autonomous System number.
        Returns:
        the peer AS number
      • getPeerBgpId

        public int getPeerBgpId()
        Returns Peer Bgp Id.
        Returns:
        the bgp id
      • getSeconds

        public int getSeconds()
        Returns timestamp in sec.
        Returns:
        the timestamp in sec
      • getMicroseconds

        public int getMicroseconds()
        Returns timestamp in micro second.
        Returns:
        the timestamp in micro second
      • serialize

        public byte[] serialize()
        Description copied from interface: IPacket
        Sets all payloads parent packet if applicable, then serializes this packet and all payloads.
        Returns:
        a byte[] containing this packet and payloads