Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
BGP as a service agent changes.
Function: When a VM tries to establish BGP session it will connect o its gateway or DNS ip. For example in subnet of 1.1.1.0/24, VM will try to connect on well defined BGP port to either 1.1.1.1(=gw) or 1.1.1.2(=DNS). Agent sees this traffic and creates a NAT. The calculation of NAT is done as follows: Pkt from VM: source: VM-SIP, destination: DIP(gw/dns), source port: VM-sport, destination port: BGP-port. After NAT: source: vrouter IP, destination: Control-node#1(if DIP was gw), Control-node#2(if DIP was DNS), source port: BGP-router port, destination port: BGP-port. Config object(bgp-router) will provide BGP-router port used in NAT. If new set of control-node changes flows should use new set given. In this feature agent implements following: - Add dependency between VM interface, BGP as service. - BGP as a service node resides under VmInterface. Using adjacencies it travels to bgp-as-a-service to extract IP for SNAT and bgp-router (adjacent to for source port nat. - Flow - Keeping track of bgp-as-a-service object in VMI to populate flow. For destination it uses control-node for destination IP. - Control-node - rebake all Vm interfaces to reflect changes. - ifmap - white-listing of nodes bgp-as-a-service, vmi, bgp-router. - Reserves a set of BGP port which can potentially be used in bgp-router object. This is provided via contrail-vrouter-agent.conf and agents binds on to these ports, so that host does not use it. Pending items: - UT. Closes-Bug: 1518047 Conflicts: src/ifmap/ifmap_graph_walker.cc src/vnsw/agent/oper/agent.sandesh src/vnsw/agent/pkt/pkt_flow_info.h Change-Id: I12c8d019b4b6805cc5517ad595f4d2c8e9956100
- Loading branch information
1 parent
bd40bd8
commit b515dbf
Showing
27 changed files
with
1,155 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (c) 2016 Juniper Networks, Inc. All rights reserved. | ||
*/ | ||
|
||
#ifndef vnsw_agent_audit_list_hpp | ||
#define vnsw_agent_audit_list_hpp | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// Template function to audit two lists. This is used to synchronize the | ||
// operational and config list for Floating-IP, Service-Vlans, Static Routes | ||
// and SG List | ||
///////////////////////////////////////////////////////////////////////////// | ||
template<class List, class Iterator> | ||
bool AuditList(List &list, Iterator old_first, Iterator old_last, | ||
Iterator new_first, Iterator new_last) { | ||
bool ret = false; | ||
Iterator old_iterator = old_first; | ||
Iterator new_iterator = new_first; | ||
while (old_iterator != old_last && new_iterator != new_last) { | ||
if (old_iterator->IsLess(new_iterator.operator->())) { | ||
Iterator bkp = old_iterator++; | ||
list.Remove(bkp); | ||
ret = true; | ||
} else if (new_iterator->IsLess(old_iterator.operator->())) { | ||
Iterator bkp = new_iterator++; | ||
list.Insert(bkp.operator->()); | ||
ret = true; | ||
} else { | ||
Iterator old_bkp = old_iterator++; | ||
Iterator new_bkp = new_iterator++; | ||
list.Update(old_bkp.operator->(), new_bkp.operator->()); | ||
ret = true; | ||
} | ||
} | ||
|
||
while (old_iterator != old_last) { | ||
Iterator bkp = old_iterator++; | ||
list.Remove(bkp); | ||
ret = true; | ||
} | ||
|
||
while (new_iterator != new_last) { | ||
Iterator bkp = new_iterator++; | ||
list.Insert(bkp.operator->()); | ||
ret = true; | ||
} | ||
|
||
return ret; | ||
} | ||
#endif |
Oops, something went wrong.