Wednesday, November 13, 2013

Chapter 3 HW Continued

P7. ACK packets do not need sequence numbers because the rdt3.0 can tell right away if duplicate ACKs have already gone through. The reason we don’t have sequence numbers is because we simply don’t need them. The duplicate ACK is ignored when sent through from the rdt3.0 sender because it does not need it.
P8. The rdt3.0 FSM receiver is the same as the rdt2.2 one.
P10. A timer would have to be added where the value of it is greater than the RTT propagation delay. A timeout event would also have to be added to wait for the ACK or NAK1 as well as wait for the ACK or NAK0. If the timeout event then occurs, the most recent transmitted packet is retransmitted. These modifications will work because if the timeout is caused by a lost packet or lost ACK, then the retransmission is sent to the receiver.
P16. Yes, this would cause the sender to send a lot of pipelined data into the channel. There are potential problems that can arise. For example, if data segments are lost, then the sender of the rdt3.0 won’t re-send them.
P24. A) True. If there is a sender that has a window size of 3, and sends packets 1, 2, and 3 at t0, at t1 the receiver ACKs 1, 2, and 3. At t2, the sender times out and resends 1, 2, and 3. Then at t3, the receiver will receive the duplicates and ACK 1, 2, and 3. At t4, the sender receives the ACKs that t1 sent and moves the window to 4, 5, 6. The finally at t5, the sender receives the ACKs 1, 2, and 3 sent at t2. These ACKs would then be outside the window of 4, 5, 6.
B) True, same reason as A).
C) True
D) True, a window size of 1 eliminates the possibility of out of order packets so the alternating bit protocol and the GBN would essentially be the same.
P26) A) The maximum size file that can be sent is the number of bytes representable by the total number of possible sequence numbers (2^32) which is about 4.19 GB.
B) 2^32/536 = 8,012,999
Next, the number of segments is 66 bytes of header that get added each segment making a total of 528,857,934 bytes of header. The total number of bytes if 2^32 + 528,857,934 = 4.824 * 10^9 bytes. Then considering the 155mbps link, the transmission would take 249 seconds.

Chapter 3 HW

P3. The sum of the first two numbers is 01010101
                                                            01110000
                                                          =11000101
The after adding the 3rd number          +11001100
                                                             10010001

So 1's compliment will then be 01101110. UDP takes 1's compliment over the sum because at the recieving end, all the bits should be zero when there are no errors. To detect errors the check sum looks for zeros. A checksum of 1111 means there is no error in the packet. 1-bit errors can't be undetected but in some cases a 2-bit error can be undetected.

P4.a)     00110100
           +01101001
             10011101 -- So 1's compliment is 01100010

b)     11011010
      +01100101
        00111111 -- So 1's compliment is 11000000 

c)     If the first 0 is changed to 1 and the second byte (1) is changed to 0, then 1's compliment stays the same and the error is undetected.    
                                                           11110101
                                                         +00101001
                                                           11100000
       
P5. The UDP checksum cannot be certain that there are no errors. Checksum is designed to look for single errors and can be easily thrown off or tricked by 2 or more errors. For example. The binary of 2 and 5 are 010 and 101. But if 2 errors occurred where the binary was changed to 011 and 100, which is 3 and 4, the total would still equal 7. In this case the error goes undetected although the packet was changed. If only one of the binary's changed then the error would be easily detected.

P6.






















Thursday, October 17, 2013

Chapter 2 HW

HW2
P2) The client commands that are supported by RFC are
-          CONTROL COMMANDS
o   USER NAME (USER)
o   PASSWORD (PASS)
o   ACCOUNT (ACCT)
o   CHANGE WORKING DIRECTORY (CWD)
o   CHANGE TO PARENT DIRECTORY (CDUP)
o   STRUCTURE MOUNT (SMNT)
o   REINITIALIZE (REIN)
o   LOGOUT (QUIT)

-          TRANSFER COMMANDS
o   DATA PORT (PORT)
o   PASSIVE (PASV)
o   REPRESENTATION TYPE (TYPE)
o   FILE STRUCTURE (STRU)
o   TRANSFER MODE (MODE)

-          FTP SERVICE COMMANDS
o   RETRIEVE (RETR)
o   STORE (STOR)
o   STORE UNIQUE (STOU)
o   APPEND (APPE)
o   ALLOCATE (ALLO)
o   RESTART (TEST)
o   RENAME FROM  (RNFR)
o   RENAME TO (RNTO)
o   ABORT (ABOR)
o   DELETE (DELE)
o   REMOVE DIRECTORY (RMD)
o   MAKE DIRECTORY (MKD)
o   PRINT WORKING DIRECTORY (PWD)
o   LIST (LIST)
o   NAME LIST (NLIST)
o   SITE PARAMETERS (SITE)
o   SYSTEM (SYST)
o   STATUS (STAT)
o   HELP (HELP)
o   NOOP (NOOP)
P3) The application layer protocols are DNS and HTTP. The transport layer protocols are UDP for DNS and TCP for HTTP.

P6)a) Either the client or the server can indicate to the other that it is going to close the persistent connection. By using the connection token “close” in the header of the request or the reply.
b) HTTP does not provide any encryption services
c) Yes, but it is not recommended. A single-user client should not maintain more than 2 connections with any proxy or server.
d) “A client might have started to send a new request at the same time that the server has decided to close the "idle" connection. From the server's point of view, the connection is being closed while it was idle, but from the client's point of view, a request is in progress.”

P7) The total amount of time to retrieve the IP address would be

RTT(1) + RTT(2) +RTT(3) + … + RTT(n)

Next part – A TCP connection has to be established once the IP address is known. Then another RTT(o) has to be sent to get the small object. So the total response time would be equal to

2RTT(o) + RTT(1) + RTT(2) + RTT(3) + … + RTT(n)

P8) 
Part A - RTT(1)+ RTT(2) + … + RTT(n) + 2RTT(o) + 8*2RTT(o)
Part B - RTT(1) + RTT(2) + … + RTT(n) + 2RTT(o) + 2*2RTT(o)
Part C - RTT(1) + RTT(2) + … + RTT(n) + 2RTT(o) + RTT(o)

P10) First we need to denote the propagation delay for each of the downloaded objects which will be x. Next since a parallel download splits up the bandwidth by how many parallel downloads there are, the 150 bits/sec bandwidth for 10 connections would become 15 bits/sec.  So for the non-persistant connection, we see that the total time needed to download all the objects is
200/150 + x + 200/150 + x + 200/150 + x + 100,000/150 + x
+
200/15 + x + 200/15 + x + 200/15 + x + 100,000/15 + x
______________________________________________
7377 + 8*x

Then for the PERSISTENT connection, the total time needed is
200/150 + x + 200/150 + x + 200/150 + x + 100,000/150 + x
+
10(200/150 + x + 100,000/150 + x)
______________________________________________
7351 + 24*x

-- There is no big gain with the persistent connection over the non-persistent connection.

P13) The MAIL FROM: in SMTP is just a message from the SMTP client that figures out the sender of the mail to the SMTP server. The From: is not a SMTP message but just a regular line of text in the mail.
P14) A line with just a period is used to mark the end of a message body. HTTP cannot use the same method used by SMTP because HTTP could be binary where the SMTP MUST be in ASCII.

P15) MTA stands for Mail Transfer Agents. The malicious host is IP address 58.88.21.177 and the e-mail address is inbnd55.exchangeddd.com. You can see that this host is trying to hide behind the honest looking e-mail address tennis5… because the e-mail is BY inbnd and from tennis5.

P16) A good way to find out would be to take periodic looks at the DNS cache of the department. The web servers that are more popular are going to the ones that appear more frequently in the DNS cache.

Monday, September 30, 2013

Chapter 1 HW

P3. a) A circuit-switched network would be more efficient for this job because the line will stay open while there is a break between the time of the N-bit units of data being sent. Plus with the circuit-switched network you are guaranteed full bandwidth while sending the N-bits.
P3. b) There should be some form of congestion control because with packet-switched networks there is a chance of packet loss if the stream becomes too congested which could also lead to a long delay.

P5. a) If the caravan is traveling at 150km/hr and the toll booth can send through 5 cars per minute then the total delay between the 3 toll booths is (10 cars through 3 toll booths at 5 cars/min) = 6 minutes. Then the total end-to-end delay of the cars traveling through the toll booths not including the time waiting is 200km/(150km/hr) = 80 minutes plus the 6 minutes totaling 86 minutes.
P5. b) If the caravan has eight cars as opposed to the previous ten, the time traveled between the toll booths will still remain at 80 minutes because the caravan is still traveling 200km at 150km/hr. The only difference her is that the delay from the toll booths will be slightly less. Because there are two less cars in the caravan this time, the total delay from the toll booths will be (8 cars through 3 toll booths at 5 cars/min) = 4 minutes 48 seconds (1 min 36 sec/booth). Thus resulting in the total end-to-end delay of 84 minutes 48 seconds.

P6. a) d(prop) is equal to the distance traveled over the speed. In this case the distance is represented by m and the speed is denoted by s. So the answer would simply be m/s.
P6. b) d(trans) is equal to the length of the packet L divided by the speed of the bits/sec R. So the answer would be L/R
P6. c) Ignoring the processing and queuing delay, the expression to represent the total end-to-end delay would be d(nodal) = d(prop) + d(trans)
P6. d) At time t = 0 the last bit of the packet most likely has not been sent yet because at time t = 0 the first bit of the packet is just sending. Once the entire packet has been transmitted, that is when it will be sent.
P6. e) The first bit of the packet is on the propagation delay because for the first bit to begin on the prorogation delay, the whole packet has to be received at the the end of the transmission delay.
P6. f) Same as P6. e)
P6. g) d(prop) is represented by d/s or (d/2.5 * 10^8 m/s) and d(trans) is represented by L/R or (120 bits/56 kbps). In order to find d, the d(trans) and d(prop) must be equal so set (d/2.5 * 10^8 m/s) = (0.01465 kbps). Then multiply that by 2.5 * 10^8 m/s to get d = 3662500 meters.

P9. a) 1024 people can be supported on the link but because of the probability being 0.1, the link can only support at max, 921 users.
P9. b) N = M - (M * p)

P10. a) (L/R1 + d1/s1) + (L/R2 + d2/s2) + (L/R3 +d3/s3)
P10. b) (3(1500 bytes/2 mbps = 0.0007s) = 0.002s) + (5000000 m/2.5 * 10^8 m/s = 0.02s) + (4000000 m/2.5 * 10^8 m/s = 0.016s) + (1000000 m/2.5 * 10^8 m/s = 0.004s) + (3(0.003) = 0.009s) = 0.051s

P11. a) 0.051s - (d(proc)) 0.009s = 0.042s

P12. a) Because once a packet arrives it only has the wait the last half of the time for the packet in front to finish being transmitted, the answer would be the speed of the transmission divided by 2 and wait for the other 4 packets to be sent. So 1500 bytes/2 mbps = 0.0007s. But since it is already half done being sent the queuing delay will only be 0.0007s/2 + (4(0.0007)) = 0.00315s

P13. a) Due to the fact that the packets arrive simulatenously, one packet must wait the full time for one packet to finish transmitting. So the queuing delay will be the entire time of L/R.
P13. b) N(L/R)

P14. a) d(nodal) = (IL/R(1- I)) + (L/R)

P15. a) (a/u(1 - a)) + (a/u)

P19. a) 4 links are the same between the 2 traceroutes. The transatlantic link is the same.
P19. b) None of the links are the same except for the return traceroutes back to the easternct IP.
P19. c) None of the links are the same and they did not diverge before reaching China.

P22. a) (1 - p)

P23. a) LRs bits/sec
P23. b)

P24. a) 40 Terabytes would be 41943040 mbps which would take 419430.4 seconds to send completely. That 419430.4 secs is 6990.5 minutes which is 116 hours (roughly 5 days). So I would rather send the 40 terabytes on Fed-Ex over night delivery because it would be much quicker than to transfer the data over a 100 mbps link. If you wanted to send it overnight by data transfer, a good course of action would be to invest in Google Fiber to get a 1 gb/sec upload speed. Then the transfer would be significantly quicker (10 times quicker to be exact). So that 5 day transfer would become a 12 hour transfer (roughly).

P25. a) (20000000 m/(2.5 * 10^8 m/s)) / 2 = 0.04s
P25. b) Considering the probability of 0.1 the maximum number bits sending at any given time would be 1843.2 kbps or 1.8432 mbps
P25. d) 50m, no
P25. e) m/R

P27. a) (20000000 m /(2.5 * 10^8 m/s)) / 1000 =  0.00008s
P27. b) 900 mbps
P27. c) 25000m

P31. a) 8000000/ (209715200 * 8) = 0.0047s for 1 link, (0.0047s * 3) = 0.0143s for total time
P31. b) 10000/ (209715200 * 8) = 0.000005s for 1st packet, 0.000011s for 2nd packet
P31. c) (0.000005s * 800) = 0.0047s (No difference)