CCIE路由实验(3) -- BGP高级部分
当一个AS包含多个IBGP对等体时,路由反射器非常有用。因为IBGP客户只需要和路由反射器建立邻居关系,从而降低了IBGP的连接数量。路由反射器和它的客户合称为一个簇。路由反射是克服IBGP水平分割的重要手段。
RR的反射规则如下:
1.如果路由是从非客户的IBGP邻居学来的,则RR只将它反射给客户
2.如果路由是从客户学来的,RR会将它反射给所有的非客户和客户(除了发起该路由的客户)
3.如果路由是从EBGP邻居学来的,RR会将它反射给所有的非客户和客户
1.ORIGINATOR_ID: 由路由反射器生成,是本AS内路由创造者的路由器ID
2.CLUSTER_ID: 一个AS内的每个簇必须用一个唯一的4个字节的簇ID来标识,如果簇内只有一个RR,则簇ID就是RR的路由器ID。当RR收到一个更新消息的时候,它检查CLUSTER_LIST,如果发现在列表中有自己的簇ID,就知道出现了路由环路。
1.路由反射器
2.层次化的RR
3.BGP联邦
4.BGP团体属性Community
5.过滤私有AS号
6.BGP后门路由
7.BGP路由标记
enable
conf t
no ip do lo
enable pass cisco
line con 0
logg sync
exec-t 0 0
exit
line vty 0 4
pass cisco
logg sync
exit
host
1.路由反射器
-------------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
router bgp 100
neighbor 12.1.1.2 remote-as 200
network 11.1.1.0 mask 255.255.255.0
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 22.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 22.1.1.1
neighbor 12.1.1.1 remote-as 100
neighbor 33.1.1.1 remote-as 200
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 34.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 23.1.1.0 0.0.0.255
network 33.1.1.0 0.0.0.255
network 34.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 33.1.1.1
neighbor 22.1.1.1 remote-as 200
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
neighbor 44.1.1.1 remote-as 200
neighbor 44.1.1.1 update-source l0
neighbor 44.1.1.1 next-hop-self
exit
R4:
int f0/0
ip add 34.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 34.1.1.0 0.0.0.255
network 44.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 44.1.1.1
neighbor 33.1.1.1 remote-as 200
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
exit
----------------------------------------------
R3:
end
show ip bgp
show ip bgp neighbors 44.1.1.1 advertised-routes
conf t
router bgp 200
neighbor 44.1.1.1 route-reflector-client
neighbor 22.1.1.1 route-reflector-client
exit
end
show ip bgp
show ip bgp neighbors 44.1.1.1 advertised-routers
show ip bgp neighbors 44.1.1.1
show ip bgp 11.1.1.0
conf t
R4:
end
show ip bgp 11.1.1.0
conf t
R3:
router bgp 200
bgp cluster-id 3.3.3.3
R4:
end
show ip bgp 11.1.1.0
conf t
2.层次化的RR
-----------------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
router bgp 100
neighbor 12.1.1.2 remote-as 200
network 11.1.1.0 mask 255.255.255.0
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 22.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 22.1.1.1
neighbor 12.1.1.1 remote-as 100
neighbor 33.1.1.1 remote-as 200
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 34.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 23.1.1.0 0.0.0.255
network 33.1.1.0 0.0.0.255
network 34.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 33.1.1.1
neighbor 22.1.1.1 remote-as 200
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
neighbor 44.1.1.1 remote-as 200
neighbor 44.1.1.1 update-source l0
neighbor 44.1.1.1 next-hop-self
exit
R4:
int f0/0
ip add 34.1.1.4 255.255.255.0
no shut
int f1/0
ip add 45.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 34.1.1.0 0.0.0.255
network 44.1.1.0 0.0.0.255
network 45.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 44.1.1.1
neighbor 33.1.1.1 remote-as 200
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
neighbor 55.1.1.1 remote-as 200
neighbor 55.1.1.1 update-source l0
neighbor 55.1.1.1 next-hop-self
exit
R5:
int f0/0
ip add 45.1.1.5 255.255.255.0
no shut
int l0
ip add 55.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 45.1.1.0 0.0.0.255
network 55.1.1.0 0.0.0.255
exit
router bgp 200
bgp router-id 55.1.1.1
neighbor 44.1.1.1 remote-as 200
neighbor 44.1.1.1 update-source l0
neighbor 44.1.1.1 next-hop-self
exit
----------------------------------------------
R3:
router bgp 200
neighbor 44.1.1.1 route-reflector-client
neighbor 22.1.1.1 route-reflector-client
exit
R4:
router bgp 200
neighbor 55.1.1.1 route-reflector-client
exit
3.BGP联邦
IBGP邻居并不把路由信息从一个IBGP邻居传播给另一个IBGP邻居。如果全互联,这将产生一个规模与费用的问题。BGP联邦克服了IBGP引起的规模问题。把AS划分为多个子自治系统。但在联邦内部,仍然需要IBGP的full-mesh,或者在联邦内部使用RR。联邦之间的BGP连接就像一个EBGP对等体,但是他们在交换路由信息的时候,就如在使用IBGP,同时保留了下一跳、度量和本地优先级等属性。
------------------------------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
router bgp 100
bgp router-id 11.1.1.1
neighbor 12.1.1.2 remote-as 200
network 11.1.1.0 mask 255.255.255.0
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
int f2/0
ip add 27.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 22.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
network 27.1.1.0 0.0.0.255
exit
router bgp 65001
bgp router-id 22.1.1.1
bgp confederation identifier 200
bgp confederation peers 65002
neighbor 12.1.1.1 remote-as 100
neighbor 33.1.1.1 remote-as 65002
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
neighbor 33.1.1.1 ebgp-multihop
neighbor 77.1.1.1 remote-as 65001
neighbor 77.1.1.1 update-source l0
neighbor 77.1.1.1 next-hop-self
exit
R3:
int f0/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 34.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 23.1.1.0 0.0.0.255
network 33.1.1.0 0.0.0.255
network 34.1.1.0 0.0.0.255
exit
router bgp 65002
bgp router-id 33.1.1.1
bgp confederation identifier 200
bgp confederation peers 65001
neighbor 22.1.1.1 remote-as 65001
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 ebgp-multihop
neighbor 44.1.1.1 remote-as 65002
neighbor 44.1.1.1 update-source l0
exit
R4:
int f0/0
ip add 34.1.1.4 255.255.255.0
no shut
int f1/0
ip add 45.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 34.1.1.0 0.0.0.255
network 44.1.1.0 0.0.0.255
network 45.1.1.0 0.0.0.255
exit
router bgp 65002
bgp router-id 44.1.1.1
bgp confederation identifier 200
bgp confederation peers 65003
neighbor 33.1.1.1 remote-as 65002
neighbor 33.1.1.1 update-source l0
neighbor 55.1.1.1 remote-as 65003
neighbor 55.1.1.1 update-source l0
neighbor 55.1.1.1 ebgp-multihop
exit
R5:
int f0/0
ip add 45.1.1.5 255.255.255.0
no shut
int f1/0
ip add 56.1.1.5 255.255.255.0
no shut
int l0
ip add 55.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 45.1.1.0 0.0.0.255
network 55.1.1.0 0.0.0.255
network 56.1.1.0 0.0.0.255
exit
router bgp 65003
bgp router-id 55.1.1.1
bgp confederation identifier 200
bgp confederation peers 65002
neighbor 44.1.1.1 remote-as 65002
neighbor 44.1.1.1 update-source l0
neighbor 44.1.1.1 next-hop-self
neighbor 44.1.1.1 ebgp-multihop
neighbor 56.1.1.6 remote-as 300
exit
R6:
int f0/0
ip add 56.1.1.6 255.255.255.0
no shut
int l0
ip add 66.1.1.1 255.255.255.0
exit
router bgp 300
bgp router-id 66.1.1.1
neighbor 56.1.1.5 remote-as 200
exit
R7:
int f0/0
ip add 27.1.1.7 255.255.255.0
no shut
int l0
ip add 77.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 27.1.1.0 0.0.0.255
network 77.1.1.0 0.0.0.255
exit
router bgp 65001
bgp router-id 77.1.1.1
bgp confederation identifier 200
neighbor 22.1.1.1 remote-as 65001
neighbor 22.1.1.1 update-source l0
exit
----------------------------------------------
R2:
router bgp 65001
bgp default local-pre 200
exit
show ip bgp
show ip bgp 11.1.1.0
R3:
show ip bgp
R5:
show ip bgp
R6:
show ip bgp
4.BGP团体属性Community
Community主要用来控制路由的传播范围;
团体属性,也叫做共同体属性,是可选传递属性,可选意味着并不是所有的路由器都能识别这个团体属性;
团体属性类似于tag标记,它允许路由器能够使用一个指示符来标记路由,并且允许其它路由器根据这个标记做出相应的决定,可以简化策略的执行。它是Cisco的一个专有属性,现在在RFC1997中已被标准化;
一条路由可以设置多个团体属性,也就是说可以同时打上多个标记,还可以利用团体属性实现一些扩展的功能,比如在MPLS-VPN中RT属性;
默认情况下团体属性不会传递给邻居,必须有以下命令才行:neighbor 1.1.1.1 send-community;团体属性只会传给指定的邻居,并且只在该邻居上生效
Community值可以自己定义,此外有几个已经定义好的团体属性:
NO_ADVERTISE:携带该值的路由不能公布给EBGP和IBGP邻居
NO_EXPORT:携带该值的路由公布给任何真正的EBGP对等体
LOCAL_AS:携带该值的路由不能公布给任何EBGP对等体,包括联邦内部子系统EBGP对等体
R1:
int l100
ip add 100.1.1.1 255.255.255.0
exit
router bgp 100
network 100.1.1.0 mask 255.255.255.0
exit
ip prefix-list 100.1 permit 100.1.1.0/24
route-map COMMUNITY permit 10
match ip add prefix-list 100.1
set community local-as
exit
route-map COMMUNITY permit 9999
exit
router bgp 100
neighbor 12.1.1.2 route-map COMMUNITY out
neighbor 12.1.1.2 send-community
exit
R2:
show ip bgp 100.1.1.0
R3/R7:
show ip bgp
-------------------------------------------------------
R1:
int l101
ip add 101.1.1.1 255.255.255.0
exit
router bgp 100
network 101.1.1.0 mask 255.255.255.0
exit
ip prefix-list 101.1 permit 101.1.1.0/24
route-map COMMUNITY permit 20
match ip add prefix-list 101.1
set community no-advertise
exit
clear ip bgp * soft out
R2:
show ip bgp 101.1.1.0
R3/R7:
show ip bgp
----------------------------------------------------------
R2:
int l200
ip add 200.1.1.1 255.255.255.0
exit
route-map NO-EXPORT permit 10
set community no-export
exit
router bgp 65001
network 200.1.1.0 mask 255.255.255.0 route-map NO-EXPORT
exit
show ip bgp 200.1.1.0
ip prefix-list 101.1 permit 101.1.1.0/24
route-map COMMUNITY permit 20
match ip add prefix-list 101.1
set community no-advertise
exit
R1/R3/R7:
show ip bgp
5.过滤私有AS号
--------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int l0
ip add 11.1.1.1 255.255.255.0
exit
router bgp 65000
router-id 11.1.1.1
neighbor 12.1.1.2 remote-as 100
network 11.1.1.0 mask 255.255.255.0
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
int l0
ip add 22.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 23.1.1.0 0.0.0.255
network 22.1.1.0 0.0.0.255
exit
router bgp 100
bgp router-id 22.1.1.1
neighbor 33.1.1.1 remote-as 100
neighbor 33.1.1.1 update-source l0
neighbor 33.1.1.1 next-hop-self
neighbor 12.1.1.1 remote-as 65000
exit
R3:
int f0/0
ip add 34.1.1.3 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int l0
ip add 33.1.1.1 255.255.255.0
exit
router eigrp 1
no auto-summary
network 23.1.1.0 0.0.0.255
network 33.1.1.0 0.0.0.255
exit
router bgp 100
bgp router-id 33.1.1.1
neighbor 22.1.1.1 remote-as 100
neighbor 22.1.1.1 update-source l0
neighbor 22.1.1.1 next-hop-self
neighbor 34.1.1.4 remote-as 200
exit
R4:
int f0/0
ip add 34.1.1.4 255.255.255.0
no shut
exit
int l0
ip add 44.1.1.1 255.255.255.0
exit
router bgp 200
bgp router-id 44.1.1.1
neighbor 34.1.1.3 remote-as 100
exit
R4:
show ip bgp
R3:
router bgp 100
neighbor 34.1.1.4 remove-private-as
exit
R4:
clear ip bgp * in
show ip bgp
6.BGP后门路由
---------------------------------------------------------------------------------
R1:
int f1/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
int s0/0
ip add 13.1.1.1 255.255.255.0
no shut
exit
router ospf 1
router-id 11.1.1.1
network 12.1.1.0 0.0.0.255 area 0
exit
router bgp 100
bgp router-id 11.1.1.1
neighbor 13.1.1.3 remote-as 300
exit
R2:
int f1/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int s0/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
router ospf 1
router-id 22.1.1.1
network 12.1.1.0 0.0.0.255 area 0
exit
router bgp 200
bgp router-id 22.1.1.1
neighbor 23.1.1.3 remote-as 300
exit
R3:
int s0/0
ip add 13.1.1.3 255.255.255.0
no shut
exit
int s0/1
ip add 23.1.1.3 255.255.255.0
no shut
exit
router bgp 300
bgp router-id 33.1.1.1
neighbor 13.1.1.1 remote-as 100
neighbor 23.1.1.2 remote-as 200
exit
R1:
int l0
ip add 11.1.1.1 255.255.255.0
exit
router ospf 1
network 11.1.1.0 0.0.0.255 area 0
exit
int l0
ip ospf network point-to-point
exit
R2:
show ip route
R1:
router bgp 100
network 11.1.1.0 mask 255.255.255.0
exit
R2:
show ip route
以上表示当11.1.1.0/24这条路由同时从EBGP邻居和OSPF邻居学习到的时候,会选择从BGP邻居学习到的路由,因为EBGP路由的AD值为20.
要想让R2优选从OSPF学习的路由,需要在R2上做BGP后门路由配置。
R2:
router bgp 200
network 11.1.1.0 mask 255.255.255.0 backdoor
exit
show ip route
int f1/0
shutdown
exit
show ip route
7.BGP路由标记
---------------------------------------------------------------------------------
R1:
int f0/0
ip add 12.1.1.1 255.255.255.0
no shut
exit
router bgp 100
bgp router-id 11.1.1.1
neighbor 12.1.1.2 remote-as 300
exit
R2:
int f0/0
ip add 12.1.1.2 255.255.255.0
no shut
exit
int f1/0
ip add 23.1.1.2 255.255.255.0
no shut
exit
router ospf 1
router-id 22.1.1.1
network 23.1.1.0 0.0.0.255 area 0
exit
router bgp 300
bgp router-id 22.1.1.1
neighbor 12.1.1.1 remote-as 100
exit
R3:
int f1/0
ip add 23.1.1.3 255.255.255.0
no shut
exit
int f0/0
ip add 34.1.1.3 255.255.255.0
no shut
exit
router ospf 1
router-id 33.1.1.1
network 23.1.1.0 0.0.0.255 area 0
exit
router bgp 300
bgp router-id 33.1.1.1
neighbor 34.1.1.4 remote-as 200
exit
R4:
int f0/0
ip add 34.1.1.4 255.255.255.0
no shut
exit
router bgp 200
bgp router-id 44.1.1.1
neighbor 34.1.1.3 remote-as 300
exit
R1:
int l0
ip add 11.1.1.1 255.255.255.0
exit
router bgp 100
network 11.1.1.0 mask 255.255.255.0
exit
默认情况下R4不能学到此路由,因为R2与R3之间并没有BGP邻居关系,需要在OSPF之间进行重分布才能学到。
R2:
router ospf 1
redistribute bgp 300 subnets
exit
R3:
router bgp 300
redistribute ospf 1 match external 2
exit
R4:
show ip bgp
能够看到11.1.1.0/24这条路由,但是不能看到这条路由的起源AS号100.产生此问题的原因是该路由被R3学到之前已经过了OSPF区域的重发布,而OSPF协议是无法理解AS路径属性的。解决的办法是在R2上从BGP向OSPF发布路由时利用route-map将AS路径属性转为路由标记,这样就可以携带在OSPF路由中,然后在R3上从OSPF发布回BGP时,再次利用route-map,将路由标记转回AS路径属性。
R2:
route-map TAG permit 10
set automatic-tag
exit
router bgp 300
table-map TAG
exit
R3:
route-map TAG permit 10
set as-path tag
exit
router bgp 300
redistribute ospf 1 route-map TAG
exit
R4:
show ip bgp
CCIE路由实验(3) -- BGP高级部分的更多相关文章
- CCIE路由实验(2) -- BGP选路原则
BGP路径属性分为4类: 公认必遵(Well-Known Mandatory):BGP更新报文中必须包含的,且必须被所有BGP厂商实现所能识别的,包括ORIGIN,AS-PATH和Next_Hop 1 ...
- CCIE路由实验(4) -- BGP路由控制
1.过滤BGP路由的方法2.用AS-path filter控制路由3.用Community Filter控制路由 enableconf tno ip do loenable pass ciscolin ...
- CCIE路由实验(5) -- BGP负载均衡
enableconf tno ip do loenable pass ciscoline con 0logg syncexec-t 0 0exitline vty 0 4pass ciscologg ...
- CCIE路由实验(7) -- MPLS VPN
1.LDP协议的各种情况2.LDP和BGP交互3.LDP高级部分4.MPLS VPN (RIP和静态)5.MPLS VPN (EIGRP)6.MPLS VPN (OSPF)7.MPLS VPN (EB ...
- CCIE路由实验(6) -- 组播Multicasting
1.组播IGMP的各种情况2.PIM Dense-Mode3.PIM Sparse-Mode4.PIM双向树和SSM5.动态RP之auto-rp6.动态RP之BSR7.Anycast RP8.域间组播 ...
- CCIE路由实验(9) -- IPv6
1.IPv6地址的各种情况2.配置通过DHCP-PD方式分配前缀信息3.IPv6路由基本配置4.IPv6路由--RIPng5.IPv6路由--EIGRPv66.IPv6路由--OSPFv37.IPv6 ...
- CCNP路由实验(4) -- BGP
基本配置:enableconf tno ip do loenable pass ciscoline con 0logg syncexec-t 0 0line vty 0 4pass ciscologg ...
- CCIE路由实验(8) -- QoS
1.查看端口缺省的队列机制2.配置CB-WFQ3.配置CB-LLQ4.配置CB-Shapping在以太接口下5.配置CB-Shapping在FR接口下6.配置帧中继流量整形FRTS7.配置CB-Pol ...
- CCIE路由实验(10) -- IS-IS
1.配置基本的集成IS-IS路由协议2.多区域的集成IS-IS配置3.IS-IS认证4.IS-IS路由泄露5.IS-IS汇总6.在IS-IS中手动产生一条默认路由7.IS-IS协议重分布8.用IS-I ...
随机推荐
- Protel99se教程五:protel99se的自动布线
在上一节课的protel99se教程中,我们给大家演示的是,如何快速的将SCH原理PCB,也就是将元件转到PCB中,在这一节课,我们主要给大家讲解的是何在protel99se快速布线,我们在这节课当中 ...
- 开源流媒体处理库live555服务器端、客户端源代码分析总结
RTSP服务器端流程: 1. RTSP连接的建立过程 RTSPServer类用于构建一个RTSP服务器,该类同时在其内部定义了一个RTSPClientSession类,用于处理单独的客户会话. 首先创 ...
- nvarchar and nchar
Same: 1.store unicode charactor. 2. A charactor is stroed with 2 bytes. Different. 1. nchar 会自动填充数据 ...
- 【转】android开发中关于模拟器emulation的常见问题
[转]android开发中关于模拟器emulation的常见问题 Trouble: 无法启动android模拟器,提示 XDM authorization key matches an existin ...
- 通过OC实现简单的冒泡排序
NSMutableArray *arr = [@["] mutableCopy]; ; i<[arr count]-; i++) { ; j<[arr count]--i; j+ ...
- iOS开发之第三方登录微信-- 史上最全最新第三方登录微信方式实现
项目地址 : https://github.com/zhonggaorong/weixinLoginDemo 最新版本的微信登录实现步骤实现: 1.在进行微信OAuth2.0授权登录接入之前,在 ...
- Unity 对象池 生产 保存
Unity对象池主要是保存那些常用的物体,避免他们在不断销毁和创造中损坏性能. 主要思路为:创造物体时,判断是否存在,如果存在则调用并使其显示.如果不存在则创造一个新的. 当销毁时,调用协程延时隐藏物 ...
- java volatile关键字的理解
转载:http://shmilyaw-hotmail-com.iteye.com/blog/1672779 一个多线程的示例引发的问题 在讨论这个关键字之前先看一个多线程的示例代码: public c ...
- 打包jar类库与使用jar类库
翻译人员: 铁锚 翻译时间: 2013年11月17日 原文链接: Build a Java library by using jar file 代码复用是软件开发中很重要的一个原则.将常用的函数构建 ...
- 基于原生js的图片延迟加载
当页面图片比较多的时候,我们通常会做一个延迟加载,避免页面打开时一下子的请求数太多,加载过慢影响用户体验. 如果项目用了jquery框架,则可以直接用 jquery.lazyload.可在jquery ...