<< NARVAL_I_AckPacketsNet NARVAL NARVAL_I_AddPackets2Net >>

NARVAL >> NARVAL > NARVAL_I_AddConnections

NARVAL_I_AddConnections

Add new connections inside the packet manager.

Calling Sequence

[rp,ps,csn] = NARVAL_I_AddConnections(rp,en,dn,ct,cs)

Parameters

rp :

packet manager.

en :

emission node of each new connection.

dn :

destination node of each new connection.

ct :

type of each new connection.

cs :

size of each new connection.

ps :

vector of packets ready to send.

csn :

size of each new connection correctly added to the packet manager.

Description

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.

Examples

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

Dependency

NARVAL_F_ColumnExtract

Authors

Foued Melakessou

Contact

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

Home Page


<< NARVAL_I_AckPacketsNet NARVAL NARVAL_I_AddPackets2Net >>