GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  NET::BGP::UPDATE (3)

.ds Aq ’

NAME

Net::BGP::Update - Class encapsulating BGP-4 UPDATE message

CONTENTS

SYNOPSIS



    use Net::BGP::Update qw( :origin );

    # Constructor
    $update = Net::BGP::Update->new(
        NLRI            => [ qw( 10/8 172.168/16 ) ],
        Withdraw        => [ qw( 192.168.1/24 172.10/16 192.168.2.1/32 ) ],
        # For Net::BGP::NLRI
        Aggregator      => [ 64512, 10.0.0.1 ],
        AsPath          => [ 64512, 64513, 64514 ],
        AtomicAggregate => 1,
        Communities     => [ qw( 64512:10000 64512:10001 ) ],
        LocalPref       => 100,
        MED             => 200,
        NextHop         => 10.0.0.1,
        Origin          => INCOMPLETE,
    );

    # Construction from a NLRI object:
    $nlri = Net::BGP::NLRI->new( ... );
    $update = Net::BGP::Update->new($nlri,$nlri_ref,$withdrawn_ref);

    # Object Copy
    $clone = $update->clone();

    # Accessor Methods
    $nlri_ref         = $update->nlri($nlri_ref);
    $withdrawn_ref    = $update->withdrawn($withdrawn_ref);
    $prefix_hash_ref  = $update->ashash;

    # Comparison
    if ($update1 eq $update2) { ... }
    if ($update1 ne $update2) { ... }



DESCRIPTION

This module encapsulates the data contained in a BGP-4 UPDATE message. It provides a constructor, and accessor methods for each of the message fields and well-known path attributes of an UPDATE. Whenever a <B>Net::BGP::PeerB> sends an UPDATE message to its peer, it does so by passing a <B>Net::BGP::UpdateB> object to the peer object’s update() method. Similarly, when the peer receives an UPDATE message from its peer, the UPDATE callback is called and passed a reference to a <B>Net::BGP::UpdateB> object. The callback function can then examine the UPDATE message fields by means of the accessor methods.

CONSTRUCTOR

new() - create a new Net::BGP::Update object



    $update = Net::BGP::Update->new(
        NLRI            => [ qw( 10/8 172.168/16 ) ],
        Withdraw        => [ qw( 192.168.1/24 172.10/16 192.168.2.1/32 ) ],
        # For Net::BGP::NLRI
        Aggregator      => [ 64512, 10.0.0.1 ],
        AsPath          => [ 64512, 64513, 64514 ],
        AtomicAggregate => 1,
        Communities     => [ qw( 64512:10000 64512:10001 ) ],
        LocalPref       => 100,
        MED             => 200,
        NextHop         => 10.0.0.1,
        Origin          => INCOMPLETE,
    );



This is the constructor for Net::BGP::Update objects. It returns a reference to the newly created object. The following named parameters may be passed to the constructor. See RFC 1771 for the semantics of each path attribute.

An alternative is to construct an object from a Net::BGP::NLRI object:



    $nlri = Net::BGP::NLRI->new( ... );
    $nlri_ref = [ qw( 10/8 172.168/16 ) ];
    $withdrawn_ref = [ qw( 192.168.1/24 172.10/16 192.168.2.1/32 ) ];
    $update = Net::BGP::Update->new($nlri,$nlri_ref,$withdrawn_ref);



The NLRI object will not be modified in any way.

    NLRI

This parameter corresponds to the Network Layer Reachability Information (NLRI) field of an UPDATE message. It represents the route(s) being advertised in this particular UPDATE. It is expressed as an array reference of route prefixes which are encoded in a special format as perl strings: XXX.XXX.XXX.XXX/XX. The part preceding the slash is a dotted-decimal notation IP prefix. Only as many octets as are significant according to the mask need to be specified. The part following the slash is the mask which is an integer in the range [0,32] which indicates how many bits are significant in the prefix. At least one of either the NLRI or Withdraw parameters is mandatory and must always be provided to the constructor.

    Withdraw

This parameter corresponds to the Withdrawn Routes field of an UPDATE message. It represents route(s) advertised by a previous UPDATE message which are now being withdrawn by this UPDATE. It is expressed in the same way as the NLRI parameter. At least one of either the NLRI or Withdraw parameters is mandatory and must always be provided to the constructor.

OBJECT COPY

clone() - clone a Net::BGP::Update object



    $clone = $update->clone();



This method creates an exact copy of the Net::BGP::Update object, with Withdrawn Routes, Path Attributes, and NLRI fields matching those of the original object. This is useful for propagating a modified UPDATE message when the original object needs to remain unchanged.

ACCESSOR METHODS

nlri()

withdrawn()

These accessor methods return the value(s) of the associated UPDATE message field if called with no arguments. If called with arguments, they set the associated field. The representation of parameters and return values is the same as described for the corresponding named constructor parameters above.

ashash()

This method returns a hash reference index on the prefixes in found in the nlri and withdrawn fields. Withdrawn networks has undefined as value, while nlri prefixes all has the same reference to a Net::BGP::NLRI object matching the Update object self.

EXPORTS

The module does not export anything.

SEE ALSO

<B>RFC 1771B>, <B>RFC 1997B>, <B>Net::BGPB>, <B>Net::BGP::ProcessB>, <B>Net::BGP::PeerB>, <B>Net::BGP::NotificationB>, <B>Net::BGP::NLRIB>

AUTHOR

Stephen J. Scheck <code@neurosphere.com>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 NET::BGP::UPDATE (3) 2015-01-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.