Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 11.4, Problem 11.4PP
Program Plan Intro
IP addresses:
- The IP address denotes an unsigned integer that is 32-bit.
- The IP addresses is been stored by network programs in IP address structure.
- The addresses present in IP address structure are stored in network byte order.
- An unsigned 32-bit integer is converted from host byte order to network byte order by “htonl” function.
- An unsigned 32-bit integer is converted from network byte order host byte order by “ntohl” function.
- The IP address is presented to humans in a form known as “dotted-decimal” notation.
- Each byte is been represented by its corresponding decimal value and is separated by a period from other bytes.
The getaddrinfo Function:
- It converts string representation of hostnames, host addresses, service names and port numbers into structures of socket address.
- It denotes replacement for “gethostbyname” and “getservbyname” functions.
- The two components of socket address denote “host” and “service”, the method returns result that points to a linked list of “addrinfo” structures.
- The “host” argument can either be a domain name or a numeric address.
- The “service” argument can be either a service name or a decimal port number.
The getnameinfo Function:
- It converts structures of socket address to corresponding host and service name strings.
- It denotes replacement for “gethostbyaddr” and “getservbyport” functions.
- The argument “sa” points to a structure of socket address with size “salen” bytes.
- It points to host with buffer of size “hostlen” bytes and “service” to a buffer of size “servlen” bytes.
- The result is been copied into “host” and “service” buffers.
- If it returns a non-zero error code, the application can convert it to a string by calling “gai_strerror”.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
[ Direction: Any how solve the question please. Don't reject the question. if you need 2 /3 hours to solve the question please take it but don't reject the question. solve it properly,correctly.You can consult any resources such as books, online references, and videosfor this assignment, however, you have to properly cite and paraphrase your answerswhen it is necessary. ]
The following figure represents both datapathand controlpath for MIPS architecture that implements most of thefundamental instrucons.
Question 5
Multiple Choice: We have been assigned the task of selecting an interface language
for a disk controller that must count disk reads. In particular, the controller must count
how many reads have occurred since the last write to the disk and confirm that the
count of reads does not exceed 1,000,000. Two proposals have been made. Method
C uses C++ while Method R uses regular expressions. Then
I would use Method C because Method R would translate into a finite automaton with at least
1,000,000 states.
I cannot use Method C because it is not able to keep track of the count of reads.
I would use Method C because Method R cannot keep track of the count of reads.
I cannot use Method R because regular expressions cannot represent integers.
Please refer to this textbook: “A. Silberschatz, P. B. Galvin and G. Gagne, “Operating System Principles,”7th Edition, John Wiley & Sons Inc., 2006.”
And answer the following questions:
Question7:
A practical way to handle network partitioning is to: (a) Have each process start an election. (b) Elect a leader only if a majority of nodes can be reached. (c) Run a normal election and multicast the result to the subset of processes that can be reached. (d) Divide and conquer: elect multiple coordinators.
Chapter 11 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 11.3 - Prob. 11.1PPCh. 11.3 - Prob. 11.2PPCh. 11.3 - Practice Problem 11.3 (solution page 967) Write a...Ch. 11.4 - Prob. 11.4PPCh. 11.5 - Prob. 11.5PPCh. 11 - Prob. 11.6HWCh. 11 - Prob. 11.7HWCh. 11 - Prob. 11.8HWCh. 11 - Modify TINY SO that when it serves static content,...Ch. 11 - Prob. 11.10HW
Knowledge Booster
Similar questions
- Computer Science Using java socket programming, write a server program and a client program based on the following requirements.(a) The server listens for request from the client program and will display the following options to the client. 1. Calculate the surface area of a rectangle 2. Calculate the length of a string 3. Calculate the volume of a sphere The server program will request the necessary input from the client based on the selected option and return the results to the client to be displayed. (b) The client program will display the options from server and provide all the necessary input to the server. All results from the server will be. displayed on the client side.arrow_forwardQ7. ] Given the following ARM64 assembly code for a function, add comments to each line, use its stack frame with corresponding variables, and trace the code execution to figure out what it does. Notice that local variables are stored in the function's stack frame. Hint: this is a void function that takes two input parameters. tunct: sub sp. sp, #32 str x0, (sp, 8] Address Contents x1, [sp) Idr x0, Isp, 81 str SP Sp + 4 Sp +8 Sp + 12 Sp + 16 Sp + 20 Sp + 24 Sp + 28 Idr wo, [x0] str wo, [sp, 28] Idr x0, [sp) Idr w1, [x0] Idr x0, [sp, 8] w1, [x0] Idr x0, Isp) str Idr w1, [sp, 28] str w1, [x0] DOR add Sp. sp, 32 retarrow_forward9.23 The starting address of the trap routine is stored at the address specified in the TRAP instruction. Why isn't the first instruction of the trap routine stored at that address instead? Assume each trap service routine requires at most 16 instructions. Modify the semantics of the LC-3 TRAP instruction so that the trap vector provides the starting address of the service routine.arrow_forward
- Quiz-1: Refer to Lecture-3 Module 1 swap (int* V, int k) { temp = V[k]; /* temp in $t0 */ V[k] = V[k+1]; V[k+1] = temp; } Write the swap() function using special registers required for accessing parameters passed to this function. Use “t” registers for any needed temporary registers.arrow_forwardQuestion 3: On a byte addressable machine a string COMSATS UNIVERSITY ISLAMABAD PAKISTAN, starting from logical address 0 (zero) to 36 is to be loaded into memory, in noncontiguous fashion, using 'Paging' technique. The string is divided mechanically into equal sized pages of 4 bytes; similarly the memory is also divided into equal sized frames of 4 bytes. The ASCII code of each Character occupies one byte. The free frame list is given as follows: 8,3,4,2,6,7 ,5,1,9,21,24, 11 Answer the following questions a. What is the page map table? b. What are the linear logical addresses of characters 'U' and_'B'? c. What are the linear physical addresses of characters 'U' and_'B'? d. What is the difference between Internal and External fragmentation? e. What is the internal fragmentation in loading given string?arrow_forward5.14 Write a version of the inner product procedure described in Problem 5.13 that uses 6 x 1 loop unrolling. For x86-64, our measurements of the unrolled version give a CPE of 1.07 for integer data but still 3.01 for both floating-point data. A. Explain why any (scalar) version of an inner product procedure running on an Intel Core i7 Haswell processor cannot achieve a CPE less than 1.00. B. Explain why the performance for floating-point data did not improve with loop unrolling.arrow_forward
- Quiz 5: In this problem we want to set the control signals of the datapath shown below (also in in slide # 1 of "chapter3_single_cycle_datapaths.pptx") so that it supports execution of a new instruction called swi. Single Cycle Datapath: PC Read Instru- address ction [31-0] Instruction memory Sns Add Ins 1 [25-21] 1 [20-16] [15-11]. 1[10-0] RegWrite Read register 1 Read register 2 Write register Write data Read data 1 Read data 2 Read Ins Write 3ns Sign extend 2ns MemWrite Read Read address data Write address Read Gns Write data Write 10ns ins ALUSTO1 MemRead ALU Result 2ns ALUOP1 -XEWO) ins ALUSrc2 ALUSrc3 x=3 ins ALU Result 2ns ALUOP2 swi rd, rs, rt, imm # Memory [R[rs]]= R[rt], R[rd] =R [rs]+R [rt]+Imm #this instruction copies contents of "rt" register into the main memory addressed by the "rs" register. In the same cycle it add "rs" and "rt" register contents along with the "imm" field of the instruction and writes the final result into the "rd" register. You are NOT allowed to…arrow_forwardWrite a service routine which resets all elements of an array that resides in memory location from A000 H to A0FF H with DS equal to 0000 H. The service routine address is CS:IP where CS is 2000 H and IP is 0100H. Assume the interrupt type that is called is 50 (x8086- nano)arrow_forward3. Calculate the physical memory location for each of the following cases? a- The logical address D470H in the extra segment. b- The logical address 2D90H in the stack segment. C- MOV [BP],AL if BP=2C30H. Assume ES=52B9, SS=5D27, DS=E000, and CS=B3FF.arrow_forward
- 3- What is the difference between: a- MOV BX,[1234H] and LEA BX,[1234H] b- LDS AX,[200H] and LES AXX,[200H] 4-Use MOV to load address of memory MEM1.arrow_forward2. Use the defined GPR of TMP (it is a DATA) and RST (It is an ADDRESS), present your ASM codes that can perform the followings: TMP EQU 0X30 RST EQU OX36 (a) TMP – OXDF Result in W (b) 0X8A - TMP → Result in RSTarrow_forwardDo execution paths 3 and 4 encompass the first three conditions for a deadlock to occur?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education