Question: This is the PYTHON skeleton and this is a python program: import csv import pylab def open_file(message): pass def read_ip_location(file): pass def read_ip_attack(file): pass def



This is the PYTHON skeleton and this is a python program: import csv import pylab def open_file(message): pass def read_ip_location(file): pass def read_ip_attack(file): pass def read_country_name(file): pass def locate_address(ip_list, ip_attack): pass def get_country_name(country_list, code): pass def bar_plot(count_list, countries): pylab.figure(figsize=(10,6)) pylab.bar(list(range(len(count_list))), count_list, tick_label = countries) pylab.title("Countries with highest number of attacks") pylab.xlabel("Countries") pylab.ylabel("Number of attacks") def main(): file = open_file("Enter the filename for the IP Address location list: ") ip_data = read_ip_location(file) file = open_file("Enter the filename for the IP Address attacks: ") attack_data = read_ip_attack(file) file = open_file("Enter the filename for the country codes: ") country_data = read_country_name(file) #answer = input(" Do you want to plot? ") if __name__ == "__main__": main() and this is the link to the other files that is read by the program:
http://www.cse.msu.edu/~cse231/Online/Projects/Project07/
Assignment Overview Functions Lists and Tuples . Strings File manipulation Assignment Background The Internet has become an essential part of our lives. We use it to read emails, take courses (CSE231, there is a website for this course! Surprise!), and watch cat videos. However, connecting everything through a network needs to break information into pieces or small packet:s with identification. Just like letters need to have source and destination addresses, these packets needs to have IP addresses as source and destinatio Although the existence of the Internet is for good, some individuals use it to extract personal and confidential information like social security numbers, university records, etc. The task for this project is to determine the country of origin of the IP addresses that attacked the network. Specifically, one input file for this project was generated from the attacks on the CSE network in one day-the source is http://facweb.cse.msu.edu/cldates.php For this project, we provide a file from that site, and for the blind test case we simply pick a different day. For privacy reasons, the IP addresses of the attacks will only have the 24 most significant digits (first three numbers, each ranging 0-255), addresses of that type are known as Class C Project Specifications 1. You must implement the following functions a) open file (message) has one parameter: message, a string. This function prompts the user to enter a filename displaying the message provided. The program will try to open a file. An error message should be shown if the file cannot be opened. This function will loop until it receives proper input and successfully opens the file. It returns a file object. b) read_ip_location (file) receives a file object as parameter (such as returned from open_file )) and reads a range of IP addresses corresponding to a specific Assignment Overview Functions Lists and Tuples . Strings File manipulation Assignment Background The Internet has become an essential part of our lives. We use it to read emails, take courses (CSE231, there is a website for this course! Surprise!), and watch cat videos. However, connecting everything through a network needs to break information into pieces or small packet:s with identification. Just like letters need to have source and destination addresses, these packets needs to have IP addresses as source and destinatio Although the existence of the Internet is for good, some individuals use it to extract personal and confidential information like social security numbers, university records, etc. The task for this project is to determine the country of origin of the IP addresses that attacked the network. Specifically, one input file for this project was generated from the attacks on the CSE network in one day-the source is http://facweb.cse.msu.edu/cldates.php For this project, we provide a file from that site, and for the blind test case we simply pick a different day. For privacy reasons, the IP addresses of the attacks will only have the 24 most significant digits (first three numbers, each ranging 0-255), addresses of that type are known as Class C Project Specifications 1. You must implement the following functions a) open file (message) has one parameter: message, a string. This function prompts the user to enter a filename displaying the message provided. The program will try to open a file. An error message should be shown if the file cannot be opened. This function will loop until it receives proper input and successfully opens the file. It returns a file object. b) read_ip_location (file) receives a file object as parameter (such as returned from open_file )) and reads a range of IP addresses corresponding to a specific
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
