## 2 Proposed Solution
### AmoebaNet's Programming Primitives  
One of the key features of AmoebaNet is to achieve dynamic programmability and to make it possible for scientific applications to program networks dynamically. In order to implement such a feature, AmoebaNet provides different programming primitives, which can provide applications that realize network as a service (NaaS). The list of programming primitives supported by AmoebaNet is shown below:  
* initial_config(): By using initial configuration programming primitive, an application can configure the gateway switches' interfaces/ports. The gateway switches are connecting the internal campus networks with the external networks. To provision the layer 2 end-to-end network paths required switching of different path segments at gateways. The initial configuration will help to setup VLANs and perform operations such as push, pop, and swap VLAN tags from internal to external network and vice versa. An example of the layer 2 end-to-end network path is shown in Figure 2, gateway switches (A and B) are configured for two sites (A and B), respectively. In fact, the path segments is made of different VLANs (VLAN1 \(\leftrightarrow\) VLAN2 and VLAN2 \(\leftrightarrow\) VLAN3). * lock()/unlock(): It is a new feature introduced in our proposed solution, which is called lock/unlock. As per best of our knowledge, no API of ONOS is found, which is providing the same functional features to applications. AmoebaNet provides the lock/unlock mechanism to prevent the resource contention and unsynchronized access of resources among the applications. When an application sends the query request for available resources, then the entire session will be locked for that request. It keeps the lock until reservation requests are committed or the default session time expires (i.e., five seconds). Some applications (like BigData Express) require to hold the resources for a while for coordination purpose and others have not such type of requirements. Therefore, it can be claimed that AmoebaNet supports wide spectrum of applications; it provides the flexible usage of lock/unlock mechanism as per the requirements of applications. Simply, an application can enable or disable the lock/unlock during the query request. At this moment, AmoebaNet supports a very high-level coarse-grain lock/unlock, but our target is to provide the fine-grain for lock/unlock in future. * query_virtual_netslice(): The current intent framework of ONOS can provide a functionality to install multi-to-single host or single-to-multi host paths. However, this intent framework is not providing the functionality of virtual slicing based on VLANs along with QoS-guaranteed features. Figure 1: Architecture of the AmoebaNet solution. In our proposed AmoebaNet solution, we added this feature by using virtual network slicing programming primitives. * query_path(): By using the query path programming primitive, an application can view the current setting of a particular path;
* query_host_to_host(): This programming primitive helps to view the available maximum bandwidth between two DTNs in a network segment;
* query_host_to_gateway(): To check the available bandwidth from a host to a gateway switch;
* create_path(): Using this programming primitive an application can dynamically establish a layer 2/3 path between two end points.