Professional Documents
Culture Documents
2.BGP FS Introduction
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 1页
All Rights reserved, No Spreading abroad without Permission of ZTE
contains only the prefix mask information and traffic outbound interface information for
matching the destination address. with the needs of network service development (such as
anti-DDOS attack, traffic engineering) and supporting for traffic policies (such as: static policy
routing, etc.), network requires forward routing table entries can subdivide the data stream, not
limited to match the data stream based on the destination address, also including the source
address, ip protocol number, port number, etc.
The action for different flows is not only limited to forward traffic from an outgoing interface,
but also includes actions such as rate limiting, dropping, and redirection. However, the biggest
limitation of policy routing is that it belongs to the local behavior and needs to be configured on a
device by device basis. The maintenance workload is large, and the policy cannot be transmitted
on the network, and remote control cannot be implemented.
A BGP Flow Specification peer is established under the new address family ipv4 flowspec or
vpnv4 flowspec to advertise BGP Flow Specification routes. This BGP Flow Specification route
contains a new type of BGP network layer reachability information type and extended
community attributes. With this new feature, BGP Flow Specification routes can carry traffic
matching conditions and actions performed after traffic matching.
The traffic matching conditions that the BGP Flow Specification route can carry are as
follows:
(1) Destination address and source address
(2) IP protocol number
(3) Port number, including destination port number and source port number
(4) ICMP type and coding
(5) TCP flag
(6) DSCP value
(7) Segment types
The traffic behavior carried by the extended community attribute of the BGP Flow Specification
route is as follows:
(1) Discard traffic
(2) Flow rate limit
(3) Modify the DSCP value of the packet
(4) Redirect to VPN
The specific working process of the BGP Flow Specification function includes the following steps:
1) Network entry device sends traffic samples to the traffic analysis server.
2) When a traffic attack occurs, the traffic analysis server detects traffic sampling samples
according to predefined rules and identifies abnormal traffic.
3) The traffic analysis server creates a BGP Flow Specification route according to the
characteristics of the abnormal traffic, and then passes the BGP Flow Specification route to
pass the traffic filtering rule to the network entry device.
4) After receiving the BGP Flow Specification route, network entry translates the route into a
traffic control policy to control traffic matching rules.
3.BGP FS Configuration
Configuration steps:
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 3页
All Rights reserved, No Spreading abroad without Permission of ZTE
neighbor 10.20.1.2 activate
Step2:Configuration on R2:
ZXR10(config-bgp)#show running-config bgp
!<bgp>
router bgp 2
neighbor 10.20.1.1 remote-as 1
neighbor 10.20.1.1 activate
address-family ipv4 flowspec
neighbor 10.20.1.1 activate
*> [1]Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:
>=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=1
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 4页
All Rights reserved, No Spreading abroad without Permission of ZTE
0000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
0.0.0.0 0 i
[1]Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:>=30&
<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=10000,
DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
0.0.0.0 i
3. Check the routes reception on R2:
ZXR10(config)#show bgp ipv4 flowspec neighbor in 10.20.1.1
Routes Learned From This Neighbor:
Status codes: * valid, > best, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network codes: [ ] - index
Network Next Hop Metric LocPrf RtPrf Path
*> [1]Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:
>=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=1
0000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
0.0.0.0 20 1i
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 5页
All Rights reserved, No Spreading abroad without Permission of ZTE
2. View flowspec routing information on R2, the route is invalid:
ZXR10(config)#sho bgp ipv4 flowspec detail 1
BGP routing table entry for Index 1
NLRI(Hex dump) : 0x0120c0a8640102000381dc05030ac51406031ed5032007816408030a45140
31ec5280982100a9127100b0300451d031fc53f0c8102
FLOW : Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:>
=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=10
000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
06:43:28 received from 10.20.1.1 (10.20.1.1), path-id 0
Origin i, nexthop 1.2.3.4,weight 0, rtpref 20, best, block best, selected,
As path [1]
As4 path
Flowspec Actions: Redirect-to-IP: 1.2.3.4,
Invalid due to fail to validate destination
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 6页
All Rights reserved, No Spreading abroad without Permission of ZTE
FLOW : Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:>
=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=10
000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
07:13:14 received from 10.20.1.1 (10.20.1.1), path-id 0
Origin i, nexthop 1.2.3.4,weight 0, rtpref 20, best, block best, selected,
As path [1]
As4 path
Flowspec Actions: Redirect-to-IP: 1.2.3.4,
Advertised to UpdateGroup Index: 3
Origin i,
As path(no filter) [2 1]
As4 path(no filter)
Flowspec Actions: Redirect-to-IP: 1.2.3.4,
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 7页
All Rights reserved, No Spreading abroad without Permission of ZTE
Redirect nexthop validation: Enable
Checking the validity of the filtering rule based on the redirected next hop
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 8页
All Rights reserved, No Spreading abroad without Permission of ZTE
3.3.2 Configuration Display
Viewing neighbor information and received routing information on R2:
1. Viewing Neighbor Information on R2:
ZXR10(config)#show bgp ipv4 flowspec neighbor 10.20.1.1
…
For address family: IPv4 Flowspec
Weight is 0
All received nlri 1, unnlri 0, 1 accepted prefixes, 0 deleting prefixes
All sent nlri 0, unnlri 0, 0 advertised prefixes, advertised prefixes limit 4294
967295
Maximum limit 4294967295
Threshold for warning message 75%
Destination address validation: Disable
Redirect nexthop validation: Enable
…
2. View flowspec routing information on R2. The route is valid but the corresponding
extcommunity attribute is not sent:
ZXR10(config)#sho bgp ipv4 flowspec detail 1
BGP routing table entry for Index 1
NLRI(Hex dump) : 0x0120c0a8640102000381dc05030ac51406031ed5032007816408030a45140
31ec5280982100a9127100b0300451d031fc53f0c8102
FLOW : Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:>
=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=10
000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
06:43:28 received from 10.20.1.1 (10.20.1.1), path-id 0
Origin i, nexthop 1.2.3.4,weight 0, rtpref 20, best, block best, selected,
As path [1]
As4 path
Flowspec Actions: Redirect-to-IP: 1.2.3.4,
Failed to validate redirect nexthop
Advertised to UpdateGroup Index: 3
Origin i,
As path(no filter) [2 1]
As4 path(no filter)
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 10页
All Rights reserved, No Spreading abroad without Permission of ZTE
OSPF-E = ospf-ext, ASBR-V = asbr-vpn, GW-FWD = ps-busi, GW-UE = ps-user,
BGP-AD = bgp-aggr-discard, BGP-CE = bgp-confed-ext, NAT64 = sl-nat64-v4,
USER-N = user-network, USER-S = user-special, DHCP-S = dhcp-static,
DHCP-D = dhcp-dft, VES = video-enhanced-service
Marks: *valid, >best, s-stale
Dest NextHop RoutePrf RouteMetric Protocol
*> 1.2.3.4/32 10.20.1.1 20 0 BGP-EXT
*> 10.20.1.0/24 10.20.1.2 0 0 Direct
*> 10.20.1.2/32 10.20.1.2 0 0 Address
2. Viewing Neighbor Information on R2:
ZXR10(config)#show bgp ipv4 flowspec neighbor 10.20.1.1
…
For address family: IPv4 Flowspec
Weight is 0
All received nlri 1, unnlri 0, 1 accepted prefixes, 0 deleting prefixes
All sent nlri 0, unnlri 0, 0 advertised prefixes, advertised prefixes limit 4294
967295
Maximum limit 4294967295
Threshold for warning message 75%
Destination address validation: Disable
Redirect nexthop validation: Enable
3. View flowspec routing information on R2. The route is valid and the corresponding
extcommunity attribute is sent:
ZXR10(config-bgp-af-ipv4-flowspec)#sho bgp ipv4 flowspec detail 1
BGP routing table entry for Index 1
NLRI(Hex dump) : 0x0120c0a8640102000381dc05030ac51406031ed5032007816408030a45140
31ec5280982100a9127100b0300451d031fc53f0c8102
FLOW : Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:>
=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=10
000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
07:13:14 received from 10.20.1.1 (10.20.1.1), path-id 0
Origin i, nexthop 1.2.3.4,weight 0, rtpref 20, best, block best, selected,
As path [1]
As4 path
Flowspec Actions: Redirect-to-IP: 1.2.3.4,
Advertised to UpdateGroup Index: 3
Origin i,
As path(no filter) [2 1]
As4 path(no filter)
Flowspec Actions: Redirect-to-IP: 1.2.3.4,
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 11页
All Rights reserved, No Spreading abroad without Permission of ZTE
2. Configure the corresponding vrf on R1 and R2
Configured on R1:
ZXR10(config-bgp)#show running-config vrf
!<vrf>
ip vrf zterosngroutebgp
rd 197:137
route-target import 1:1
route-target export 1:1
address-family ipv4
$
address-family ipv6
$
$
!</vrf>
Configured on R2:
ZXR10(config-bgp)#show running-config vrf
!<vrf>
ip vrf zterosngroutebgp
rd 197:137
route-target import 1:1
route-target export 1:1
address-family ipv4
$
address-family ipv6
$
$
!</vrf>
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 12页
All Rights reserved, No Spreading abroad without Permission of ZTE
neighbor 10.20.1.1 activate
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 13页
All Rights reserved, No Spreading abroad without Permission of ZTE
<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=10000,
DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
0.0.0.0 i
3. Check the route reception on R2:
ZXR10(config-bgp)#show bgp vpnv4 flowspec neighbor in 10.20.1.1
Routes Learned From This Neighbor:
Status codes: * valid, > best, i - internal, s - stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network codes: [ ] - index
Network Next Hop Metric LocPrf RtPrf Path
Route Distinguisher:197:137
*> [1]Dest:192.168.100.1/32,Source:0.0.0.0/0,Proto:=220,DPort:>=10&<=20,SPort:
>=30&<=800,ICMPType:=100,ICMPCode:>=10&<=20|>=30&<=40,TCPFlags:!=~0x10,Length:=1
0000,DSCP:>=0&<=29|>=31&<=63,Frag:=IsF
0.0.0.0 20 1i
<以上所有信息均为中兴通讯股份有限公司所有,不得外传> 第 14页
All Rights reserved, No Spreading abroad without Permission of ZTE