Show histogram of lookup delay for successfully resolved ips

Assignment Help Computer Network Security
Reference no: EM131445118

Assignment: Computer Networks

1. Purpose

Understand how to design non-ASCII application-layer protocols and learn how to provide reliable transfer over UDP.

2. Description

Overview

Your goal is to implement a DNS resolver that runs over UDP. The user inputs strings that can be either host names or IP addresses, which need to be resolved through DNS. Your program must directly use UDP and parse DNS responses without using any shortcuts from Platform SDK. The answers returned by the local DNS server must be displayed to the user including any additional records and multiple answers. A complete specification of packet headers and the various fields is contained in RFCs 1034-1035.

The program can be run in two modes - interactive (i.e., using command-line input) and batch (i.e., using input file dns-in.txt). In the former case, the code will return a detailed answer to the query provided by the user (see examples below). In the latter case, the code will read the input file (one question per line) and perform lookups using N threads, where N is specified in the command line. To distinguish between the modes, check if the first argument to the program is an integer. If so, assume this integer is the number of threads for batch lookups. Otherwise, assume the interactive mode.

Requirements for interactive lookups:

1. Your code must be able to decide whether input is an IP or a hostname based on the syntax of the string. Invalid IPs should be rejected immediately without contacting DNS (see below for more).

2. You must be able to send A and PTR requests based on user input and parse CNAME, A, and PTR responses. You must parse responses in both the answer section and the additional-records section; however, you may skip the authoritative section even if the number of answers there is non-zero.

3. You must be able to handle compressed resource records (RRs) as most DNS servers will return compressed data. The compression scheme in DNS is very simple and is documented fully in RFC 1035.

4. You must differentiate between successful lookups and failures, as well as detect errors and interpret them for the user. For example, return code 3 signifies a non-existent DNS name (print "No DNS entry") and code 2 means that the authoritative server cannot be found/contacted by your local DNS server (print "Authoritative DNS server not found").

If your program times out waiting for the local DNS server, display "Local DNS server timeout." For all other errors, print the numerical error and exit.

5. The code must be able to dynamically find the local DNS server for your computer (no hardcoding of its IP).

6. The program must not crash or exceed array boundaries under any circumstances (sanity checks for all pointers and fixed headers).

Requirements for batch lookups (either single-threading or multi-threading):

1. The main thread must read all strings from dns-in.txt (a list of IP addresses) into a shared queue inputQ, then start N threads, which will draw items from the queue, perform DNS lookups, write all answers into another shared queue outputQ, and continue looping until inputQ becomes empty. When all done, the main thread will write the items from outputQ into file dns-out.txt. The order of answers on output does not have to match that on input. Note that errors must be recorded as well. Note: attaching timestamps (request/response time) to each answer will allow you to reconstruct how long each query took. This info can also be used to compute the number of queries per second completed by the program.

Requirements for the report:

1. Document your code.

2. Show sample output from your program and its handling of all types of cases outlined above (you do not need to use the same exact input, but rather examples that are similar in spirit). To find an example for each case, perform reverse DNS lookups on the entire list of IP addresses in the input file. Show several examples of hosts that produce "authoritative DNS not found" and "local DNS timeout." Find examples of IPs that are aliased to other IPs.

3. Examine the issue of packet loss by analyzing the number of times you had to transmit requests to the local DNS server before the attempt was successful (i.e., you received some response). Note that this value is the attempt number to which the server has responded, not the total number of attempts made. Plot a distribution similar to the one shown in Figure 1(a), except your maximum number of attempts will be 3 instead of 6. The numbers in the figure will add up to 100%.

4. Show the histogram of lookup delays for all successfully resolved IPs. Histograms are plotted by partitioning a dataset into fixed bins and counting the fraction of data in each bin. See Figure 1(b) for an example that uses 200-ms bins. The numbers in the figure will also add up to 100%.

5. Document the percentage of successful lookups for IP addresses in dns-in.txt and compare this number to that obtained using gethostbyaddr() in homework #1.

6. Using multiple threads starting from 2 and going up to 100 in some increments, document the performance of your resolver (i.e., loopups per sec = 1 / average-lookup- delay) in comparison to gethostbyaddr(). Specify the average CPU utilization for each case. Draw conclusions on the efficiency of your implementation. See Table 1 for an idea (numbers in the table do not necessarily have to correspond to yours).

Attachment:- Assignment.pdf

Reference no: EM131445118

Questions Cloud

How many moles of vapor are present : 1. A 125mL Erlenmeyer flask has a measured volume of 148 mL. A 0.477 g sample of an unknown vapor occupies the flask at 94.8°C and a pressure of 736 mmHg. Assume ideal gas behavior: a. How many moles of vapor are present?
Describe if a firewall is enabled on your machine : Identify if a firewall is enabled on your machine and if you need Windows firewall running in addition, if that anti-virus software is installed on your machine.
Does trial proceed with a jury trial or a bench trial : CJ252:Bill slips a can of tuna in his pocket and forgets to pay. Is this shoplifting? Please explain how mens rea, actus reus, and corpus delecti are involved in this assessment.Stanley and Bill were interrogated at the police station. Both conced..
What is the pressure in the flask : 1) A piece of dry ice (CO2) has a mass of 23.50 g. It is dropped into an evacuated 2.00-L flask. What is the pressure in the flask at -7°C?
Show histogram of lookup delay for successfully resolved ips : CPS 470/570- Show the histogram of lookup delays for all successfully resolved IPs. Histograms are plotted by partitioning a dataset into fixed bins and counting the fraction of data in each bin.
Describe a negotiation for significant purchase : Plan, execute, and describe a negotiation that you are planning on conducting for either a significant purchase (e.g., house, car, major appliance) a significant decision (e.g., a project at work, budgeting process) or a contract negotiation.
How can a caregiver foster secure attachment : Write a 700-word paper that addresses the following: How can a caregiver foster secure attachment? What are some cultural differences in how parents foster attachment in their children
Explain the key ways in which the teachings of the vedas : Define indigenous religion, and describe at least one aspect of indigenous religions that exists in a similar form in a traditional mainstream religion.Define religion, and discuss why it is useful in society. Explain why it is important for you ..
Discuss a specific work of art or a historical event : Discuss a specific work of art or a historical event with regard to its relationship to wellness. Share a link and/or summarize your topic so that we all have enough information to understand your discussion even if we are unfamiliar with the artwo..

Reviews

Write a Review

Computer Network Security Questions & Answers

  Use whois at network solutions to find contact information

Use whois at Network Solutions, netsol.com and/or whois.arin.net to find contact information and DNS servers for one organization. Also find the IP address range for their network. Print your results.

  Explain about hashing and message authentication codes

Explain the different roles between hashing and message authentication codes (MAC). Can a good hash function serve as a good MAC, and vice versa?

  Securing several desktop computers connected to network

Securing numerous desktop computers connected to the network. Explain the access control that you would put in place for each and explain why.

  Creates for system forensics investigators

Explain why you believe the trend of threats targeting large enterprises is rising and what you believe is the greatest tool these hackers have at their disposal. Provide a rationale.

  Identify at least four functions of the cio using the ebk

Identify at least four functions of the CIO using the EBK as a guide. Provide examples of how the CIO would execute these functions within an organization.

  How vulnerable end-users are leaving themselves

Students must NOT include any audio or video files. The PowerPoint virtual presentation will not be formally presented. As a result students must endeavour to convey their views and research findings whilst adhering to best presentation practices.

  What is locking and how is it resolved

Describe the issues that arise from concurrency.

  Explicate the steps you would take to plan a budget for lab

Explicate the steps you would take to plan a budget for the lab, keeping in mind the general business objective to avoid unneeded costs.

  The performance of a wimax network appears to be lower than

the performance of a wimax network appears to be lower than expected and you suspect interference to be the cause.

  Explain the general purpose of the firewall

Explain the general purpose of the firewall above. Your explanation should include a description of the networks the gateway machine is connected to and how it is connected

  How is the security of a firms information system affected

How is the security of a firm's information system and data affected by its people, organization, and technology

  Virtualization software and operating systems

Write a one page synopsis of your experience in loading the virtualization software and operating systems. Include what you learned in the process.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd