You are on page 1of 6

JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617 77

HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG

 Real Time Communication over Ethernet using Traffic


Smoothing with Neural Networks
Prasant Kumar Pattnaik
Department of CSE, KIST,Bhubaneswar

Rajib Mall,
Department of CSE, IIT, Kharagpur

Gurashish Singh Brar


Department of CSE, IIT, Kharagpur

Abstract—This paper provides an improvement over a methodology for providing Real Time Communication over Ethernet without
changing the existing hardware. We use Neural Networks to forecast the Ethernet Traffic and use this prediction with adaptive traffic
smoothing to give better statistical guaranty for Real Time Data. The Traffic Smoothing module installed at each station, smoothes the
non real time traffic enforcing a link rate over the non real time traffic. The prediction for the coming Ethernet utilization obtained
from the Neural Networks is used to vary the link rate for each station.

Index Terms—Real Time Communication, Traffic Smoothing, Neural Networks.

throughput, the traffic-generation rate is allowed to adapt


I. INTRODUCTION itself to the underlying network load condition. We use
Neural Networks to predict the Ethernet Traffic utilization
Ethernet continues to be one of the most popular LAN and use the prediction to vary the Non RT traffic entering
technologies. Due to the low price and robustness resulting the system.
from its wide acceptance and deployment, there has been an
attempt to build Ethernet-based real-time control networks II. FORECASTING ETHERNET TRAFFIC
for manufacturing automation. The Traffic Smoothing techniques used for providing a soft
However, it is difficult to build a real-time control network Real Time Communication over Ethernet assumed nothing
using the standard UDP or TCP/IP and Ethernet, because about the traffic pattern. The closest they come to dealing
the Ethernet MAC protocol, the 1-persistent CSMA/CD with the Traffic pattern is in the Adaptive Traffic
protocol, has unpredictable delay characteristics. When smoothing where the Refresh period for the tokens is
both real-time (RT) and non-real-time packets are adjusted depending upon the occurrence of collisions. We
transported over an ordinary Ethernet LAN, RT packets
have shown that the Ethernet Traffic can be predicted to a
from a node may experience a large delay due to (i)
reasonable degree of accuracy. This prediction can be used
contention with non-RT packets in the originating node and
with the Smoothing algorithm to obtain a better
(ii) collision with RT and non-RT packets from the other
nodes. Attempts have been made to provide the Real Time performance. A Three Layered Neural Network model was
communication over Ethernet. Some techniques which try used, with the following configuration:
not to hassle with the hardware involved and provide a  Layer1: 25 Neurons, AF: H-tangent
software solution have been suggested. The approaches fall  Layer2: 15 Neurons, AF: Sigmoidal
into two broad categories Token based protocols & Traffic  Layer3: 1 Neuron, AF: Sigmoidal
Smoothing. In the Traffic Smoothing approach, described  Inputs: 40
in [1] and [2], traffic smoother is installed between the  Outputs: 1
TCP/IP layer and the Ethernet MAC layer, and works as an The experiment was conducted on the traces of Ethernet
interface between them. The traffic smoother first gives Traffic, collected at Bellcore Morristown Research and
real-time (RT) packets priority over non-RT ones in order Engineering facility [3]. The total trace consists of over 3
to eliminate contention within the local node. It smoothes million samples taken on Aug 29, October 3, and October
the non-RT stream to reduce collision with RT packets
5, 1989. The trace contains the Ethernet data length at each
from the other nodes. This traffic smoothing can
sample and the time at which they were taken. The Neural
dramatically decrease the packet-collision ratio on the
Network was trained using the Back Propagation
network. In order to provide a reasonable non-RT
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617 78
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG
Algorithm. The input consisted of 40 consecutive samples that the Neural Network has been trained fairly well on the
and then next sample was the supervised output. The idea given sample, but this figure is misleading because when
was to use the past traffic behavior of the Ethernet Traffic the same Network is used to predict the next 500 samples
to get a prediction of the future Traffic Pattern. without any further training the prediction is not all that
The Neural Network was trained offline on an 866 MHz good. Fig. 2. shows the prediction obtained with the offline
Pentium III machine in the order of minutes. Fig. 1. shows trained Neural Network over the next 500 Bellcore
the results of the offline training. Although Fig. 1. shows samples.

Fig. 1. Results with offline training of Neural Network on the Bellcore Ethernet Traces, Red plot shows the actual Trace and the green Plot is the predicted
traffic.

Fig. 2. Traffic predicted with the offline trained Neural Network of Fig. 1.

Obviously this approach is not feasible because the offline next sample from the Bellcore traces at regular intervals. It
trained network looses its utility in a short period. The builds two set of patterns from these traces, one is a
excessive timings involved in the offline training render it training pattern and the other is traffic pattern. The Training
useless when consider from the point of view of application pattern consists of the last 41 samples taken, i.e. 40 samples
to the Smoothing algorithm, where the next prediction will for the input and the current sample as the supervised
be expected in order of milliseconds rather than hours. output. This pattern is sent to the Trainer through the Pipe
The next obvious solution to this is to go for an online connecting them. The Traffic pattern consists of the last 40
training. The idea is to keep the training process a samples including the current sample as the input for
continuous one and to keep updating the training set as time predictor. The Traffic pattern is sent to the Predictor.
The Trainer keeps a stock of last 500 patterns provided
progresses with new data and removing the older data.
to it by the Traffic Monitor and trains a Neural Network
Whenever the Neural Network is trained to an acceptable
with same configuration as used in the offline Neural
level of accuracy the new weights are used to get the next
Network. The Trainer continuously sends an update on
predictions. The model used consisted of three independent weights of the Neural Network to the Predictor through the
processes: Pipe connecting them, at regular intervals.
 Traffic monitor The Predictor has a Neural Network which is updated
 Trainer whenever it receives new weights from the Trainer. It uses
 Predictor the Traffic Pattern obtained from the Traffic Monitor to get
The three processes are connected through pipes, a new prediction.
connecting Traffic Monitor and Trainer, Traffic Monitor Fig. 3. shows the results obtained with the online training
and Predictor, Trainer and Predictor. experiment. The prediction in this case is relatively accurate
The Traffic Monitor samples the Ethernet at a predefined when compared with the offline case.
rate. In this experiment the Traffic monitor simply took the
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617 79
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG

Fig. 3. Results obtained with the online training of the Neural Network.

Further improvement in this regard is to use the idea of sample we get the prediction for Tth sample in the future.
look ahead. Instead of using the sample, immediately This gives us an extra time equal to T*sampling rate for
following the input set, as a supervised output in the training. Fig. 4. illustrates this concept.
training we use Tth sample after the input set for training.
So while predicting instead of getting the immediate future

Fig. 4. Predicting Tth sample instead of the immediate next.

upper positive bound and a lower negative bound is


I. MODIFIED SMOOTHING ALGORITHM maintained.
The new algorithm is almost similar to the one described The Neural Network module is invoked at regular
in [1] and [2]. A buffer is still maintained where packets intervals; at each invocation it checks the total time for
received by the Smoother are stored, a credit bucket is kept which the Ethernet was idle during the previous interval.
and packets are delivered in the same manner as in the Let φ = Total idle time/ Period , be the Ethernet idle
earlier algorithm. The credits can become negative and thus fraction, so if φ is equal to 1 this means the Ethernet is
the property of allowing a peak and penalizing the future lying completely idle and if φ = 0 then the Ethernet is over
deliveries is still kept. The only difference between the new loaded. Neural Network Module maintains a working set of
algorithm and the one used earlier is that instead of having previously computed φs, from which it generates the
a refresh period, during which the credit bucket is fully current training set and the input pattern for the next
replenished, the credits in the bucket are updated at regular prediction. At every invocation the Neural Network module
intervals by Ф which is computed from the predicted traffic uses the current input pattern to get the next prediction, let
utilization. The value of Ф can be negative also, so at the ψ be the next prediction. Based on the ψ the value of credit
end of the period the credits instead of being fully update Ф is computed using the following equation:
replenished can in fact be further decreased. However a Ф = {ψ<NF | -TD*(1-(ψ/NF) Ns) 1/Ns }
window is maintained in which the credits remain, i.e. an (1)
{ψ>=NF | TI*(1-(1+NF)*(1-ψPs) 1/Ps) }
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617 80
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG
Where NF (Negative Factor) is the value of ψ below which which can react immediately and effectively to the
the Ethernet is considered as over loaded and the credit changing Traffic loads. The solution to the above problem
buckets of all nodes need to be penalized. TD (Token is to do away with the idea of having a refresh period and
Decrement) is the maximum amount by which the credits to manage the Credits in the Credit bucket directly based on
can be penalized, in other words TD is the lower bound for the prediction. So if the Neural Network predicts that the
Ф. TI (Token Increment) is maximum amount by which the Ethernet is going to be heavily overloaded during the next
credits can be replenished, or the upper bound for Ф. Ns is period, the Credit Buckets of all nodes can be immediately
the slope for the negative curve. Ps is the slope of the penalized and the effect will be felt immediately after the
positive curve. minimum initial delay ( depends upon how long it takes to
The Ф is simply added to the credits making certain that clear the NIC Buffer) which is beyond the scope of
the number of credits remain in the window bounded by the Smoother.
Max Credits ( Credit Bucket Depth) as described in the The next issue is how to change the Credits in the Credit
earlier Algorithm and Min Credits ( the lower bound on Bucket to get an effective response. As described earlier we
number of credits). have used (1) to obtain the amount of change in Credits Ф
The algorithm used earlier in case of static smoothing based on the prediction of traffic load ψ. It is easy to
made no assumption about the traffic pattern, and didn’t understand that if the Ethernet is going to be heavily
care if the Ethernet was being overloaded or underutilized overloaded in the coming future we must decrease the
as a result the Throughput suffered. To improve this Traffic load by as much as possible. To do this we need to
situation the Adaptive traffic smoothing made a very basic reduce the Credits. So the parameter NF is introduced in the
assumption regarding the traffic pattern, it used the past equation, if the value of ψ < NF then this means that the
traffic behavior to get a better idea of the future patterns. If Ethernet is going to be overloaded, so the first part of the
there was no collision than it assumed that the Ethernet was equation returns a negative value. On the other hand if ψ
being underutilized so it decreased the refresh period. >NF then it is assumed that the Ethernet is going to be
However if there was a collision than it concluded that the underutilized and thus the credits should be increased
Ethernet was being overloaded since due to BEB a collision which is done by the 2nd part of the equation, by returning
may result in another collision after 2τ ( τ being the max a positive value. For ψ=NF we assume that the Ethernet is
transmission) with a probability of 0.5. So it increased the ideally utilized and no change to the Credit Bucket is made.
Refresh period. However the change in the refresh period Since the only thing about the function f, where Ф=f(ψ),
will be reflected after a delay equal to the refresh period. that we know is that it should be monotonically increasing
Since the information available to this algorithm about the and it should not be flat over any range. So (1) is used
future traffic behavior is very inadequate and not reliable so which represents a general monotonically increasing curve
the above approach is taken, that is very pessimistic. without any flat regions, and which can take the shape of
In our case the Neural Network provides a prediction of linear as well as Step function.
the coming behavior of Ethernet to a reasonable degree of
accuracy, and changing the Refresh period using the
prediction doesn’t have much effect because the prediction II. TESTBENCH
is about the immediate future where as the effect will be felt Traffic Smoothing to be effective in providing Real time
much later. In fact this can have a negative impact. Communication requires that the Smoothing module should
Consider the case where P is the period after which the be installed at all nodes connected to the Ethernet, i.e. no
Neural Network is invoked and say at time t the Neural packet should enter the LAN bypassing the Smoothing
Network is invoked and it predicts that the Ethernet is module. So to implement this Ethernet was simulated. The
going to be overloaded in the next period. Based on this Traffic Smoothing module along with the Neural Network
information we increase the refresh period to reduce traffic was coupled with this simulation. The Simulation follows
load, now suppose earlier Refresh period was greater than P an event driven schedule. Two types of event can occur in
itself, then this prediction has no effect because in the this simulation. First is an NIC attempting to send a packet
coming period we are making no changes to the traffic when the Ethernet is laying idle, note in this case more than
load. Now consider the period following the next one. The one such events can occur at the same time resulting in
effect of last prediction will be felt in this period. If the collision. The other type of event is related to Traffic
Ethernet is underutilized in this period than our prediction Smoother in particular the Adaptive and the Neural Net
will be having a negative impact, because the traffic load is smoother. These events are periodic and activate the
reduced when it should have been increased. corresponding algorithm. Occurrence of every event causes
The essence of the above discussion was to illustrate the global time to progress.
that the model used earlier reacts slowly to changes The Real Time Traffic is assumed to be periodic, with a
suggested to it which can have a negative impact on fixed relative deadline. The Non Real Time Traffic is
throughput and Real Time Packet Loss ratio when used generated randomly. Each station on the Ethernet has a
with Neural Network. What is needed is a mechanism
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617 81
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG
Max Period and all the Non Real Time packets are Time Traffic. So the actual traffic during the next sample
generated after intervals chosen randomly between the (0, period is not congested, opposite to the prediction. Thus we
Max Period). So Max Period fixes the Non Real Time have a paradox that betters the prediction, further it is from
Traffic load. actual traffic. A solution to the above problem is to use a
The Neural Network module is invoked periodically and Neural Network to predict the Non Real Time traffic
at every invocation it gives the prediction for the Ethernet coming at the Traffic Smoother instead of predicting the
idle fraction for the next period. global traffic at the Ethernet. In this case the outcome of
prediction doesn’t affect its input set. However in this case
the Smoothing algorithm losses the vital Global Traffic
information. The presence of this feedback loop further
III. PERFORMANCE ANALYSIS
enforces the need for online training. Since there is no
The Neural Network used with the Neural Smoothing direct way of verifying whether the prediction is accurate or
module in the experiment runs was trained online initially not, the only way is to look at the final plots of the
during a single run. But in later test runs for obtaining Throughput and the Deadline Miss ratio.
plots, the Neural Network used the same weights and the Fig. 5. shows the plot for the throughput. The plot was
online training was discontinued. The reason for obtained with 10 stations with varying degree of traffic
discontinuing the online training was the prohibitive load. The X axis gives the maximum period between two
timings and load on the system, of the simulation and the consecutive NRT packets for each station. So the traffic
Feed forward back propagation algorithm of the training load decreases with increasing period.
module when run together. All the results presented here Fig. 6. gives the plot for the Real Time Packet Loss Ratio
are offline. Using online training will result in better results obtained with the same configuration as the one in fig. 5.
as it gives better prediction compared to the offline case. The X axis again gives a decreasing traffic load for each
Another problem faced in our case which has a negative station.
impact on the prediction results is the presence of feedback The plot for the Deadline Miss Ratio shows a lot of
loop. Since the prediction from the Neural Network is used variance, this is because the simulations are not run long
for smoothing traffic at all nodes so an accurate prediction enough. Since the traffic generation is random so the
results in a change in traffic pattern then expected. Take for Deadline miss ratio varies. However if the simulation is
example a case when the Neural Network predicts that the allowed to run for long time the plot smoothens.
next Sample period will experience traffic congestion. This
makes the Smoothing Algorithm to reduce the Non Real

Fig. 5. Plot of the Throughput for the static, HIMD and Neural Traffic Smoother. Red plot is for Static Smoother, green is for
Adaptive Smoother and Blue is for Neural Network based Traffic Smoother.
JOURNAL OF COMPUTING, VOLUME 2, ISSUE 8, AUGUST 2010, ISSN 2151-9617 82
HTTPS://SITES.GOOGLE.COM/SITE/JOURNALOFCOMPUTING/
WWW.JOURNALOFCOMPUTING.ORG

Fig. 6. Plot of Real Time Packet Loss Ratio, with 10 stations always ready to send. The Red plot is for Static Smoother, Green
for Adaptive Smoother and Blue for Neural Net based Smoother.

Systems,'' in Proceedings of IEEE Real-Time Technology and


Applications Symposium, pp. 192-202, 1999.
I. CONCLUSION [2] Seok-Kyu Kweon, Kang G. Shin and Gary Workman, ``Achieving
The bottle neck in the design is the excessive Real-Time Communication over Ethernet with Adaptive Traffic
Smoothing,'' in Proc. IEEE Real-Time Technology and Applications
computational complexity of the Feed forward Back
Symposium, pp. 90-100, June 2000.
propagation algorithm used for Training the Neural [3] W. E. Leland and D. V. Wilson, ``High time-resolution measurement
network. The Traffic Smoother will not be of much use if and analysis of LAN traffic: Implications for LAN interconnection”
the online training module consumes most of the Processor Proc. IEEE INFOCOM '91, April 1991, pp. 1360-1366
resources. However since the Neural Network is used to
predict the Global traffic rather than local traffic so just one
Node in the Ethernet needs to do the online training.
Whenever the Network is Trained well enough the Node
can simply broadcast the network weights and the Traffic
Smoothing module at each node can update the weights.
Another solution is to distribute the Training load over
all nodes. In this case, if N is the number of nodes
connected to the Ethernet, then the Training set T is divided
into N sets, where the set 1 contains elements { T1, TN+1,
T2N+1,…} set 2 contains the elements { T2, TN+2,T2N+2,…}
and so on. Then the node i trains a Neural Network on the
Training set i. The Traffic Smoother at each node keeps N
sets of weights. For predicting the Traffic at the Kth
Sampling interval the Traffic Smoother uses the KmodN
weight set. The Training module at each node sends a
broadcast of the new weight set with its id at regular
intervals and each Traffic Smoother updates the
corresponding weight set. What we gain through this is the
reduction in size of the Training Set. Since the Time
complexity of the Back Propagation Algorithm is O (n)
where n is the size of the Training Set, we get a speedup
equal to N.

REFERENCES
[1] Seok-Kyu Kweon, Kang G. Shin and Qin Zheng, ``Statistical Real-
Time Communication over Ethernet for Manufacturing Automation

You might also like