
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
The data1 file is for the data that needs to be read provided in the question

Transcribed Image Text:121.211.171.34 dumbledore
21.67.43.78 spiderman
56.89.12.122 gandalf
67.109.113.215 zeus
21.67.43.79 wonderwoman
67.109.124.3 aprhodite
121.211.104.23 hermione
56.89.177.171 mirkwood
100.200.100.100 einstein
0.0.0.0 sentinel

Transcribed Image Text:Problem 1: Numeric addresses for computers using the IPV4 format
are composed of four parts, separated by periods in the form of
aa.bb.cc. dd where aa, bb, cc, and dd are integers larger or equal
to zero. Locally, computers are usually known by a nickname as well.
Write a C program to process a list of IPV4 addresses identifying all
pairs of computers from the same locality. Create a new structure
type named address_t with components for the four integers of the
IP address and a fifth component in which to store an associated
nickname of up to 15 characters.
Your program should read a list of addresses and nicknames from a
file (maximum 300 addresses) terminated by a sentinel IP address of
all zeros and a sentinel nickname (sample file here). It should then
print a list of messages identifying each pair of computers from the
same locality, that is, each pair of computers with matching values in
the first two components of the address. In the messages, the
computers must be identified by their nicknames.
Ex: Servers mirkwood and gandalf are on the same local network.
For this purpose, you must write a function named localnet that
takes two IP structured variables and returns true (1) if they are on
the same local network and false (0) if not.
Follow the messages by printing the full list of addresses and
nicknames.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 3 steps with 1 images

Knowledge Booster
Similar questions
- Two of the menu options (#2 and #3) are unfinished, and you need to complete the code necessary to write to and read from a binary file. You will need to read through the code to find the functions that are called by these options, and then supply the missing code. Please help me get menu 2 and 3 to display properly.the .cpp and .h have the information:.cpp file: // Corporate Sales Data Outputusing namespace std; #include <iostream>#include <fstream>#include <stdlib.h>#include "HeaderClassActivity1.h" int main() { Sales qtrSales[NUM_QTRS]; while (true) { cout << "Select an option: " << endl; cout << "1. Input data" << endl; cout << "2. Write data to file" << endl; cout << "3. Read data from file" << endl; cout << "4. Display sales" << endl; cout << "99. End program" << endl; int menuItem; cin >> menuItem; if (menuItem ==…arrow_forwardJavascript Create a function named "getUser". This function needs to accept a "userID" parameter. Use Fetch with Async/Await to request the data for the requested user. The function should return JSON data.arrow_forwardThe file london_weather.csv contains weather data for the years 1979 to 2020. The first five lines of this file are: date,cloud_cover,sunshine,global_radiation,max_temp,mean_temp,min_temp,precipitation,pressure,snow_depth19790101,2,7,52,2.3,-4.1,-7.5,0.4,101900,919790102,6,1.7,27,1.6,-2.6,-7.5,0,102530,819790103,5,0,13,1.3,-2.8,-7.2,0,102050,419790104,8,0,13,-0.3,-2.6,-6.5,0,100840,2 Note, in particular, that the dates are given as eight-digit integers in the format YYYYMMDD. There appears to be some inconsistencies in this data, as there are rows for which the column max_temp contains an entry that is smaller than the corresponding entry in min_temp. Write a Python function wrong_temperature(year) that returns the number of days in a given year for which the column max_temp contains an entry that is smaller than the corresponding entry in the column min_temp.arrow_forward
- Write SAS code for the following task: 1) Read in the excel file "Data.xlsx" to create a temporary SAS dataset 2) Based on the DOB column, create a new column called Age 3) Based on Admission Date and LengthOfStay, create a new column called DischargeDate 4) Based on BaseCharge and DiscountRate, create a new column called DiscountAmount 5) Based on DiscountAmount and BaseCharge, create a new column called TotalCharge 6) Remove the LengthOfStay and DiscountRate columns and ensure all columns, including the original and new, are in the correct format to represent the data, i.e., date, money 7) Checking the data type and displaying the final data table with PROC CONTENTS and PROC PRINT 8) The final dataset should be exported as a csv file named "Output Data.csv"arrow_forwardWrite function called read_rand_file(file_name) The function will read the random numbers from file_name display the total of the numbers display the total count of random numbers read form the filearrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY