COM-208: Computer Networks - Homework 3

Similar documents
c. If the sum contains a zero, the receiver knows there has been an error.

Answers to Sample Questions on Transport Layer

Problem 7. Problem 8. Problem 9

COMPUTER NETWORK. Homework #2. Due Date: April 12, 2017 in class

Preview Test: HW3. Test Information Description Due:Nov. 3

Communication Networks

Chapter 3 Review Questions

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Principles of Reliable Data Transfer

CS 421: Computer Networks SPRING MIDTERM I April 7, minutes

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check.

PROBLEMSAND EXERCISES

Chapter 3: Transport Layer

Lab 1 - Reliable Data Transport Protocol

Review problems (for no credit): Transport and Network Layer

Chapter 3: Transport Layer Part A

Reliable Data Transfer

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

The Transport Layer: TCP & Reliable Data Transfer

Computer Networks - Midterm

TDTS06: Computer Networks

The Transport Layer Reliability

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Lecture 9: Transpor Layer Overview and UDP

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

Computer Network 2015 Mid-Term Exam.

The GBN sender must respond to three types of events:

Chapter 3 Transport Layer

Basic Reliable Transport Protocols

Practice Problems: P22, 23, P24, P25, P26, P27, P28, P29, P30, P32, P44 and P45. Hand-in the following: P27, P28, P32, P37, P44

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

a) Adding the two bytes gives Taking the one s complement gives

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Lecture 5. Transport Layer. Transport Layer 1-1

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

CS 43: Computer Networks. 16: Reliable Data Transfer October 8, 2018

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

Lecture 7: Flow Control"

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

CSE 123: Computer Networks

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

TCP and Congestion Control (Day 1) Yoshifumi Nishida Sony Computer Science Labs, Inc. Today's Lecture

Lab 2: Implementing a Reliable Transport Protocol (30 points)

15-441: Computer Networks Homework 3

CSCD 330 Network Programming

SC250 Computer Networking I. Review Exercises. Prof. Matthias Grossglauser. School of Computer and Communication Sciences EPFL.

CSC 401 Data and Computer Communications Networks

ELEN Network Fundamentals Lecture 15

CSC 4900 Computer Networks: Reliable Data Transport

COSC4377. Useful Linux Tool: screen

CSC 401 Data and Computer Communications Networks

Announcement. Homework 1 due last night, how is that? Will discuss some problems in the lecture next week

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

Protocol Specification. Using Finite State Machines

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Chapter 3 Transport Layer

Lecture 6: Reliable Transmission. CSE 123: Computer Networks Alex Snoeren (guest lecture) Alex Sn

Lecture 11 Overview. Last Lecture. This Lecture. Next Lecture. Medium Access Control. Flow and error control Source: Sections , 23.

CMSC 332 Computer Networks Reliable Data Transfer

CSE434 Computer Networks (FALL, 2009) Programming Assignment 3 Due: Wed, December 2, 2009

CSE 3214: Computer Network Protocols and Applications Transport Layer (Part 2) Chapter 3 outline. UDP checksum. Port numbers

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 8

ECE5650: Computer Networking and Programming Term Project Assignment Part II: Total 100 points

Programming Assignment 5: Implementing a Reliable Transport Protocol

Lecture 10: Transpor Layer Principles of Reliable Data Transfer

Lecture - 14 Transport Layer IV (Reliability)

Part ONE

Question 1 (6 points) Compare circuit-switching and packet-switching networks based on the following criteria:

CSCE 463/612 Networks and Distributed Processing Spring 2018

CPSC 441 COMPUTER COMMUNICATIONS MIDTERM EXAM SOLUTION

UNIT IV -- TRANSPORT LAYER

School of Engineering Department of Computer and Communication Engineering Semester: Fall Course: CENG415 Communication Networks

Name Student ID Department/Year. Midterm Examination. Introduction to Computer Networks Class#: 901 E31110 Fall 2006

Transport layer. Our goals: Understand principles behind transport layer services: Learn about transport layer protocols in the Internet:

CSE 473 Introduction to Computer Networks. Exam 2. Your name here: 11/7/2012

rdt2.0 has a fatal flaw!

CSE 489/589 Programming Assignment 2

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H...

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 7

Course on Computer Communication and Networks. Lecture 4 Chapter 3; Transport Layer, Part A

Data Link Control Protocols

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

NWEN 243. Networked Applications. Layer 4 TCP and UDP

CSE 473 Introduction to Computer Networks. Midterm Exam Review

CSC358 Week 4. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

===================================================================== Exercises =====================================================================

Lecture 2 Communication services The Trasport Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

TCP: Flow and Error Control

Computer Communication Networks Midterm Review

CC451 Computer Networks

Unit 2.

c) With the selective repeat protocol, it is possible for the sender to receive an ACK for a packet that falls outside of its current window.

Transport layer: Outline

Chapter 11. User Datagram Protocol (UDP)

Good Ideas So Far Computer Networking. Outline. Sequence Numbers (reminder) TCP flow control. Congestion sources and collapse

CS 3516: Advanced Computer Networks

The Transport Layer Multiplexing, Error Detection, & UDP

Transcription:

COM-208: Computer Networks - Homework 3 1 Application Layer 1. (P22) Consider distributing a file of F = 15 Gbits to N peers. The server has an upload rate of u s = 30 Mbps, and each peer has a download rate of d i = 2 Mbps and an upload rate of u. For N = 10, 100, and 1000 and u = 300 Kbps, 700 Kbps, and 2 Mbps, prepare a chart giving the minimum distribution time for each of the combinations of N and u for both client-server distribution and P2P distribution. 1 15 3 4 12 10 8 5 Figure 1: DHT setup for Problem 2. 2. Consider the circular DHT with shortcuts in Figure 1, where each node in the DHT also keeps track of (i) its immediate predecessor, (ii) its immediate successor, and (iii) its second successor (i.e., the successor of the node s immediate successor). Also, consider the following assumptions: Each node keeps track of its predecessor ONLY to know which files it is responsible for. Unlike in lectures, where the name of the node was not anyhow related to the files it is responsible for, in this exercise we assume that every node with ID n and predecessor m contains the files with file ID in the range [m + 1, n]. Note that the arrows in Figure 1 are unidirectional. A node cannot send a message to its predecessor. It knows it only to determine which files it is responsible for. For instance, the node 15 would be responsible for files in the range [13, 15]. Once a node receives a request for which it is indeed responsible for, assume that it can directly send the file to the node that initiated the request (because the request also contained the source transport address). 1

a. Suppose that peer 1 wants to learn where file with content ID 9 is stored. Write down the sequence of DHT protocol messages that the nodes exchange until peer 1 discovers the location of the file. b. Suppose that peer 3 learns that peer 5 has left. How does peer 3 update its successor state information? c. Now consider that the DHT nodes do not keep track of their second successor. Suppose that a new peer 6 wants to join the DHT and peer 6 initially only knows the IP address of peer 15. What steps are taken? (P30) As DHTs are overlay networks, they may not necessarily match the underlay physical network well in the sense that two neighbouring peers might be physically very far away; for example, one peer could be in Asia and its neighbour could be in North America. If we randomly and uniformly assign identifiers to newly joined peers, would this assignment scheme cause such a mismatch? Explain. And how would such a mismatch affect the DHT s performance? 2 Transport Layer 1. (P3) UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes: 00100011, 01001110, 01010100. a. What is the 1s complement of the sum of these 8-bit bytes? (Note that although UDP and TCP use 16-bit words in computing the checksum, for this problem you are being asked to consider 8-bit sums). Show all work. Note: wrap around if the sum overflows. b. With the 1s complement scheme, how does the receiver detect errors? Is it possible that an 1-bit error can go undetected? How about a 2-bit error? 2. (P11) Consider the rdt2.2 receiver in Figure 3.14 and the creation of a new packet in following two self-transitions 1 : Wait-for-0-from-below and Wait-for-1-from-below. a. Would the protocol work correctly if udt send(sndpkt) were removed from the self-transition in the Wait-for-1-from-below state? Justify your answer. b. What if udt send(sndpkt) were removed from the self-transition in the Wait-for-0-from-below state? [Hint: In this latter case, consider what would happen if the first senderto-receiver packet were corrupted.] 3. (P12) The sender side of rdt3.0 simply ignores (that is, takes no action on) all received packets that are either in error or have the wrong value in the acknum field of an acknowledgment packet. Suppose that in such circumstances, rdt3.0 were to immediately retransmit the current data packet (instead of waiting for a timeout). Would the protocol still work? [Hint: Consider what would happen if there were only bit errors; there are no packet losses but premature timeouts can occur. Consider how many times the nth packet is sent, in the limit as n approaches infinity.] 1 A self-transition is a transition from one state back to itself. 2

4. (P14) Consider a reliable data transfer protocol that uses only negative acknowledgments. Note that such a protocol is different than the protocol that combines NAK and ACK together. The NAK-only protocol uses the following rules: Receiver sends NAK N if packet N arrived corrupted. Receiver also sends NAK N when it receives packet N + 1 without previously receiving packet N. Suppose the sender sends data only infrequently. a. Would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? b. Now suppose the sender has a lot of data to send and the end-to-end connection experiences few losses. In this case, would a NAK-only protocol be preferable to a protocol that uses ACKs? Why? 5. (P15) Consider the cross-country example shown in Figure 3.17. How big would the window size have to be for the channel utilization to be greater than 97 percent? Suppose that the size of a packet is 1200 bytes, including both header fields and data. 6. (P22) Consider the GBN protocol with a sender window size of 4 and a sequence number range of 1024. Suppose that at time t, the next inorder packet that the receiver is expecting has a sequence number of k. Assume that the medium does not reorder messages. Answer the following questions: a. What are the possible sets of sequence numbers inside the sender s window at time t? Justify your answer. b. What are all possible values of the ACK field in all possible messages currently propagating back to the sender at time t? Justify your answer. 7. (P23) Consider the GBN and SR protocols. Suppose the sequence number space is of size k. What is the largest allowable sender window that will avoid the occurrence of problems such as that in Figure 3.27 for each of these protocols? 8. (P29) It is generally a reasonable assumption when the sender and receiver are connected by a single wire that packets cannot be reordered within the channel between the sender and receiver. However, when the channel connecting the two is a network, packet reordering can occur. One manifestation of packet reordering is that old copies of a packet with a sequence or acknowledgment number of x can appear, even though neither the sender s nor the receiver s window contains x. With packet reordering, the channel can be thought of as essentially buffering packets and spontaneously emitting these packets at any point in the future. What care must be taken to guard against such duplicate packets? 9. End-host A is connected to end-host B over a communication channel that has propagation delay d prop seconds and transmission rate R bytes/sec (in both directions). The channel is reliable and does not drop or reorder packets. A wants to send a file of size size F bytes to B. We define the duration of the file transfer as the amount of time that elapses from the moment A transmits the first bit of the file until the moment B receives 3

the last bit of the file (the duration of the file transfer does not include the amount of time it takes for A to receive the last ACK from B). (a) What is the minimum possible duration of the file transfer (regardless of which transfer protocol we use)? Assume that the entire file can fit in a single packet. (b) Suppose that the file transfer application uses a stop-and-wait protocol (also referred to as rdt3.0 in the book). What is the duration of the file transfer? Assume that the file transfer protocol uses packets of size size P bytes, and size P perfectly divides the size of the file, size F (i.e. size F size P is an integer). Both the size of packet headers and the size of ACKs are insignificant. (c) Suppose that the file transfer application uses a Go-Back-N (GBN) protocol with window size N. What is the duration of the file transfer? How does your answer compare to the result you found for the stopand-wait protocol? Assume that the window size N perfectly divides the number of packets that A transmits during the file transfer. (d) Suppose we want to choose between a GBN and a Selective Repeat (SR) protocol to perform the file transfer over the communication channel described above. Which one is a better choice? Justify your answer. 10. End-host A is communicating with end-host B using a Go-Back-N (GBN) protocol with window size N = 4 and valid sequence numbers ranging from 0 to 10. The channel between the two end-hosts never reorders packets, but can drop packets. Suppose B has received and acknowledged packets with sequence numbers 0 and 1, so it is expecting packet with sequence number 2. Instead, it receives packets with sequence numbers 4, 5, 2, and 3 (in this order). Which packets have been lost? What is the response of B when it receives each of the packets, 4, 5, 2, and 3? Complete the sequence diagram below by showing all packet exchanges and actions between the sender and the receiver. You should include: i) lost packets and ACKs, ii) timeout events and iii) changes to the sender and receiver window, when packets (including ACKs) are received by either end-host. We have already filled in some of the information: packet 2 got lost, A timed out waiting for an acknowledgment to packet 2. 4

A B pkt 0 timeout pkt 2 ACK 0 pkt 1 pkt 2 X ACK 1 5