Add new connections inside the packet manager.
[rp,ps,csn] = NARVAL_I_AddConnections(rp,en,dn,ct,cs)
packet manager.
emission node of each new connection.
destination node of each new connection.
type of each new connection.
size of each new connection.
vector of packets ready to send.
size of each new connection correctly added to the packet manager.
NARVAL_I_AddConnections adds new connections inside the packet manager rp. New connections are assumed to be stored inside 4 vectors, e.i. the emission node of each new connection en, their destination node dn, their type ct and their size cs. ps corresponds to the vector of packets ready to send. csn represents the size of each new connection correctly added to rp.
n=100;//network size bs=15;//constant buffer size network=NARVAL_I_EmptyBufferNet(n,bs);//initialization of the reception network matrix networks=NARVAL_I_EmptyBufferNet(n,bs);//initialization of the emission network matrix tpmax=n*bs;//maximal quantity of packets simultaneously supported by each network matrix rp=NARVAL_I_EmptyPacketMan(tpmax);//initialization of the packet manager nc=5;//quantity of new connections en=[];//vector of emission nodes dn=[];//vector of destination nodes for i=1:nc [nd,nf]=NARVAL_F_Random_i_j(n);//generation of connection extreme nodes en=[en nd]; dn=[dn nf]; end cpmax=6;//maximal connection size cs=int(cpmax*rand(1,nc))+1;//size of each new connection cpt=ones(1,nc);//connection type: TCP [rp,ps,csn]=NARVAL_I_AddConnections(rp,en,dn,cpt,cs);//application of NARVAL_I_AddConnections rp(1:sum(csn),:)//display of new packets information ps csn | ![]() | ![]() |
Dr. Foued Melakessou
Research Associate
Interdisciplinary Centre for Security, Reliability and Trust
Room F106
University of Luxembourg
6, rue Coudenhove Kalergi
L-1359 Luxembourg-Kirchberg
E-mail: foued.melakessou@uni.lu
Tel: (+352) 46 66 44 5346