Computer Networks 159.334 Answers for Assignment No. 2 Semester 2, 2010 Problems Question 1 1.1 TCP opens a connection using the initial sequence number (ISN) 14534. The other party opens the connection with ISN 21763. Use a message sequence diagram to show the three TCP segments during connection establishment. Host 1 Host 2 SYN( SEQ=14534) SYN+ACK (SEQ=21763, ACK=14535) ACK (SEQ=14535, ACK=21764) 1.2 A TCP connection is using a window size of 10000 bytes and the previous acknowledgement number was 22001. It receives a segment with acknowledgement number 24001 and window size advertisement of 12000. Draw a diagram to show the situation of the window before and after. rwnd = 10000
BEFORE 22001 32000 window AFTER 24001 36000 window 1.3 A window holds bytes 2001 to 5000. The next byte to be sent is 3001. Draw a figure to show the situation of the window after the following two events. (a) An ACK segment with acknowledgement number 2500 and window size advertisement 5000 is received. (b) A segment carrying 4000 bytes is sent. 2501 7500 7000 window
Question 2 2.1 a) A P-box uses the following table for encryption. Show the box and connect the input to the output. 4 2 3 1 1 2 b) Is the P-box straight, compression or expansion? c) A 6 by 2 S-box adds the bits at the odd numbered positions (1, 3, 5, ) to get the right bit of the output and adds the bits at the even numbered positions (2, 4, 6, ) to get the left bit of the output. If the input is 110010 what is the output? If the input is 101101 what is the output? Assume the rightmost bit is bit 1. ANSWER a. Input: 1 1 0 0 1 0 output: 0 1 b. Input: 1 0 1 1 0 1 output: 0 0 2.2 Encrypt the message "THIS IS AN EXERCISE" using a shift cipher with a key of 20. Ignore the spaces between words. Decrypt the message to show how to get the original plaintext message.
Decryption of the message works as follows: Note: If you choose to number the letters of the alphabet from A = 01 to Z = 26, your answers will differ from the above. If you have done the working correctly, ie shifted 20 places, then you will receive full marks as long as you also showed the decryption process.
2.3 How secure is the RSA Algorithm? Try the following: Find d if you know that e=17 and n = 187. Show how easy it is to break the secret code if n is small. The main point in the RSA method is that n needs to be a very large number so that an intruder cannot factor it. In our example, n can be easily broken because, the intruder can find that n = 187 = 17 11. In other words, p is 17 and q is 11. Now, the intruder can calculate the value of φ = (17 1) (11 1) = 160, When the intruder knows this number and the public value of e = 17, the value of d can be found as d = 113. Thus, the secret can be broken! 2.4 Using e = 13, d = 37, and n=77 in the RSA algorithm, encrypt the message "FINE" using the values of 00 to 25 for the letters A - Z. For simplicity, do the encryption and decryption letter by letter. Note: A similar comment to the note for Q2.2 applies here also. If your numbering scheme is different from the above, your answer will be accepted if all other working is correct. 2.5 Encrypt "INTERNET" using a transposition cipher with the following key: 3 5 2 1 4 1 2 3 4 5 Question 3 Note: If you do not add the bogus/dummy characters you will not score full marks for this question. 3.1 Consider a leaky-bucket policer that polices the average rate and burst size of a packet flow. We now want to police the peak rate, p, as well. Show how the output of this leaky-bucket policer can be fed into a second leaky-bucket policer so that the two leaky buckets in series police the average rate, peak rate, and burst size. Provide the bucket
size and token generation rate of the second policer. See figure below. For the second leaky bucket, r p, b 1. Note: Some alternative answers that reverse this leaky bucket series are also acceptable. 3.2 One adaptive rate control method for broadband network management operates by requesting a source to reduce its output rate by a factor r every time that a congestion signal is received, and it increases its output rate by an additive amount b otherwise. Assuming that a source outputs at a rate of 100% at time t = 0. a) Suppose that the source receives four congestion signals and we observe that the output rate has fallen to 60%. Compute the reduction factor r in this case. b) Based on the result of a) above, if we receive a further two congestion signals and then no further congestion signals are sent from that point onwards. Compute the time required for the system to recover to its full 100% output rate if b = 5% per 10 msec. Rate is 100% at time t = 0. a) Rate after 4 signals would be 100r 4 = 60. Solving for r gives r 4 0.6 0.880112 b) After to more signals we have it as 0.4647588 = 46.5% if it now rises at the rate of 5% per 10 msec there are approximately 11 steps required to restore it to about 100% or 11 x 10msec = 110msec to reach 100% + + + + + + + +