Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FRR][sonic-cfggen] Support T2 chassis frontend #3019

Closed
wants to merge 12 commits into from
Closed

[FRR][sonic-cfggen] Support T2 chassis frontend #3019

wants to merge 12 commits into from

Conversation

baiwei0427
Copy link
Collaborator

@baiwei0427 baiwei0427 commented Jun 16, 2019

- What I did

Support new role: T2 chassis frontend switch (SpineChassisFrontendRouter). The chassis frontend switch needs BGP-EVPN, Vxlan and Vnet support.

- How I did it

  • Modify minigraph parser to add Vnet and Vxlan informration for T2 chassis frontend

  • Add new frr, bgpd and zebra j2 templates to support BGP-EVPN

  • Add new tests to sonic-cfggen unit test scripts

- How to verify it

Run load_minigraph and verify entries in config DB and FRR configuration.

In config DB, you should be able to see the following entries:

"VNET|VnetFE"
"VXLAN_TUNNEL|TunnelInt"

In FRR docker, you should be able to see BGP-EVPN configuration as follows:

hostname SpineFront01
password zebra
log syslog informational
log facility local4
! enable password !
! Vnet BGP instance
vrf VnetFE
vni 8000
router bgp 4000 vrf VnetFE
  no bgp default ipv4-unicast
  bgp log-neighbor-changes
  bgp bestpath as-path multipath-relax
  no bgp default ipv4-unicast
  bgp graceful-restart restart-time 240
  bgp graceful-restart
  bgp router-id 4.0.0.0
  neighbor 192.168.0.1 remote-as 3000
  neighbor 192.168.0.1 description Leaf01
  neighbor 192.168.0.1 timers 3 10
  address-family ipv4 unicast
    neighbor 192.168.0.1 activate
    neighbor 192.168.0.1 soft-reconfiguration inbound
    maximum-paths 64
  exit-address-family
  address-family l2vpn evpn
    advertise ipv4 unicast
  exit-address-family

!
! bgp multiple-instance
!
route-map FROM_BGP_SPEAKER_V4 permit 10
!
route-map TO_BGP_SPEAKER_V4 deny 10
!
router bgp 4000
  bgp log-neighbor-changes
  bgp bestpath as-path multipath-relax
  no bgp default ipv4-unicast
  bgp graceful-restart restart-time 240
  bgp graceful-restart
  bgp router-id 4.0.0.0
  network 4.0.0.0/32
  neighbor 4.0.0.1 remote-as 4000
  neighbor 4.0.0.1 description SpineFront02
  neighbor 4.0.0.1 timers 3 10
  address-family l2vpn evpn
    neighbor 4.0.0.1 activate
    advertise-all-vni
  exit-address-family
  neighbor 172.16.0.2 remote-as 5000
  neighbor 172.16.0.2 description SpineBack01
  neighbor 172.16.0.2 timers 3 10
  address-family ipv4 unicast
    neighbor 172.16.0.2 allowas-in 1
    neighbor 172.16.0.2 activate
    neighbor 172.16.0.2 soft-reconfiguration inbound
    maximum-paths 64
  exit-address-family
  neighbor 172.16.0.10 remote-as 5000
  neighbor 172.16.0.10 description SpineBack02
  neighbor 172.16.0.10 timers 3 10
  address-family ipv4 unicast
    neighbor 172.16.0.10 allowas-in 1
    neighbor 172.16.0.10 activate
    neighbor 172.16.0.10 soft-reconfiguration inbound
    maximum-paths 64
  exit-address-family
!
maximum-paths 64
!
route-map ISOLATE permit 10
set as-path prepend 4000
!

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Wei Bai [email protected] and Ze Gan [email protected]

if current_device['type'] == spine_chassis_frontend_role:
chassis_vnet ='Vnet1'
chassis_vxlan_tunnel = 'tunnel1'
chassis_vni = 8000
Copy link
Collaborator

@lguohan lguohan Jun 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not hard code here. We can hardcode in the template. The same applies to Vnet1, tunnel1. name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information (Vnet name, Vxlan tunnel name and vni) will be inserted to config DB. I don't know which template you refer to.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bgpd.j2

Copy link
Collaborator Author

@baiwei0427 baiwei0427 Jun 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lguohan I think this information is also necessary for vxlanmgrd


results['VXLAN_TUNNEL'] = {chassis_vxlan_tunnel: {
'source_ip': lo_addr
}}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use the lo_addr directly in the bgpd.conf j2 template?


# Enslave the interface to a Vnet
if intf_name in phyport_intfs:
phyport_intfs[intf_name] = {'vnet_name': chassis_vnet}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move this enslave logic into the template as well?

phyport_intfs[intf_name] = {'vnet_name': chassis_vnet}
else:
print >> sys.stderr, 'Warning: cannot find the key %s' % (intf_name)

return results
Copy link
Collaborator

@lguohan lguohan Jun 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the extra logics you add in this file seem unnecessary, we should move all of them to template.


# Special parsing for spine chassis frontend routers
if current_device['type'] == spine_chassis_frontend_role:
chassis_vnet ='Vnet1'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VnetFE

# Special parsing for spine chassis frontend routers
if current_device['type'] == spine_chassis_frontend_role:
chassis_vnet ='Vnet1'
chassis_vxlan_tunnel = 'tunnel1'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TunnelInt

'vni': chassis_vni
}}

for intf in phyport_intfs:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if the front panel port channel belong to vnet?

Copy link
Collaborator

@lguohan lguohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as comments

@baiwei0427
Copy link
Collaborator Author

retest this please

@lguohan
Copy link
Collaborator

lguohan commented Jun 28, 2019

can you resolve conflict?

self.assertEqual(output.strip(),
"{'Ethernet8': {}, "
"('Ethernet8', '172.16.0.9/30'): {}, "
"'Ethernet0': {'vnet_name': 'VnetFE'}, "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need port channel example.

@baiwei0427 baiwei0427 closed this Jun 29, 2019
@baiwei0427
Copy link
Collaborator Author

New PR: #3100

mssonicbld added a commit that referenced this pull request Jan 25, 2024
…lly (#17889)

#### Why I did it
src/sonic-swss
```
* 41330abf - (HEAD -> master, origin/master, origin/HEAD) [Build] Support to collect the test coverage in cobertura format (#3019) (33 hours ago) [xumia]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants