More information on bug: BGPaaS port range - Currently default is hard coded in schema transformer to be between 50000 and 50512. Though user can use schema.conf to update it but it would be better to push it to global-vrouter-config. This will help agent in identifying range as well as port start value which will be used to support multiple vmi on same Bgpaaas object. Solution for supporting multiple VMI on same BgpaaS object: Schema transformer has a port range reserved for BgpaaS. Say its 50000-50512. For every BGPaaS object created, ST allocates one port from this range. Then this BGPaaS will be linked to multiple VMI, hence all these VMI will use same BGPaaS port. However as mentioned above in bug, CN needs to identify all these sessions uniquely, because of which agent will have to tweak the VMI port for this BGPaaS object. Port derivation in agent: Value definitions: Say there are two BGPaaS object B1(port 50000) and B2(port 50001). B1 is connected to VMI-10 and VMI-11 while B2 is connected to VMI-21 and VMI-22. Also lets define two port ranges- PR and DPR. PR is the original port range as in ST, so PR = (50,000 - 50,512). DPR is the derived port range depending on max session supported. Also assume that max shared session is 5 per BGPaaS. For each shared VMI agent will allocate a local index, ranging from 0-4(max session = 5). Deriving port range: Total_derived_ports = (PR_max - PR_min) * (Max_shared_session - 1) DPR_min = (PR_min + 1) DPR_max = (DPR_min + Total_DPR_ports) Using this Total_DPR_ports = (50512 - 50000) * (5 - 1) = 2048. DPR_min = 50513 DPR_max = 52561 Note that if DPR_max exceeds process limit of ports, then bucket should be carved out in reverse manner i.e. DPR_max = (PR_max - 1) DPR_min = (DPR_max - Total_DPR_ports) Hence: DPR_min = 49999 DPR_max = 47951 Encode Method: First VMI session to a BGPaaS object will always use the original port given by ST. Any subsequent session on VMI connected to same BGPaaS will use port from DPR. Say VMI-11 comes up first so VMI-11 will get local-index as 0. Now VMI-12 comes up and agent will see that its the second VMI and hence give local-index as 1. If VMI_local_index = 0 then VMI_Port = B1_port else VMI_port = (DPR_min + ((B1_port - PR_min) * (Max_shared_session - 1)) + (VMI_local_index - 1)) VMI11 port = 50000 (VMI_local_index is 0). VMI12 port = (50513 + ((50000 - 50000) * (5 - 1)) + (1 - 1)) = 50513 Now if VMI11 goes off so local index of VMI11 is freed. If any other VMI comes up it will use the first free local index for a BGPaaS object. In this case VMI13 will get 0 and hence use port 50000. For B2 with port 50001. VMI21 port = 50001 (VMI_local_index is 0). VMI22 port = (50513 + ((50001 - 50000) * (5 - 1)) + (1 - 1)) = 50517 VMI23 port = (50513 + ((50001 - 50000) * (5 - 1)) + (2 - 1)) = 50518 Decode Method: Need to know Max_shared_session, PR_min, PR_max Using derived port range logic given above, DPR_min and DPR_max can be calculated. if (port is in range PR_MIN, PR_MAX) VMI_port = port else VMI_port = ((port - DPR_min) / (Max_shared_session - 1)) + PR_MIN VMI11 original = 50000 (falls in PR_min and PR_max) VMI12 original = ((50513 - 50513) / 4) + 50000) = 50000 VMI21 original = 50001 (PR_min and PR_max) VMI22 original = ((50517 - 50513) / 4) + 50000) = 50001 VMI23 original = ((50518 - 50513) / 4) + 50000) = 50001 All the above algorithm mandates to push following parameters to global-vrouter-config: - BGPaas port start - BGPaas port end - BGPaas max shared session.