DDo SDOCcontent
DDo SDOCcontent
CHAPTER 1
INTRODUCTION
prevents them from entering or spreading on the network. Attacks are any kind of
attempts to expose, alter, disable, destroy, steal or gain unauthorized access to or make
unauthorized use of an asset.
Attacks are of two types, passive and active attacks. Passive attack is when a
network intruder obtains information and does not cause any damage to the network.
Active attack denotes a potential change in data either in the target or on the way to the
target. Comparatively, active attacks are more easily detectable than passive attacks due
to the change in data. But, in case of recovery from the attack, attack attacks are more
expensive. In order to prevent the loss caused by active attacks, it is much wiser to abate
the attack as much early as possible before nearing the target, which can be otherwise
termed as ‘proactive mechanism’.
packet. The switch sends every packet going to the same destination along the same path,
and treats all the packets the exact same way. In a classic SDN scenario, rules for packet
handling are sent to the switch from a controller, an application running on a server
somewhere, and switches (also known as data plane devices) query the controller for
guidance as needed, and provide it with information about traffic they are handling.
Controllers and switches communicate through a controller's south bound interface,
using OpenFlow or other protocols [22]. OpenFlow is an open standard for a
communication protocol that enables the control plane to interact with the forwarding
plane.
Application
Business Applications
Layer
c OpenFlow
Infrastructure
Layer
From the figure 1.1, hierarchy of layers in SDN can be observed, which
makes SDN more agile and flexible than traditional network. SDN offers direct
programmability, centralized management at reduced Capital and Operational expenses.
Any device or network connected to the internet and accepting data, has the
possibility of suffering DDoS attack and SDN is no exception. All components of SDN
namely, controller, switches, devices may encounter a flooding attack and links between
them may be congested by attackers.
Defending DDoS attack can be done in three ways as follows,
Among the above mentioned methods, first and last are very expensive,
tedious and causes a lot of resource wastage just to detect the attack. Though first
method seems to be perfect, it is impossible to monitor ever system connected to the
internet and maintain its loyalty status. Last method may prove to be successful in
securing the target but intermediate network resources are wasted until the attack packets
reach the target and certainly they may cause link congestion.
mechanism, increased network visualization and more granular network control are
powerful and can be leveraged to the best for detecting and mitigating DDoS attack. And
the topic of early detection, meaning that detecting attack at the forwarding device near
to the attack source, becomes important in improving the efficiency of second method.
It is clear that detecting DDoS attack near to the source is needed which is a
proactive approach from the view of victim or target of the DDoS attack, that is, stopping
the attack before even it spreads around the target system. In order to be proactive, the
network between source and target must be wise enough to know what is being sent
between whom and at which rate. Obviously, all routing information available with each
router must be known to all other routers in the network or a centralized master router,
which itself makes the links congested, in case of the network being a traditional one.
Fortunately, in SDN, all switches are controlled by controller which has the access to the
forwarding tables (flow entry table) of each switch. Controller can collect all switch
information and detect any kind of attack easily.
DDoS defense, being the need of hour in keeping web services available at
the time of attack floods directed towards service network, is concentrated. Attack
defense steps against DDoS attack (detection, trace back and mitigation) are explored.
Attack Trace back and mitigation will be worthwhile only if attack detection is correct.
Hence, an attempt is made to find the most effective mechanism to detect the attack. As
SDN is becoming more popular and replacing the traditional network set up because of
its direct programmability and centralized control, DDoS defense is developed to
implement on SDN. Two different detection mechanisms are implemented to detect their
accuracy.
7
CHAPTER 2
LITERATURE SURVEY
2.1 INTRODUCTION
DDoS defense mechanism involves DDoS attack detection, attack trace back
and attack mitigation in order. Attack detection mechanism is the most crucial among the
three. In attack detection, existence of attack in the protected network is analyzed and
confirmed and alert is spread to the corresponding authorities. In attack trace back,
source of attack and path of attack traversal is identified. In attack mitigation, suitable
filters are chosen and kept at appropriate switches to drop attack packets as near to the
attack source as possible.
Different kinds of detection and mitigation methods followed in various
literatures are surveyed below.
iii. Competition: based on the minimum Euclidean distance criterion the winning
neuron i(x) is found as follows:
i 2.1
where t represents the current instant, η(t) is the learning rate which gradually
decreases with time t, and Θj(t) is the neighborhood function which determines
the grade of learning of a neuron j according to its relative distance to the
winning neuron.
v. Repeat steps ii to iv until no significant change happens in the topological map.
ADVANTAGE:
SOM can detect specific attacks by comparing with clusters using minimum
Euclidean distance and training can be done with a sample of the whole entry space
which reduces computational complexity and time.
LIMITATION:
Detecting generic attacks is difficult and threshold of the neural network must
be adjusted accordingly for every data sample to minimize error rate in neural network
model.
In SDN, SOMs are distributed across the data plane along with OpenFlow
switches to detect packet flooding at switch level itself. DSOMs are integrated with
every switch individually and analyze flow entries at each switch. Yet this approach is
not collaborative. Figure 2.2 visualizes how DSOMs are integrated with OpenFlow
switches [2].
11
ADVANTAGE
Distributing the task of attack detection reduces burden on the controller to
make decisions for each switch by analyzing its flow table. It provides the possibility of
stopping the attack at the earliest switch possible.
LIMITATION
Along with the drawbacks of SOM, making switches intelligent violates the
significant policy of SDN, that is, using commodity hardware at data plane level.
Ensuring proper functioning of DSOMs always is essential to defend DDoS attack.
12
ADVANTAGE
Flow entry data is used by monitors to detect packet overflow and detecting
specific attacks is very simple by comparison with normal behavioral profile.
Communication between co-relators improves attack detection accuracy and preventing
attack as early as possible.
13
ADVANTAGES
Involving modified PPM, can help in quick attack trace back with SDN
environment, either as paths that connect switches or as paths between networks. Filter
invocation can be done by a switch connected to the victim, instead of victim doing it.
14
ADVANTAGES
Adaptive probabilistic packet marking helps in detecting the exact entry points
of attack, which in turn results in positioning filters at required switches in SDN
environment.
Low Rate Attack: Packets are generated to imitate the behavior of the genuine
client so as to avoid the detection. The attack traffic never floods the bandwidth
throughout the network but due to very large number of malicious devices
involved in sending attack packets, eventually victim gets overloaded and then
becomes unavailable.
Constant Rate Attack: The attacker commands zombies (malicious systems
under attacker’s control) to generate same number of packet for every interval,
which generates steady traffic with the rate greater than the legitimate traffic.
This increased rate creates sudden packet flood to disrupt the victim’s services so
quickly and it is a cost-effective approach to the attacker.
Increasing Rate Attack: The rate of this flood keeps on increasing gradually
staring from the lowest possible rate, thus delays the early detection.
Intermittent Rate Attack: This kind of attack varies the rate quiet often and
breaks for every constant or varying interval so as to avoid detection.
By comparing consequent traffic samples (that are under suspicion) with the
normal traffic of the network, increased and constant rate attacks can be detected easily.
If the traffic rate of consequent samples are increasing and greater than normal traffic
rate, it is an increasing rate attack. If the traffic rates of consequent samples remain
constant and greater than normal traffic rate, it is a constant rate attack.
Since low rate attacks disguise normal traffic, covariance between every two
sample flows is calculated to obtain correlation between those flows, which denote
degree of similarity between those flows. Covariance is calculated from the mean of the
two flows and correlation is by their covariance and standard deviation. By analyzing
similarity, low rate attack and legitimate flow can be differentiated since the type of
packets sent by legitimate users cannot be matched by that from zombies, By combining
all the three above mentioned methods, intermittent rate attack, which occurs rarely, can
be detected.
16
ADVANTAGES
ADVANTAGES
When topology of open flow switches in SDN resembles layer of rings
structure (a set of switches are connected in ring form and this ring is surrounded by
another ring), collecting flow entry information from a ring and its next ring may reveal
which ring is affected and where to activate filters. Horizontal and vertical
communication between rings of IPS denotes a collaborative approach in dealing with
attack detection and mitigation.
17
ADVANTAGE
Using graph representation for flow types and k-NN for grouping flows,
similarity between flows is calculated extensively which drastically reduces chance of
occurrence of false positives and false negatives.
at the same time in the packet flows. With basic assumption that some unique correlation
patterns occur in legitimate packet flows, it is quite hard for attackers to notice and
mimic these patterns when carrying out DoS or DDoS attacks. So, using these kinds of
patterns to judge the legitimacy of packets can be feasible. Focusing on transport and
network layers, the correlation patterns in these two layers are the co-appearances
between attributes in IP header and TCP header. These attribute pair patterns are
distinctive because certain characteristics of the operating system, network structure and
even hobbies of users can affect the values of these attributes, and thus make some
attribute pairs related. Confidence is the frequency of appearances of attributes in the
packet flows [10]. The more times an attribute pair appears in the legitimate packet
flows, the higher confidence value of this pair. CBF score for a packet is the weighted
average of the confidence of the attribute value pairs in it. The attribute pairs which
cannot be easily copied by attackers will be given a high weight. Thus, higher score of a
packet corresponds to more frequently-appeared and difficultly-copied correlation
patterns, and thus more likely to be legitimate. The legitimate packet in CBF is the one
who’s CBF score is above the discarding threshold. So on the contrary, those packets
with scores lower than the discarding threshold are regarded as attack ones.
ADVANTAGE
Discriminating packet flows based on confidence values can eliminate a huge
amount of false positives and negatives.
This approach forms the basis of the proposed method that attack packets are
eliminated based on their packet score calculate from the attribute values. Characteristics
of packet flow to a server or a user is monitored during non-attack period and a profile is
created in the name of nominal profile. From the nominal profile, attribute values are
used to calculate packet score of benign packets and mean of this packet scores provide
maximum the threshold of a packet to a benign one and above threshold value, it is
20
obviously a suspicious one. The principle is to punish the traffic whose attribute value
ratio is higher than in normal profile. If the variance among the periodic ratios in
nominal profile is too great to be reliable, it is possible to include only those attribute
values with low variance to have a more stable profile. Due to space constraints, taking
all packet flow for nominal profile may be difficult, so iceberg profiles are considered in
which only the most frequently occurring attribute values are stored along with their
ratio. Iceberg profiles are obtained either by static threshold or by adaptive threshold. In
the static threshold approach, the profile only includes those attribute values which
appear more frequently than a preset threshold ratio, say x percent. In the adaptive
threshold approach, the most frequently appearing attribute values that constitute a preset
coverage of the traffic, e.g., 95 percent, are selected. The corresponding cutoff threshold
y percent for the given coverage serves as the adaptive threshold, which is also used as
the default ratio for the absent items. With such iceberg-style profiles, the nominal
profile can be kept to a manageable size [11].
Single attributes taken for nominal profile creation are packet size, Time-to-
Live (TTL) values, protocol-type values, and Source IP prefixes.
And single attributes from TCP headers are TCP flag patterns and server port numbers,
i.e., the smaller of the source port number and the destination port number.
Attribute combinations taken for nominal profile creation are as follows:
packet-size and protocol-type,
server port number and protocol-type
Source IP prefix, TCP flags and packet size.
To maintain stability in nominal profiles, packet samples are taken at
different time intervals and maximum frequency attribute values are considered for
nominal profile creation as given in the figure 2.3.
ADVANTAGE
Though nominal profiles are created in a slightly different way from this
approach, it forms the basics and combination of attributes taken for profile creation will
always persist in DDoS defense.
21
Figure 2.3: Use Case of communication between ISP and Customer Controllers
22
ADVANTAGE
ADVANTAGE
Diversifying controller is novel idea since similar kind of vulnerabilities and
bugs may not be present in different operating systems or software, which will help in
defending a bit more at least till detection. Though replicating a controller is tedious, this
will prove effective in very critical applications and choice of replication can be given to
network administrators.
SDN architecture itself can encounter DDoS attack in five possible scenarios
as congestion in link to the controller, blind DDoS attack on controller, exhaustion of
switch memory, congestion on link between switches and flooding attack on a user under
a switch. Solutions to these scenarios can be in different aspects which are based on
table-entry, scheduling, architectural, statistics and machine learning [14].
Table-entry-based models propose solutions related to the limited table size
of switches. Each unknown packet flow needs a new entry in switch memory. This
becomes a bottleneck during a DDoS attack, which contains packets with different IP
addresses. Table entry replacement policies should use multiple parameters of flow entry
24
instead of one parameter and controller must have intermediate buffer module. And also
proper updating of flow entries is necessary.
To keep the controller alive all the time, scheduling assignment of tasks from
switches is necessary, which will also support scalability. Also separate queue for each
switch connected to the controller can be provided to prevent controller from getting
attacked through one of its switches. In the architectural aspect, monitoring and
controlling activities of the controller can be decoupled and a controller can be managed
by a master. For security and load balancing reasons, controller should be distributed.
By statistical methods, baseline profiles collected during attack-free period
are compared with suspected flow for discarding attack packets. Network switches
monitor traffic and detect congestion by monitoring the bandwidth usage. When
congestion occurs, the switch notifies the controller. Then, the controller requests
statistics from every switch that sends packets to the congested link. It determines badly
behaving flows that consume more bandwidth, and sends commands to switches to rate-
limit them.
2.16 SUMMARY
CHAPTER 3
EXISTING SYSTEM
3.1 INTRODUCTION
3.2 ARCHITECTURE
From the figure 3.1, coordination of SDN and anti DDoS mechanism can be
observed. SDN has switches and controllers to manage network administration. A switch
just performs packet forwarding or packet dropping based on the flow entries approved
by the controller for the switch. One controller controls a number of switches based on
the network capacity and layout, which can be configured by program. A controller that
manages a switch decides which kind of packets must be forwarded or dropped by the
switch and makes flow entries on the switch accordingly. When a switch encounters a
new flow of packets that does not match flow entries in it, it intimates to controller about
the new packet flow and waits for approval from controller in order to forward or drop
the packets of new flow [16].
In order to reduce the bottleneck on the controller, a separate decision module
is associated with it for knowing the credibility of new flow entries. With the help of this
module, controller can easily inform switches about which packets to forward and which
packets to drop. The reason for keeping a separate module for deciding on the legitimacy
of packets is, when there is a flooding attack or a huge raise in flow of legitimate
26
packets, each switch can have multiple new flow entries to be approved by the controller
which can cause congestion between controller and switches, and controller have to
decide on a number of flow entries in a very short duration which is not suitable for
ensuring the security of the network.
It is clear that SD-Anti-DDoS takes care of DDoS detection, trace back and
mitigation in consecutive steps. For attack detection, Back Propagation Neural Networks
is used and for attack trace back, a lightweight trace back mechanism is employed that
takes advantage of results from BPNN in previous step by analyzing flow statistics. In
attack mitigation step, blocking attack flows by inserting new flow entries in the ingress
port of the edge switch in the network that drop attack packets and cleaning malicious
flow entries are done. Overall, existing system is a complete package of DDoS defense
in SDN that concentrates on detecting attack as soon as possible. SD-Anti-DDoS or
existing system utilizes OpenFlow communication protocol between controller and
forwarding plane.
27
In order to detect attack and trace back attack path, having flow information of
packets from each switch is essential. Periodically, flow entries in each switch, managed
by the controller, is snapped and stored into controller for further analysis. Flow entry
log is used for identifying any malicious traces in incoming packet flows. Template of a
flow entry is shown in figure 3.2, with which core aspects required for DDoS defense
and features of packets can be distinguished.
When there are specific DDoS attacks like SYN flood, UDP flood which
contain very large number packets of a particular protocol with certain attributes set to
same values, making the target to keep on listening or responding to these packets which
leads to unavailability of service for legitimate users. In such scenarios, monitoring
particular attribute values in flow entry is enough to make defense. Selecting appropriate
attributes that constitute a particular attack type is important in detecting the attack
28
correctly. Based on the service provided by the target system, types of DDoS attack that
remain as big threats are identified and corresponding features are extracted from flow
entries as a dataset to train the neural network in next step.
With neural network, the attack detection mechanism can classify benign flow
entry generated by normal traffic and malicious flow entry generated by DDoS attack
traffic. The information of a flow entry will be obtained by the controller, then the Eigen
values of this flow entry will be extracted and sent to the trained neural network to
classify whether it is malicious. Consequently, the attack detection can be broadly
divided into two steps: the neural network model training stage and the real-time
detection stage. Once the system starts, the neural network will be trained firstly. The
dataset is made in advance for training. At the beginning, a set of features of malicious
attack traffic and benign traffic is collected. The corresponding target value of malicious
attack and benign traffic is then assigned with different values (that is, zero represents for
29
benign traffic and one represents for malicious attack). Subsequently, the extracted flow
features and the corresponding target value are combined to form the training dataset.
When the system starts, the training dataset is read from the txt file and used to train the
neural network. Thus, the available neural network model can be built by using the
extracted feature parameters as the input parameters of neural network, and taking the
target values as the output parameters.
In SD-Anti-DDoS, BPNN is used as the classify algorithm. In order to
overcome the detection error caused by various packets in network, a detection method
based on threshold is also introduced in the detection. The following characteristic values
are used as the input parameters of neural network: number of packets matched by each
flow entry, number of bytes matched by each flow entry, survival time of each flow
entry, packet rate of each flow entry and byte rate of each flow entry. These features are
the Eigen values of a flow entry. These can be extracted from the flow statistics message
received by the controller. Using these features, BPNN is able to classify the network
traffic. The BPNN model used in exiting system is built by using the follow parameter:
one input layer, one hidden layer and one output layer. The number of neurons in input
layer is five, and the number of neurons in hidden layer is ten, while the number of
neurons in output layer is one.
In real-time detection stage, all flow entries of each switch will be acquired
firstly. After the controller receives the flow statistics message about flow entries send
by the switch, the flow stats message will be parsed. The flow entry in that message will
be processed one by one. At first, the Eigen values of a flow entry including number of
packets matched by each flow entry, number of bytes matched by each flow entry,
survival time of each flow entry, packet rate of each flow entry and byte rate of each
flow entry will be extracted. Then the extracted Eigen values are transferred to the
BPNN to determine whether the flow entry is benign or malicious. Meanwhile, the
classify result will be stored in an array to avoid the repeated processing in trace back
30
state. If the flow entry is considered as a malicious one, its destination IP address will be
parsed and appended to an array (attack_dst_store_list). After that, if the number of
malicious flow entry reaches the predefined upper limit, a DDoS attack alert will be
generated firstly. Subsequently, the processing of flow statistics message will be stopped.
At last, the attack destination will be found out by searching the one which has the max
occurrence number in attack_dst_store_list. However, if the flow entry is considered as a
benign one or the number of malicious flow entry is less than the predefined upper limit,
another flow entry will be processed. Systematic flow of these steps can be identified
from figure 3.3.
Usual mechanism deployed for packet trace back in SDN is mainly based on
matching the head fields of the packet with the correlative flow entries, which needs a
large number of comparisons of flow entries with packets in the scenario of wide spread
DDoS attack. In existing system, in order to react more quickly to attack, an attack trace
back method correlated with the attack detection method is proposed to trace the DDoS
attack source switch. In the detection stage, the analyzing results of flow statistics
32
messages will be stored in an array and sent to the trace back module. Based on the
results analyzed by the attack detection module and the topology known by the
controller, the attack trace back module will continue to analyze the flow statistics
message to find out the attack source switch. The attack trace back method is described
in detail as follows. Once the attack detection module detects the existence of DDoS
attack, the system will step into the trace back State. The trace back module is the main
component of the trace back State. As a main module for determining whether a switch
is in the attack path, it utilizes the same trained BPNN model used in attack detection to
get the result. After the switches in attack path are successfully found out, the whole
attack path in the order that the attack traffic passes will be located using the
combination of the network topology, attack destination and the marked switches.
As shown in figure 3.4, the number of malicious flow entries and benign flow
entries of each switch is recorded. Then the number of total flow entries and the
proportion of malicious flow entries are calculated. Based on the number and the
proportion of malicious flow entries in each switch, whether the switch is located on the
attack path will be determined. If the number of malicious flow entries is over a
predefined upper limit or the proportion of malicious flow entries is higher than the
predefined value, the switch will be marked as a malicious switch which is on the attack
path. Otherwise, it will be marked as a benign switch. Using the combination of global
33
network topology, attack destination and marked malicious switches, the accurate attack
path in the order that attack traffic passes will be found out.
After the attack path and the attack source switch are identified, the attack
mitigation module will start. The most important task of the attack mitigation module is
blocking the attack traffic. After successfully blocking the attack traffic, huge amounts of
malicious flow entries, which are generated by attack, will still exist in switches. Those
flow entries are useless. Meanwhile, those can be a waste of storage space of switches.
Therefore, after blocking the attack traffic, the malicious flow entries are deleted to
release the occupied storage space in the proposed method. Using controller-to-switch
messages to insert flow entries with highest priority (65,535) into the flow table of the
switch which is marked as the attack source switch, the Attack block module tries to stop
the attack traffic. Those flow entries are called blocking flow entries. The structure of
blocking flow entry shown in figure 3.5, it can be understood that the attack destination
address is assigned as the IP destination address and the ingress port of attack traffic is
assigned as the ingress port of flow entry's Header fields. Meanwhile, The Drop action is
used to block the malicious attack traffic.
After the blocking flow entry has been inserted into the attack source switch,
the attack traffic arrives through the ingress port will be matched against the blocking
flow entry, thus it will be directly discarded. Therefore, the attack mitigation can be
achieved. Once the block strategy is executed successfully, the attack traffic will be
blocked. But a huge number of flow entries still exist in switches that are in the attack
path. Therefore, the flow table modification message (OFPFC_DELETE message) is
proposed to delete the flow entries which are marked as malicious flow entry.
Attack trace back uses proportion of malicious flow entries to total flow entries to
mark attack path which may miss switches that are under low rate attack.
In attack mitigation, switches controlled by the controller, that detected DDoS
attack, are inserted with blocking flow entries where as nearby network with a
controller and a set of switches should perform the same defense steps again to
recover itself from the attack.
3.9 SUMMARY
CHAPTER 4
PROPOSED SYSTEM
4.1 INTRODUCTION
DDoS defense involves attack detection, trace back and mitigation. Though
each step is critical to defend the attack promptly with correctness, detection of attack is
more crucial. If detection has gone wrong or incomplete, there is no use of performing
trace back and mitigation further. Existing system has a downside of not addressing to
the issue of identifying generic DDoS attacks. Moreover, identifying generic attacks by
comparing attack signatures from previous attacks is difficult and not effective, as the
current attack packets can hold attribute values randomized in a way that is very different
from attack signatures in datasets and it will give poor results when applied in dynamic
programmable SDN. This liability leads to the necessity of determining an attack based
on recent behaviors and current traffic flow in the network, rather than using attack
signatures collected from various sites. Attack signatures are useful only when the attack
is specific. A collaborative approach is proposed to detect generic attacks in the dynamic
SDN environment. Collaborative approach makes all nodes in a network to learn by co-
operation and decide about attack filters. By this approach, proactive response to attack
can be made, rather than reacting after an attack.
In order to learn co-operatively, each node (or switch, in case of SDN) in the
network must share packet flow information, that it has, with other nodes in the network.
Generically, a node can either be an intermediate forwarding device or an end host. If
learning needs to be efficient and quick, format of data being shared must be common
and organized, resulting in maintenance of profiles at each node. To identify any attack
36
signatures in current packet flow, analyzing it with the recent past flow information is
necessary. So, profiles are split into nominal and current profiles. Nominal profile of a
switch referring to a time period contains flow entries that were recorded during a non-
attack period. Current profile contains flow entries that are recorded at current time and
are yet to be classified as benign or malicious packet flow. Creating nominal profile and
current profiles in SDN is easy by using flow entries of each switch. Profile and flow
entry mean same information, that is, packets grouped by similar attribute values along
with their count and time of existence of the flow. There are single profiles or pair
profiles. Single profiles have a single packet attribute with all possible values and
number of packets with that attribute value. Pair profiles have combination of two
attributes and number of packets with both attribute values occurring together [17].
In Table 4.1, sample of pair nominal profile is shown which has recorded
packets that had combination of TTL value and Destination Port number, along with
their count. Similarly in Table 4.2 and Table 4.3, single attributes of a packet are
recorded along with their count. Format of nominal and current profiles remain same to
37
be ease comparison. Traditionally, profiles do not contain the total duration of a packet
flow but logging time duration is simple in SDN switches.
For an extensive analysis, six single profiles and a pair profile are taken from
each switch. As number of pair profiles will count to fifteen if all pair combinations of
six attributes are taken, only one pair profile is taken from each switch. Single profiles
have attributes like IP address, port number, protocol type, packet size, TTL value and
TCP flag. Each switch gives a different pair profile, that is, attribute combinations vary
with each switch randomly. In this way profile information is collected traditionally. In
order to improve accuracy of detection, number of single profiles (attribute) and pair
profiles (attribute combinations) can be varied accordingly, taking space constraints of
switch in concern.
attributes contributing a flooding attack can vary and cannot be predicted before. But by
monitoring flow statistics, attributes or attribute pairs that have drastic variation in packet
count can be identified and chances are high that these most deviating packet flow can
contribute to flooding attack.
In each switch, six single nominal profiles and six single current profiles are
recorded with six predefined packet attributes. By comparing count variation between
single nominal and current profiles (count of packets having same attribute value in
current profile tends to be very higher that in nominal profile or attack free period), most
deviating attributes can be found out. Out of six attributes that are arranged in the
descending order of packet count variation, first two attribute are chosen to be the
suspicious pair. This attribute pair is suspicious only with respect to the current switch
from which it is chosen. Confirming that this pair has deviated much from nominal
profile values in other switches assures that this pair contributes to flooding attack and
this is the collaborative approach. After confirmation with other switches, if the pair
remains to be suspicious, it is termed as score pair. With respect to score pair attributes
of each switch, each incoming packet flow is scored and judged for attack flow.
Comparing suspicious pair deviation and selecting it as score pair is done
using following steps.
1. Let S be the current switch and S’, S’’ and S’’’ represent switches at first, second
and third hops from S. Let A, B, C, D, E, F represent six different attributes taken
for profiling.
2. Each of these switches has six single nominal profiles (SNP), six single current
profiles (SCP), a pair nominal profile (PNP). Pair current profile (PCP) will be
generated only after determining ScorePair of the switch.
3. Packet count variation between SCP and SNP of the same switch (say S), yields
suspicious pair of S as S(D,F) where D and F are most deviating in current profile
when compared with nominal profile, among six attributes.
4. If D and F were the randomly chosen attributes for pair nominal profiling in S,
S(D,F) is said to be the ScorePair of S.
39
5. If D and F were not chosen for pair profiling in S, then pair profiles of S’, S’’,
S’’’ are taken in order and attribute matching is checked until ScorePair of S is
found.
6. If none of the pair profiles of S’, S’’, S’’’ have D and F as their pair profile
attributes, own pair of S (attribute pair taken for pair profiling) is considered to be
the ScorePair of S.
By following above steps, ScorePair of every switch is found. Based on this
ScorePair attributes, Pair current profiles (ScorePCP) are generated at each switch. Each
packet’s score is calculated considering ScorePNP’s corresponding value. If ScorePair is
determined as A and B, then packet p with the attributes A = ap and B = bp will have the
score Sp as follows.
ScoreP P ap , bp TP P
Sp
ScorePNP ap , bp,… TPNP
Where
ScorePCP is the number of packets in current profile that have the property of ap for
attribute A and bp for attribute B.
ScorePNP is the number of packets in the nominal profile that have the property of ap
for attribute A and bp for attribute B.
TPCP is the total number of packets in current profile.
TPNP is the total number of packets in nominal profile.
The score of a packet needs to be compared with a threshold Th. All scores are stored in
a ScoreList and the threshold value Th is determined according to the cumulative
distribution of scores. It is shown as symbolically CDF(Th) = ɸ where ɸ is the ratio of
traffic that should be dropped. The fraction of traffic permitted to pass is 1-ɸ = Ф/ ψ
where Ф acceptable traffic and ψ is the total current incoming traffic.
Each packet’s score value is compared with the threshold. If it exceeds the threshold, this
packet is supposed to be malicious and discarded. Otherwise, it is forwarded to the
destination.
40
From figure 4.1, working of proposed system is denoted. OPNP1, OPNP2 and
OPNP3 refers to the own pair nominal profiles maintained in switches S, S’, and S’’
41
respectively. This workflow describes what is done within a controller’s area. When
controllers are allowed to share attack information, attack can be blocked at nodes that
are immediate neighbors of zombies. When a packet flow is determined to be malicious,
trace back of attack path is simple as attack information is already collaborated.
Mitigation is done by inserting corresponding blocking flow entries in the switches that
are best located near to the attack source.
4.6 SUMMARY
In this chapter, the way in which proposed system overcomes drawback of not
detecting generic attacks in SDN is explained. Steps carried out in collaborative
approach are detailed. Idea of collaborating packet flow information proves to be much
useful in solving tough problems like flooding attack, for which defense efforts from a
single system will not be equivalent enough.
42
CHAPTER 5
IMPLEMENTATION ENVIRONMENT
5.1 INTRODUCTION
Among the three steps of DDoS defense, attack detection is focused in the
current work and it is performed by two different approaches in existing and proposed
systems. In existing system, neural network is used to detect attack flow and it is
implemented by R language in RStudio. In proposed system, collaborative approach is
implemented in a virtualized SDN environment using Mininet emulator that supports
python language [23]. Packet flow data is collected from traffic data repository
maintained by the MAWI Working Group of the WIDE Project [15]. In WIDE Project
15 minute traffic traces are uploaded on daily basis, in packet capture format that
contains information about packets that number from 65 million to 95 million
approximately.
5.2 MODULES
The following are the module wise implementation of the existing and
proposed system,
From the five fields taken for data preprocessing, flow entries are
constructed by taking number of packet instances having a source IP address, a
destination IP address, protocol and length. Time of the flow entry is calculated by
finding difference between time record of last and first packet instance of the packet
flow. Byte count of flow entry is the sum of number of bytes of each packet that
counts to a packet flow. And also, number of bytes received per second and number
44
of packets received per second are calculated using packet count of a flow and
number of bytes transmitted in the flow.
Sample of flow entries are shown using table 5.2 in which ‘ ttack’ field represents
the status of flow entry contributing to attack. A flow entry is determined to be
malicious or flooding if it has packet rate and byte rate greater than the average
packet rate and byte rate of flow entries recorded in the switch respectively. Resulted
table of flow entries is used to train back propagation neural network in the next
stage, for classifying the forth coming packet flows as flooding or benign.
Table 5.3 Comparison of actual and predicted attack status for a set of flow
entries
Actual attack status Predicted attack
given for test data status by BPNN
0 0.00003022188527
1 1.18415214621660
0 0.01522612634656
0 -0.00284071561286
0 -0.00672242836680
0 -0.00652079488739
0 -0.00586295472040
0 -0.00568238367241
0 -0.00472990867619
The middle layer is the internal information processing layer, which is responsible
for information calculation. The middle layer can be designed as a single hidden
layer or multiple hidden layers based on the demand of sensitivity. The computed
information is forwarded to each neuron of the output layer from neurons in the last
46
hidden layer. If the actual output matches the expected output or the number of
training reaches the upper limit, it will be output. Otherwise, the error back
propagation will be started. During this process, each layer's weight will be adjusted
according to the gradient descent algorithm. Such process will continue until the
network output error is reduced to an acceptable level, or the number of training
reaches the predefined upper limit.
Figure 5.1 denotes the set of inputs given to the neural network with ten hidden
layers and output is obtained as attack along with the bias values for every neuron in
the hidden layer and output neuron. From table 5.3, comparison of actual attack
status and predicted attack status can be observed.
To detect generic attacks that do not fall under the category of attacks
contributed by a set of packet attributes, collaborative approach is performed by
comparing packet flow characteristics during attack free period of corresponding
network or particular target and suspicious period of packet flow to the network or
target. Nominal profiles are created by collecting single attribute and attribute pair
information along with packet count from flow entries in switches recorded during
attack free period. Current profiles record the single attribute and attribute pair
information of packet flow at current period. For improved comparison, from
nominal and current profile statistics, score for every packet from every packet flow
is computed and it is compared with predetermined threshold to discriminate attack
and benign flows.
Profile creation from flow entries, is done at deciding module attached to the
controller in SDN. Score list of packets and threshold computation are done at the
controller supporting module. This approach reduces burden on controller and keeps
the switches to be packet forwarding devices which results in cost-effective yet
manageable dynamic system with appropriate DDoS defense mechanism.
47
5.3 SUMMARY
CHAPTER 6
Following are the evaluation metrics used to evaluate the obtained results
from existing system and proposed system.
6.2 RESULTS
Network Log from MAWI Lab is taken as dataset for creating sample data.
Five different samples are given to Neural Network model and Packet Score method
simultaneously to get DDoS attack detection. After preprocessing, data input for Neural
Networks and Packet Score are formed as seen in Table 6.1 and Table 6.2 respectively.
All five samples have same format of data. For Packet Score, Time attribute is not given
as it only focuses on maximum deviating attribute selection along with packet score.
TTL value and Destination port are given additionally. In Neural Networks, TTL and
Destination port are not considered for training, hence not given.
50
From Precision and Recall values in Table 6.3, it is visible that Packet Score
method can classify attack packets more correctly than Neural Networks model. Five
samples are collected during different time points and that notifies the different values of
precision and recall in Table 6.3.
Table 6.4 Comparison of Precision and Recall for Neural Network and
Packet Score method
Sample dataset Precision Recall
From Figure 6.1 and Figure 6.2, FM and FMC values can be observed.
From mean of F M, Packet Score is.33.21% better than Neural Networks in not dropping
legitimate packets as attack packets. From mean of FMC, Packet Score is 3.7% better
than Neural Networks by maintaining harmonic mean of True Negative Rate and
Negative Predicted value.
52
From the results analysis, more proper classification is done by Packet Score
than neural networks. False Positives and False Negatives are 24 percent lesser in Packet
Score when compared with Neural Networks. Packet Score technique monitoring the
current increase in packet rate based on the attributes which directly contribute to any
kind of DDoS attack is the important reason for lesser false prediction in Packet score
when compared with Neural Network. Neural Network method checks current flow only
based on previous attack trace knowledge. Hence, DDoS attack detection in dynamic
environments can be done using flow based methods like Packet Score, rather than
training and testing methods like Neural Networks.
6.4 SUMMARY
CHAPTER 7
7.1 CONCLUSION
CHAPTER 8
PUBLICATIONS
APPENDIX 1
SOURCE CODE
Creating Flow entries:
myFile <- file.choose() //choosing dataset
datasamplepart <- read.csv(myFile, header=TRUE, sep=",")
datasamplepart //displaying dataset
sapply(datasamplepart,class) //displaying column type
tempdataframe <- data.frame("src"=character(),"dest"=character(),"proto"=character(),"len1"=integer(0),
"time_of_flow_entry"=double(),"packet_count"=integer(0),"byte_count"=integer(0),
"packet_rate"=double(),"byte_rate"=double(),
stringsAsFactors=FALSE)
for(i_row_of_datasamplepart in 1:nrow(datasamplepart))
{
s1 = datasamplepart[i_row_of_datasamplepart,"Source"]
d1 <- datasamplepart[i_row_of_datasamplepart,"Destination"]
p1 <- datasamplepart[i_row_of_datasamplepart,"Protocol"]
len1 <- datasamplepart[i_row_of_datasamplepart,"Length"]
Training BPNN:
data = read.csv(file.choose(), header=T)
data <- data[,c(6:11)]
sapply(data,class)
nrow(data)
ncol(data)
// Random sampling
samplesize = 0.70 * nrow(data)
set.seed(80)
index = sample( seq_len ( nrow ( data ) ), size = samplesize )
// Create training and test set
datatrain = data[ index, ]
datatest = data[ -index, ]
nrow(datatrain)
nrow(datatest)
maxs = apply(data, 2,max)
mins = apply(data, 2 ,min)
scaled = as.data.frame(scale(data, center = mins, scale = maxs - mins))
library(neuralnet)
# creating training and test set
trainNN = scaled[index , ]
testNN = scaled[-index , ]
nrow(trainNN)
nrow(testNN)
# fit neural network
set.seed(2)
NN = neuralnet(attack1 ~ time_of_flow_entry + packet_count + byte_count+ packet_rate + byte_rate , trainNN,
hidden = 10 , linear.output = T )
# plot neural network
plot(NN,cex=1.3)
NNt = compute(NN,testNN[,1:5])
ls(NNt)
co<- cbind(testNN[,c("attack1")],as.data.frame(NNt)[,c("net.result")])
colnames(co) <- c("given op","NN op")
print(col(co))
data = read.csv(file.choose(), header=T)
data <- data[,c(6:11)]
sapply(data,class)
nrow(data)
ncol(data)
# Random sampling
samplesize = 0.70 * nrow(data)
set.seed(80)
index = sample( seq_len ( nrow ( data ) ), size = samplesize )
# Create training and test set
datatrain = data[ index, ]
datatest = data[ -index, ]
nrow(datatrain)
nrow(datatest)
maxs = apply(data, 2,max)
mins = apply(data, 2 ,min)
scaled = as.data.frame(scale(data, center = mins, scale = maxs - mins))
library(neuralnet)
58
'count':data_cur['Length'].value_counts().values})
SCPsrc_port =pd.DataFrame({'src_port-ttl': data_cur['src_port-ttl'].value_counts().index,
'count':data_cur['src_port-ttl'].value_counts().values })
SCPdst_port =pd.DataFrame({'dstport': data_cur['dst_port'].value_counts().index,
'count':data_cur['dst_port'].value_counts().values })
def finding_Max_Deviation(SNP,SCP):
attrib_val=SNP.columns.values[1]
print("\n ^^ ",attrib_val)
no_of_rows_SNP=len(SNP.index)
no_of_rows_SCP=len(SCP.index) print("number of rows ",no_of_rows_SNP," >> ",no_of_rows_SCP)
Devmax_atrb_len= len(Devmax_attrib.index)
for each_row_SNP in range(no_of_rows_SNP):
nom_profile=SNP.at[each_row_SNP,attrib_val]
nomprofile_cnt=SNP.at[each_row_SNP,'count']
temp=SCP.loc[SCP[attrib_val]==nom_profile]
if not (temp.empty):
attrib_diff=temp['count']-nomprofile_cnt
tempstr=str(attrib_diff)
tl=tempstr.split()
diff=int(tl[1])
if (diff>=0):
Devmax_attrib.loc[Devmax_atrb_len]= diff
Devmax_atrb_len=Devmax_atrb_len+1
res=Devmax_attrib.sort_values('value',ascending=False)
res=res.rename(columns={'value':attrib_val})
return (res)
def get_maxofattrib(SP):
s1=str(SP)
#print(" head1 ",s1)
sl=s1.split()
s1=str(sl[-1])
k1=int(s1)
return k1
DevMx_src_port = finding_Max_Deviation(SNPsrc_port,SCPsrc_port)
print(DevMx_src_port)
DevMx_dest_port= finding_Max_Deviation(SNPdst_port,SCPdst_port)
print(DevMx_dest_port)
DevMx_protocol= finding_Max_Deviation(SNPprotocol,SCPprotocol)
print(DevMx_protocol)
DevMx_size= finding_Max_Deviation(SNPsize,SCPsize)
print(DevMx_size)
DevMx_src= finding_Max_Deviation(SNPsrc,SCPsrc)
print(DevMx_src)
DevMx_dest= finding_Max_Deviation(SNPdst,SCPdst)
print(DevMx_dest)
sizei=get_maxofattrib(DevMx_size.iloc[[0]])
protocoli=get_maxofattrib(DevMx_protocol.iloc[[0]])
desti=get_maxofattrib(DevMx_dest.iloc[[0]])
srci=get_maxofattrib(DevMx_src.iloc[[0]])
srcporti=get_maxofattrib(DevMx_src_port.iloc[[0]])
destporti=get_maxofattrib(DevMx_dest_port.iloc[[0]])
idlcnt=[sizei,protocoli,desti,srci,srcporti,destporti]
idlattribute=['Length','Protocol','Destination','Source','src_port-ttl','dst_port']
print(idlcnt)
60
id= max(idlcnt)
print(idlcnt)
idindex=idlcnt.index(id)
print(" output -",id,"-=-",idindex,"-=-",idlcnt)
print(idlattribute[idindex]," is the max1 deviation attribute ")
scorepair.append(idlattribute[idindex])
del idlcnt[idindex]
del idlattribute[idindex]
print("new cols-=-",idlcnt,"\n",idlattribute)
id2= max(idlcnt)
idindex2=idlcnt.index(id2)
print(" removed ",idlcnt, " ",idlattribute," \n",idlattribute[idindex2]," is the max2 deviation attribute ")
scorepair.append(idlattribute[idindex2])
print("\n",scorepair)
APPENDIX 2
SNAPSHOTS
DATASET
From MAWI lab project, daily trace of network flow data is taken in .pcap format and
converted into .csv format as shown below.
Figure A2.1 Network flow data collected from MAWI lab project
62
After combining packets of similar type into flow entries, below table is obtained.
From a set of flow entry tables, one file is chosen to train neural network.
Figure A2.4 Choosing flow entry table for training neural network
Below diagram shows a trained neural network having five input neurons, one hidden
layer with ten neurons and one output neuron.
From the below list, difference in actual and predicted attack status can be observed.
Figure A2.6 Actual attack status and predicted attack status for flow entries
65
PROFILE CREATION
Single Nominal Profile is collected during non-attack period for Source address attribute.
Single Current Profile is collected during attack period for Source address attribute.
Comparing counters from SNP and SCP of each attribute first two most deviating
attributes are chosen as Score Pair for recording Current Pair Profile. Below snapshot
shows Maximum deviation of each value in length or size of packet.
After combining packets of similar type into flow entries, below table is obtained.
REFERENCES
[1] Rodrigo raga. et al (2010), “ Lightweight DDoS Flooding Attack Detection Using
[4] Donwon Seo et al (2011), “PFS: Probabilistic Filter Scheduling against Distributed
[5] Donwon Seo et al (2013), “ PFS: daptive Probabilistic Filter Scheduling against
[7] Jérôme Francois et al (2012), “Firecol: ollaborative Protection Network for the
[8] hmed lEroud and Izzat lsmadi (2016), “Identifying yber-Attacks On Software
Journal of Network and Computer Applications, Volume: 80, February, pp. 152-164.
[9] Panos Kampanakis et al, (2014), “SDN-Based Solutions for Moving Target Defense
Vol.1, pp.28-34.
[10] Qi hen et al, (2012) “ F: A Packet Filtering Method for DDoS Attack Defense
xxxxTransactions on Dependable and Secure Computing, Vol. 3, Issue: 2, pp. 141 - 155.
[12] Rishikesh Sahay et al, (2017), “ roma: n SDN Based Autonomic DDoS
[13] Diego Kreutz et al (2013), “Towards Secure and Dependable Software Defined
[14] Kübra Kalkan et al (2017), “Defense Mechanisms against DDoS Attacks in SDN
[15] R. Fontugne et al, (2010), “Mawilab: ombining Diverse nomaly Detectors for
XxxxTechnologies.
70
[16] Yunhe Cui et al (2016), “SD-Anti-DDoS: Fast and Efficient DDoS Defense in
[17] Kübra Kalkan and Fatih lagöz (2016), “ Distributed Filtering Mechanism against
xxxx209.
[18] Simo Kemp, “The Incredible growth of the Internet over the past five years –
xxxxincredible-growth-of-the-internet-over-the-past-five-years-explained-in-detail/
xxxxhttps://www.cisco.com/c/en/us/products/security/what-is-network-security.html
xxxxURL: https://www.incapsula.com/ddos/denial-of-service.html
xxxxURL: https://www.opennetworking.org/sdn-definition/
xxxxURL:https://www.sdxcentral.com/sdn/definitions/what-the-definition-of-software-
xxxxdefined-networking-sdn/