takes 8 microseconds (or 0.008 milliseconds) to send a packet. in order for the sender to be
Question:
takes 8 microseconds (or 0.008 milliseconds) to send a packet. in order for the sender to be busy 90 percent of the time, we must have util = 0.9 = (0.008n)/ 30.016 or n approximately 3377 packets. Problem 13. In our GBN reliable data transfer protocol, the sender keep sending packets until it receives a NAK. A NAK is generated for packet n only if all packets up to n ? 1 have been correctly received. That is, n is always the smallest sequence number of a packet that is yet to be received. When the receives a NAK for packet n , it simply begins ending again from packet n onwards. This is like the GBN protocol in the text, except that there is no maximum number of unacknowledged packets in the pipeline. Note the sender can't actually know how many packets are unacknowledged. If the current sequence number if k and the last NAK was for packet n , then there may be as many as k ? (n ? 1) unacknowledged packets in the pipeline. Note also that a receiver does not know that packet n is missing until a packet with a higher sequence number is received! (The "gap" in the sequence numbers of received packets tells the receiver that a packet in the gap is lost). Thus, when the data rate is low (i.e., a large amount of time between packet transmissions), it will take longer for a receiver to notice a missing packet than when the data rate is high. Problem 14. In our solution, the sender will wait until it receives an ACK for a pair of messages (seqnum and seqnum+1) before moving on to the next pair of messages. Data packets have a data field and carry a two-bit sequence number. That is, the valid sequence numbers are 0, 1, 2, and 3. (Note: you should think about why a 1-bit sequence number space of 0, 1 only would not work in the solution below.) ACK messages carry the sequence number of the data packet they are acknowledging. The FSM for the sender and receiver are shown in Figure 2. Note that the sender state records whether (i) no ACKs have been received for the current pair, (ii) an ACK for seqnum (only) has been received, or an ACK for seqnum+1 (only) has been received. In this figure, we assume that the seqnum is initially 0, and that the sender has sent the first two data messages (to get things going). A timeline trace for the sender and receiver
the keyboard. c) If you use different port numbers, then the client will attempt to establish a TCP connection with the wrong process or a non-existent process. Errors will occur. Problem 22. See Web-server programming assignment for this chapter for guidance. Problem 23. With the original line, UDPClient does not specify a port number when it creates the socket. In this case, the code lets the underlying operating system choose a port number. With the replacement line, when UDPClient is executed, a UDP socket is created with port number 5432 . UDPServer needs to know the client port number so that it can send packets back to the correct client socket. Glancing at UDPServer, we see that the client port number is not "hard-wired" into the server code; instead, UDPServer determines the client port number by unraveling the datagram it receives from the client (using the .getPort() method). Thus UDP server will work with any client port number, including 5432. UDPServer therefore does not need to be modified. Before: Client socket = x (chosen by OS) Server socket = 9876 After: Client socket = 5432 Server socket = 9876 Chapter 3 Review Questions
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba