<< NARVAL_I_AddConnections NARVAL NARVAL_I_BufferExchange >>

NARVAL >> NARVAL > NARVAL_I_AddPackets2Net

NARVAL_I_AddPackets2Net

Add new packets of a single connection inside the emission network matrix.

Calling Sequence

[nets,rp]=NARVAL_I_AddPackets2Net(vp,nets,rp)

Parameters

vp :

vector of connection packets.

nets :

emission network matrix.

rp :

packet manager.

Description

NARVAL_I_AddPackets2Net adds new packets vp of a single connection inside the emission network matrix nets. Packets are assumed to be already stored inside the packet manager 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=[];
dn=[];
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

Dependency

NARVAL_I_BufferExtract, NARVAL_I_BufferExchange, NARVAL_I_DeletePackets

Author

http://wwwen.uni.lu/interdisciplinary_centre_for_security_reliability_and_trust

Contact

<< NARVAL_I_AddConnections NARVAL NARVAL_I_BufferExchange >>