<< NL_I_TCPNetworkInit NL_I: Internet NL_I_TrafficSimulation >>

NARVAL >> NL_I: Internet > NL_I_TCPSlidingWindow

NL_I_TCPSlidingWindow

Extract the next packet to send from a TCP connection in respect with the current sliding window value.

Calling Sequence

[P,R] = NL_I_TCPSlidingWindow(S,I,Net,R,T)

Arguments

S :

Sliding window of the node.

I :

Node index.

Net :

Emission network matrix.

R :

Packet manager.

T :

Current time.

P :

Packet.

Description

NL_I_TCPSlidingWindow extracts the next packet P to send from a TCP connection generated at the node I. S is the current value of its sliding window. T is the current time. Net corresponds to the emission network matrix. R represents the packet manager.

Examples

[path]=NL_F_NLPath();//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]=NL_F_RandIntNiNj(n);//generation of connection extreme nodes
L=1000;//network square area side
t=1;//current time
[probroute]=NL_I_RouteManagerInit(rt1,rt2,rt3,rt4,rt5,pt,n,L);//initialization of the route manager
network=NL_I_NetworkMatrixInit(n,bs);//initialization of the reception network matrix 
networks=NL_I_NetworkMatrixInit(n,bs);//initialization of the emission network matrix
tpmax=n*bs;//maximal quantity of packets simultaneously supported by each network matrix 
rp=NL_I_PacketManagerInit(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;//initial sliding window
rtmin=1;//initial retransmission time
rtmax=50;//maximal retransmission time
pr=0.90;//probability threshold
[swi,rti]=NL_I_TCPNetworkInit(n,swmin,rtmin);//initialization of the TCP parameters for each node
[networks,rp]=NL_I_ConnectionManager(nd,n,bs,cpmax,networks,rp,ct,pr);//generation of connections
ind=find(networks(:,$) <> 0);//location of nodes where TCP packets are stored on the emission network
i=ind(1);//first node
[sp,p]=NL_I_NodeBufferExtract(i,networks)//extraction of the buffer of the node i
rp(1:sp,:)//packet manager state
[p,rp]=NL_I_TCPSlidingWindow(swi(i),i,networks,rp,t);//application of NL_I_TCPSlidingWindow
p//packet to send

Dependency

NL_I_NodeBufferExtract

Report an issue
<< NL_I_TCPNetworkInit NL_I: Internet NL_I_TrafficSimulation >>