NS-3 implementation of deterministic networks/time sensitive networks
Bandwidth Reservation is a very important requirement for Deterministic Networks. The flows marked as detnet flows ask for bandwidth reservation and the routers need to explicitly reserve required bandwidth for the detnet flows. For this scenario we create a queue disc BwResv bandwidth reservation queue disc for ns-3 nodes. This is implemented at traffic-control layer of ns-3.
Different components of BwResv queue disc are
1) Flow Table
2) Active flows list for detnet flows
3) Active flows list for other flows
4) Priority for detnet flows to accept packets upto their bandwidth reservation limit
5) Bandwidth reservation and allocation algorithm
- TABLESIZE macro i.e number of rows. (we consider 1024)
- At each packet arrival flow hash is used to index the flow entry in flowtable by hash%TABLESIZE
- Each row in flowtable is a vector in which new elements are added when there are collisions. A liner search finds out if an entry already exists in a row when a flow arrives.
- Each entry consists of
FlowHash,Bw Requirement,FlowQueuelength,FlowType
- Separate activlist is maintained for each type.
- Activelist contains only pointers to flowtable entries.
- At every packet arrival, for all the flows in the detnet activelist, queues are decremented with
BwReq*deltadelta is the time difference between packet arrivals. The sum of all the decrements (detnet_consumption) is calculated - If
delta*link_rateis greater thandetnet_consumptionwhich means that, the output link still has some capacity to serve after detnet flows were served. In this case, the other flows queues are decremented equally with the remaining capacity available.
- At every packet arrival, packet is classified and its flowtable entry is obtained.
- It's queue is checked against a
THRESHOLD - Packet is enqued in only if flow queue is less that
THRESHOLD. If flowqueue is zero, its is added to flow type activelist. - If the packet is accepted, its queue is incremented with its
PktSize
Along with bandwidth reservation, packet replication is very important to ensure the reliability of packet delivery in deterministic network.
Work in progress...
We modified ns-3 onoff application to send user data in the packet payload. We reserved the first 12 bytes for sending BwResev data. The rest of the payload can be anything.
Format of first 12 bytes in payload (String data)
XXXXYbps T
XXXX is a 4 digit number
Y is K/k/M/m/G/g etc. for representing kilo,mega,giga etc.
T is either "D" or "O". D is for detnet flows and O for Other flows.
We add an attribute "Buffer" in onoff application to send these 12 bytes. Usage:
onoff.SetAttribute("Buffer",StringValue("1000Kbps D")); //12 bytes reserved
Configuration of BwResv Queue :
TrafficControlHelper tchBottleneck;
tchBottleneck.SetRootQueueDisc ("ns3::BwResvQueueDisc","RateOther",DataRateValue(DataRate("1000kbps")),"RateDetnet",DataRateValue(DataRate("10000kbps")));
tchBottleneck.Install(d2d3); // d2d3 is a device container
ns-3-dev/scratch/detnet_2.cc- ns-3 experiment filens-3-dev/src/traffic-control/bw_resv.cc- BwResv QueueDisc implementationscriptsfolder contains bash scripts for collecting ns-3 throughput output data and gnuplot files.scripts/resultsgnuplot .gp files and plots.