中山大学2014软件学院计算机网络期中考试题目

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

1.Bandwidth and Delay

a. On a generic multi-hop network, explain the potential causes of delay for a packet:

• Propagation delay:

• Transmission delay:

• Queueing delay:

• Processing delay:

b. For a fixed network path, which of these delays are constant over time, and which ones vary with load? Explain why.

c. (Estimating bottleneck bandwidth). An interesting technique used to estimate the bottleneck bandwidth in a network is called packet pair. The idea is simple: you send two packets back-to-back (no gap), at the full bandwidth of the first hop. The receiver at the other end can then determine the bandwidth by measuring the delay between the receptions of the two packets. In this problem we will do just that, with a simplified 3-link network shown in the figure below, with no extra traffic, no queues, and instantaneous access to the medium.

Setup: In the figure, assume there is no queueing or processing delay, and that nodes can forward a packet as soon as (a) all bytes for the packet have been received from the previous link, and (b) the outgoing link is free. All three links have a propagation delay of 10ms; link AB has a bandwidth of 10Mbps ((107 bits per second), and link CD has a bandwidth of 8 Mbps (8 × 106 bps). You send two probe packets of 1000 bytes each, as depicted in the figure.

(a) In this setup, calculate the length of the interval t1t2in the figure. Do the same for t3t4

(b) In the diagram, draw the transmission of the two packets in the link BC, paying attention to when they must start and when they must end.

(c) You measure the delay t4t5 between the end of the receptions of the two packets to be 8 ms. Assuming that the link BC is the bottleneck bandwidth in the path, what is its bandwidth? Explain your reasoning.

2.Answer the following questions regarding TCP, UDP, IP,

and routing:

a)What are the important fields in the TCP, UDP, and IP headers?

Without these fields, the protocols would clearly not “work”.

b)Sketch the TCP connection initiation and connection termination

packet flows using a timing diagram.

3.Socket Programming

3.1. Consider the following Java application:

socket = new DatagramSocket(12345);

while (true) {socket.receive(packet);} What happens if somebody decides to run two instances of this

application on one machine and 4 UDP segments arrive at port 12345?

a) both instances of the application receive all 4 segments

b) one instance receives all 4 segments

c) some segments are received by one instance, other segments

are received by the other instance

d) one instance receives segments 1 and 3, the other receives

segments 2 and 4

3.2.Given the following lines from a Java program segment:

byte[] dataOut = new byte [512];

String userInput = inFromUser.readLine();

dataOut = userInput.getBytes();

Which of the following lines of code could be used to create a new UDP datagram packet to send the data that was provided by the user to a host identified by the InetAddress object IPAddress?

a) DatagramPacket packetToSend = new

DatagramPacket(dataOut, dataOut.length, IPAddress)

b) UDPPacket = new UDPDatagram (userInput,

userInput.length, IPaddress, 9876)

c) DatagramPacket packet = new DatagramPacket(dataOut, dataOut.length, IPAddress, 9876)

d) Socket datagramSocket = new dataGramPacket(dataOut, IPAddress)

3.3.

Consider a server socket object

socket = ServerSocket(12345);

What does the invocation of socket.accept() return?

a) 'true' if there is a new TCP segment in the socket's buffer, false otherwise

相关文档
最新文档