DNWA/11/network/response.R
Jakub Stefko ab1d7e2546 ...
2021-01-28 18:33:55 +01:00

72 lines
2.0 KiB
R

library(ggplot2)
base <- read.csv('network/Data/base.csv')
net1 <- read.csv('network/Data/net1.csv')
net2 <- read.csv('network/Data/net2.csv')
net3 <- read.csv('network/Data/net3.csv')
net4 <- read.csv('network/Data/net4.csv')
# base
print('Most common src_port in base:')
print(tail(names(sort(table(base$src_port)))))
print('Most common src_addr in base:')
print(tail(names(sort(table(base$src_addr)))))
print('Most common dest_port in base:')
print(tail(names(sort(table(base$dest_port)))))
print('Most common dest_addr in base:')
print(tail(names(sort(table(base$dest_addr)))))
# net1
print('Most common src_port in net1:')
print(tail(names(sort(table(net1$src_port)))))
print('Most common src_addr in net1:')
print(tail(names(sort(table(net1$src_addr)))))
print('Most common dest_port in net1:')
print(tail(names(sort(table(net1$dest_port)))))
print('Most common dest_addr in net1:')
print(tail(names(sort(table(net1$dest_addr)))))
# net2
print('Most common src_port in net2:')
print(tail(names(sort(table(net2$src_port)))))
print('Most common src_addr in net2:')
print(tail(names(sort(table(net2$src_addr)))))
print('Most common dest_port in net2:')
print(tail(names(sort(table(net2$dest_port)))))
print('Most common dest_addr in net2:')
print(tail(names(sort(table(net2$dest_addr)))))
# net3
print('Most common src_port in net3:')
print(tail(names(sort(table(net3$src_port)))))
print('Most common src_addr in net3:')
print(tail(names(sort(table(net3$src_addr)))))
print('Most common dest_port in net3:')
print(tail(names(sort(table(net3$dest_port)))))
print('Most common dest_addr in net3:')
print(tail(names(sort(table(net3$dest_addr)))))
# net4
print('Most common src_port in net4:')
print(tail(names(sort(table(net4$src_port)))))
print('Most common src_addr in net4:')
print(tail(names(sort(table(net4$src_addr)))))
print('Most common dest_port in net4:')
print(tail(names(sort(table(net4$dest_port)))))
print('Most common dest_addr in net4:')
print(tail(names(sort(table(net4$dest_addr)))))