Syntax Test for DPA feature
Syntax on Peer statement
dpa_syntax_peer.cfg
Tests
- Group 1 peer statement with dpa 20 as 3552
- test 0- no ip routes passed
- test 1- some ip routes passed
- test 2- more ip routes passed
- test 1 - some ip routes passed
- test 2 - more ip routes passed
- Group 2 autonomous-system used
test 3 - no ip routes passed autonomous-system 3552 dpa 30
- test 4 - some ip routes passed dpa 30, autonomous-system 20
- Group 3 - no dpa option used
- test 5 - some ip routes passed no dpa option
- Group 4 - DPA & Communities in syntax (dpa 20 as 3552)
- test 6 - comm-split 3552 20, route set = null
- test 7 - comm-split 3552 20 & 3552 21, route set 1 (some)
- test 8 - comm-split (9), route set 2 (more)
- test 9 - no communities, route set null (no ip routes)
- test 10 - community no-export, route set 1 (some)
- test 11 - community no-advertise, route set 2 (more)
- test 12 - community no-export-subconfed, route set null
- Group 5 - DPA null & community set
- test 13 - No dpa, community no export, route set 1 (some)
- Group 6 - DPA & Communities in syntax
- test 13 - dpa:dpa 30 autonomous-system 20, community:no export, route set 1(some)
- test 14 - dpa:as 20 dpa 3555, community:no advertise, route set 1 (some)
- test 15 - dpa:as 20 dpa 3555, community:no-export-subconfed, route set 1
- Group 7 - DPA, Community, MED
- test 16 - dpa:as 20 dpa 3555, comm-split 3552 300, MED 7
- test 17 - dpa:as 20 dpa 3555, comm-hex 0x4000 0x4000, MED 7
- test 18 - dpa:null, comm-hex 0x4000 0x4000, MED 7
- test 19 - dpa:as 20 dpa 3555, community no-export, MED 7
- test 20 - dpa:as 20 dpa 3555, community no-advertise, MED 8
- test 21 - dpa:as 20 dpa 3555, community no-export-subconfed, MED 9
- test 22 - dpa:as 1 dpa 30,
Any packets received with the bgp peer or aspath will also be
check for DPA within the bgp packet of this value.
The DPA is specified as part of the AS Path optional (aspath-opt) attributes.
the export statement for bgp
Any packets exported to a bgp neighbor may select routes to be sent
by specifying DPA on the source bgp protocol. In addition,
packets exported to a peer may have the DPA modified by
specifying DPA as part of the AS PATH modified.
BGP Group statement syntax
group type [internal | external] peeras 185
aspath-opt {
dpa [number]
}
{
peer host-addr;
}
Examples of this code are:
group type internal peeras 185
aspath-opt {
dpa 20
}
{
peer 198.108.60.43;
}
group type external peeras 65
aspath-opt {
dpa 20
}
{
peer 198.108.60.43;
}
import syntax
import proto bgp as as-id
aspath-opt {
dpa [number]
} [pref [number]]
{
route-filter;
};
Example of this code is:
import proto bgp as 185
aspath-opt
{
dpa 20 as 20;
}
pref 20
{
128.2 restrict;
all;
}
export syntax
export proto bgp as 2750
{
proto bgp as 2704
aspath-opt {
dpa 10 as 20
}
{
route-filter;
}
}
This export statement adds the dpa value to a set of routes.
export proto bgp as 2750
mod-aspath
{
dpa value; # Note AS will be taken from this node
}
{
proto bgp as 2704
{
route-filter;
}
proto bgp aspath any
{
route-filter;
}
};
Tests
The new DPA feature needs to test:
- syntax tests
- importing gated route with DPA
- exporting gated route with DPA already there
- adding DPA as export the route
- Test 1: DPA on peer statement
- Test 2: DPA on import statement with AS
- Test 3: DPA on import statement with AS path
- Test 4: DPA on export statement as "proto as"
- Test 5: DPA on export statement as "proto aspath"
- Test 6: DPA on export statement as "mod-aspath"
Each of the DPA statements on import and export will test:
- DPA without AS (assumes this AS)
- DPA on import statement with AS that is this AS
- DPA on import statement with AS that is not this AS
Import gated route with DPA
Test preference setting based on AS based on
- AS
- AS_PATH
- AS & nlri prefix
- AS_PATH & nlri prefix
Export gated route with DPA
Export with DPA as additional filter on
- AS
- AS_PATH
- AS & nlri prefix
- AS_PATH & nlri prefix
DPA as export the route
Adding to route from the following sources
- static
- egp
- bgp
- rip
- ospf