Você está na página 1de 5

(1) (10 pts) In lectures, we have discussed the following types of nslookup commands:

nslookup type=a
nslookup type=ptr
nslookup type=ns
nslookup type=mx
nslookup type=cname

(a) (3 pts) Write down the complete nslookup command for finding the IP address of the
domain name server for HKUSTs domain.

ANS: nslookup type=ns ust.hk

(b) (3 pts) Write down the complete nslookup command for finding the IP address of the
machine www.yahoo.com.

ANS: nslookup type=a www.yahoo.com

(c) (4 pts) A public IP address assigned to a machine may be dynamic in the sense that it
will change from time to time (the IP addresses assigned to our home routers are an
example). In contrast, if a machine has a static IP address, then the address will be assigned
only to that machine. Most of the IP addresses assigned to host machines on campus are
static IP addresses. Suppose we know that a public IP address has been assigned to some
machine, and we want to find out if that IP address is a static IP address or not. Which
command from the list abovecan provide at least some useful information to answer this
question? Explain your answer with no more than 20 words.

ANS: we should try nslookup type=ptr command. Reason: a dynamic IP address cannot
have a DNS name.


(2) (8 pts) Assume CIDR is used in a network. A router has the following routing table:

IP address / mask Outgoing Port No
192.168.14.0 / 24 1
192.168.15.0 / 23 2
192.168.128.0 / 17 3
192.168.10.0 / 22 4
0/0 2

(a) (4 pts) Which port should be used for an incoming packet 192.168.192.33? Explain. (b)
(4 pts) Repeat (a) for 192.168.1.125.


ANS: (a) it matches the entry 192.168.128.0 / 17. Thus port 3. (b) it only matches 0/0. Thus
port 2.



(3) (10 pts) (a) (3 pts) When an IP packet passes through a regular router, which fields in
the IP header will be changed? Ignore packet fragmentation in this question. (b) (3 pts)
Assume the packet is generated from a workstation with a private IP address. Repeat (a) if
the packet passes through a port-translating NAT which uses only one public IP address to
support many workstations. Again, no fragmentation is involved. (c) (4 pts) The first byte
of an IP packet is 01000010. This packet will be discarded by a router immediately. Why?
Use less than 15 words to explain the reason.
ANS: (a) TTL, Checksum (b) IP address (either destination or source IP addresses), TTL,
Checksum (c) 00100010: this part should be 5.

(4)(8 pts) NAT traversal is a difficult problem to overcome in designing P2P applications.
Some NATs assign ports in a predicable way by just incrementing the port number for a
new entry added to the NAT. We can exploit this feature to set up a connection between
two machines A and B even if they are located behind a symmetric type NAT. Assume
server S has a public IP address. The way to set up the connection is done the following
way. First, A and B will send a packet to server S. This allows S to get the translated IP
address and port of A and B: (IP_a , Port_a) and (IP_b, Port_b).
S will inform A and B about each others translated IP address and port number. Once A
and B receive the message from S, they send out a packet to each other immediately by
incrementing the destination port number (i.e. Port_a and Port_b) by 1 because this will be
the new port number assigned by their NATs. But there is still a problem. If a packet
reaches the other sides NAT before the corresponding entry is opened, the packet is
dropped and the NAT will send back a TCP packet with RST bit = 1 to the other side. This
will kills the TCP channel immediately.
Assume the following delay information:
Delay between S and A = 50 ms (fixed)
Delay between A and B = 20 ms (fixed)
(a) Assume the delay between S and B is 40 ms. Can the connection between A and B be
set up successfully? (b) Assume the delay between S and B is uniformly distributed
between (20ms, 50ms). Compute the probability that the connection between A and B can
be set up successfully.

ANS: (a) Yes. The packet from B will arrive at A at t = 60ms. At that time, A has already
received the packet from S to A. In addition, the packet from A will arrive at B at t=70ms
at which time B has already received the packet from S to B.
(b) ANS: 2/3 Let D_sb to be the delay between S and B. D_sb + 20ms > 50 and 50ms
+ 20ms >D_sb. So when D_sb is between 30ms and 50ms, the connection between A and
B will be set up successfully. (50ms-30ms)/(50ms-20ms)=2/3


Time line is the following: The shaded area is the delay from S to B. The orange area represents
the failure.





(5) (10pts) ping is a well-known utility program to test the reachability of a
destination machine. Assume that when the ping command is executed, it will send out
only ONE ping message from one to another machine. The round trip delay between the
two machines will be reported for each ping message.
In the mobile IP network shown below, assume the delay between any two routers is 30
ms, and the delay between a machine and its attached router can be ignored. (a) Assume
indirect routing is used in the mobile IP network. When B sends a ping message to A,
what would be the reported round trip delay for this ping message? (b) Repeat (a) if direct
routing is used in the mobile IP network where router Z will retrieve the location
information of A first before sending the message to A. (c) Repeat (b) with the following
scenario: three seconds later, B executes the same ping command and another ping message
is sent to A. What would be the reported round trip delay? Here we assume that any
retrieved location information will be cached by router Z for 10 sec.
ANS: (a) 90ms (b) 120 ms (c) 60ms


(6) (8 pts) Two stations A and B use a link-layer protocol for error recovery. The protocol
uses 3 bits for packet IDs. Assume A is the sender and B is the receiver and they use
accumulative ACK for error recovery. Note that ACKs piggyback on the data packets of
Z
t=20 t=30 t=50


the reverse direction. Both the sending and receiving window sizes are 4 and the initial
sending and receiving window are the same: 0,1,2,3. In the discussion below, assume all
ACK(s) sent by B will reach A correctly.
(a) Suppose A has transmitted four packets: 0 1 2 3. But B only receives 0 and 3 correctly,
and Packets 1 and 2 are lost. B will handle the ACKs according to the rule of the
accumulative ACK scheme. After these events, what are the sending window and the
receiving window? (b) A while later, packet 2 arrives at B correctly. Again, B will handle
the ACK according to the rules of accumulative ACK. What would be the sending and the
receiving window after the events above.
ANS: (a) sending window: 1234 , receiving window: 1234 (b) sending window: 1234,
receiving window: 1234.

(7) (10 pts) Hosts A and B opens one TCP channel. Suppose that all packets are transmitted
with a constant packet size (called MTU) and the sender will grow its window linearly
according to the following formula: Wi= Wi-1 + MTU. Assume that ACKs will be lost once
the total bandwidth of A and B reaches 1M bps. When an ACK is missing, the window
sizes of both A and B will be halved and the same congestion control process will be
repeated after that.

To simplify the discussion, we assume that (a) the MTU is very small and the bandwidth
increases in a continuous fashion, and (b) the buffers of both As and Bs TCP connections
are very large and allow their bandwidths to grow beyond 1Mbps.
Assume at t0, host As TCP channel has the bandwidth of 300 Kbps and Bs TCP channel
has the bandwidth of 200 Kbps. (a) When their total bandwidth reaches 1 Mbps, what is
the bandwidth of Bs TCP channel? (b) Once the total bandwidth reaches 1M bps, both A
and B will reduce their window size by half and continue the congestion control process.
When their total capacity reaches 1Mbps again, what is the bandwidth of Bs TCP channel?
(c) Repeat (b) with the following assumption: the buffer size of Bs TCP connection
remains very large, but As TCP buffer size only allows the bandwidth of this TCP channel
to grow to 400 Kbps.




A
1M bps
B Router


1M
Bandwidth (host A)
1
M

B
a
n
d
w
i
d
t
h


Figure b





ANS: (a) 450 Kbps (b) 475 Kbps (c) 600 Kbps.
(8) (8 pts) In the web-caching scenario described in the class notes, we assume the
following:
average message size = 100,000 bits
avg. number of requests from institutions browser to origin serves = 15/sec
the round-trip delay from institutional router to any origin server = 1 sec

Assume the formula x/(1 x) can be used to compute the average total queuing delay
(including the transmission time) for a message crossing the link connecting the LAN and
the Internet, where is the number of messages per second, and is the average
transmission time of each message. Since request packets are small, the uplink (from LAN
to the Internet) is not a bottleneck and we can ignore the uplinks queuing delay and only
consider the downlinks queuing delay (i.e. from the Internet to LAN). Assume also that
the delay in LAN is small and can be ignored.
(a) Compute the average delay for retrieving a message if the hit ratio of the web cache is
0.04. (b) Repeat the calculation if hit ratio = 0.8.
ANS:
(a) If there is a miss, then the delay=(1/15)/(1-0.96)+1=2.67 sec. So the average delay is
2.67*0.96=2.56 sec.
(b) The delay for a miss=(1/15)/(1-0.2)+1=1.083 sec. So the average delay is
1.083*0.2=0.217 sec.

Você também pode gostar