Acknowledge TCP or MPTCP packets inside the emission network matrix and the packet manager.
[rn,sn,ncp,rp,nets]=NARVAL_I_AckPacketsNet(rp,nets,p,sw)
packet manager.
emission network matrix.
current packet.
sliding window.
route ID followed by p.
connection source node.
quantity of packets belonging to the same connection (p) after the acknowledgement.
NARVAL_I_AckPacketsNet acknowledges the TCP or MPTCP packet of index p inside the emission network matrix nets. sw is the current sliding window of the defined connection. The sliding window is shifted to the next packet with ack=0. Thereafter all acknowledged packets are deleted from the packet manager rp. sn corresponds to the connection source node. rn is the route index followed by p. ncp represents the quantity of packets of the same connection under consideration after the acknowledgement process.
n=100;//network size [nd,nf]=NARVAL_F_Random_i_j(n);//generation of the connection extreme nodes 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 cpt=1;//connection type: TCP cpmax=6;//quantity of connection packets [rp,ps,npn]=NARVAL_I_AddConnections(rp,nd,nf,cpt,cpmax);//packet manager update with connection packets between nd and nf ip=[];//list of connection packets for k=1:length(npn) ip=ip($)+1:sum(npn(1:k)); [networks,rp]=NARVAL_I_AddPackets2Net(ps(ip),networks,rp);//emission network matrix update with connection packets end rp(1:cpmax,:)//initial state of the packet manager, no acknowledged packet vect=[1 2];//vector of packets under consideration [rp]=NARVAL_I_PacketAck(rp,vect);//the packets 1 and 2 are acknowledged, their sixth slot in the packet manager is now equal to 1 (0 before) rp(1:6,:)//new state of the packet manager, packets 1 and 2 are now acknowledged sw=3;//sliding window of the connection under studies p=2;//packet under consideration networks(nd,:)//initial state of the emission network matrix, no acknowledged packet [rn,sn,ncp,rp,networks]=NARVAL_I_AckPacketsNet(rp,networks,p,sw);//application of NARVAL_I_AckPacketsNet networks(nd,:)//new state of the emission network matrix, acknowledged packets 1 and 2 are now deleted from the emission network matrix rp(1:6,:) rn sn ncp | ![]() | ![]() |