Extract the next packet to send from a TCP connection in respect with the current sliding window value.
[p,rp]=NARVAL_I_TcpSlidingWind(sw,ni,nets,rp,t)
sliding window of the node.
node index.
emission network matrix.
packet manager.
current time.
packet.
NARVAL_I_TcpSlidingWind extracts the next packet ps to send from a TCP connection generated at the node ni. sw is the current value of its sliding window. t is the current time. nets corresponds to the emission network matrix. rp represents the packet manager.
[path]=NARVAL_F_NARVALPath();//path to NARVAL module path=path+'/demos/';//folder path load(path+'RoutingTables_topo_100.dat','pt','rt1','rt2','rt3','rt4','rt5');//loading of the network routing tables load(path+'topo_100.graph','g');//loading of the network graph n=100;//network size bs=15;//constant buffer size [nd,nf]=NARVAL_F_Random_i_j(n);//generation of connection extreme nodes L=1000;//network square area side t=1;//current time [probroute]=NARVAL_StartRouteProb(rt1,rt2,rt3,rt4,rt5,pt,n,L);//initialization of the route manager 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 cpmax=10;//maximal quantity of packets per connection ct=1;//connection type selection index: creation of TCP connections swmin=1; rtmin=1; rtmax=50; pr=0.90;//probability threshold [swi,rti]=NARVAL_I_TcpStartPar(n,swmin,rtmin);//initialization of the TCP parameters for each node [networks,rp]=NARVAL_I_ConManagerNodes(nd,n,bs,cpmax,networks,rp,ct,pr);//generation of connections ind=find(networks(:,$) lt gt 0);//location of nodes where TCP packets are stored on the emission network i=ind(1);//first node [sp,p]=NARVAL_I_BufferExtract(i,networks)//extraction of the buffer of the node i rp(1:sp,:)//packet manager state [p,rp]=NARVAL_I_TcpSlidingWind(swi(i),i,networks,rp,t);//application of NARVAL_I_TcpSlidingWind p//packet to send | ![]() | ![]() |