Add new packets of a single connection inside an emission network matrix.
[net,rp] = NARVAL_I_AddPackets2Net(vp,net,rp)
vector of connection packets.
emission network matrix.
packet manager.
NARVAL_I_AddPackets2Net adds new packets vp of a single connection inside the emission network matrix net. Packets are assumed to be already stored inside the packet manager 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=[];//emission node dn=[];//destination node 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 connection cpt=ones(1,nc);//connection type: in this case TCP [rp,ps,csn]=NARVAL_I_AddConnections(rp,en,dn,cpt,cs);//generation of connection packets inside the packet manager networks(en,:)//emission network matrix initial state for each new connection starting node ip=[]; for k=1:length(csn) ip=ip($)+1:sum(csn(1:k));//index of all packets belonging to each connection [networks,rp]=NARVAL_I_AddPackets2Net(ps(ip),networks,rp);//application of NARVAL_I_AddPackets2Net end rp(1:sum(csn),:)//new state of the packet manager networks(en,:)//new state of the emission network matrix for each new connection starting node | ![]() | ![]() |
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