Analysis of the v2s Data Structure for Single Path Mapping in Elastic Optical Network Virtualization Java Implementation

Analysis of the v2s Data Structure for Single Path Mapping in Elastic Optical Network Virtualization Java Implementation1. Virtual Network Mappingv2s Data Structure v2s represents the data structure for mapping a virtual network to a physical network, which is an object of the Req2Sub class. The design of this class is as follows:public class Req2Sub { public int map; // Mapping status, specific values are detailed in the STATE values of Parameters below public int maptime; // Mapping time, usually represented by the index of the time window public int tryMapTime = 0; // Number of mapping attempts public LinkedList<Integer> snode = new LinkedList<Integer>(); public LinkedList<SpathFlow> pathFlow = new LinkedList<SpathFlow>(); public LinkedList<Integer> flowLen = new LinkedList<Integer>(); public LinkedList<Integer> startSlotNo = new LinkedList<Integer>(); // Allocated spectrum starting index public LinkedList<Integer> slotNum = new LinkedList<Integer>(); // Number of allocated spectrum slots} Here, map indicates the mapping status. We adopt virtual network mapping in a dynamic environment, and the specific mapping statuses are as follows:

public class Parameters {

//mapState: The state of VN.

//1:STATE_NEW

static int STATE_NEW = 1;

static int STATE_MAP_LINK = 2;

static int STATE_DONE = 3;

static int STATE_EXPIRE = 4;

static int STATE_MAP_NODE_FAIL = 5;

static int STATE_MAP_FAIL = 6;

static int STATE_MAP_NODE = 7;

static int STATE_MAP_Link_FAIL = 8;

static int STATE_MAP_SUCC = 9;

static int STATE_MAP_KEY_FAIL = 10;

}

2. Explanation of s2v Data Structure

2.1 snode Object

snode is an object of LinkedList<Integer>. The reason for using this doubly linked list data structure is that in different environments, the number of virtual nodes and physical nodes varies. During the virtual network mapping process, the addition of node mapping results is as follows:

v2s[index].snode.add(i, snode);

The reason for adopting this method of adding mapping results is primarily that virtual nodes and virtual links are represented by indices, i.e., 0,1,…, for example, 0->2 indicates that virtual node 0 is mapped to physical node 2. To deepen the understanding of this object, the following introduces the LinkedList<Integer> doubly linked list.

LinkedList<Integer> is a doubly linked list implementation in the Java Collections Framework, specifically for storing Integer objects. It implements the List and Deque interfaces, possessing the characteristics of a linked list data structure. Basic operations are as follows:

add(E e): Add an element to the end of the listadd(int index, E element): Insert an element at the specified positionaddAll(Collection<? extends E> c): Add all elements of the collection to the endaddAll(int index, Collection<? extends E> c): Insert all elements of the collection at the specified positionData structure is as follows:Analysis of the v2s Data Structure for Single Path Mapping in Elastic Optical Network Virtualization Java Implementation

2.2 pathFlow Object

Adding link mapping results is as follows:

v2s[index].pathFlow.add(i, pathFlow);

where i is the i-th virtual link, and the created path pathFlow is as follows:

SpathFlow pathFlow = new SpathFlow();

pathFlow.link = link;

pathFlow.len = pathLength; // Length of the path

pathFlow.bw = reqs[index].link[i].bw; // Bandwidth of the i-th virtual link

where pathLength and link are created as follows:

int pathLength = 0;

LinkedList<Integer> link = new LinkedList<Integer>();

while (p[i][snodeMid1] != -1) {

snodeMid = p[i][snodeMid1];

link.add(pathLength, snodeMid1); // link places the physical node on the path at the pathLength position

pathLength++; // Path length

snodeMid1 = snodeMid;

}

link.add(pathLength, snodeMid1);

where pathFlow is an object of the SpathFlow class, and the SpathFlow class is described as follows:

public class SpathFlow {

public int len; // The length of the flow.

public LinkedList<Integer> link = new LinkedList<Integer>(); // The path of the flow

public double bw; // The bandwidth of the flow.

}

2.3 flowLen, startSlotNo, and slotNum Objects

These three objects record whether it is a single path mapping or multi-path mapping, the starting position of the allocated spectrum slots, and the number of allocated spectrum slots, implemented by the following statements:

v2s[index].flowLen.add(i, 1); // 1: single path link mapping; i: the i-th link.

v2s[index].startSlotNo.add(i, ret[i][0]); // Allocated starting index

v2s[index].slotNum.add(i, ret[i][1] – ret[i][0] + 1);

One question: How to implement multi-path virtual link mapping?

Leave a Comment