# NETWORK HW1
***
###### 廣電四 陳韋溢 108103049
***
R11.
Suppose there is exactly one packet switch between a sending host and a receiving host. The transmission rates between the sending host and the switch and between the switch and the receiving host are R1 and R2, respectively. Assuming that the switch uses store-and-forward packet switching, what is the total end-to-end delay to send a packet of length L? (Ignore queuing, propagation delay, and processing delay.)
#### Ans → $\frac{L}{R1}$ + $\frac{L}{R2}$ = total end-to-end delay
***
R13.
Suppose users share a 2 Mbps link. Also suppose each user transmits continuously at 1 Mbps when transmitting, but each user transmits only 20 percent of the time. (See the discussion of statistical multiplexing in Section 1.3.)
a.
When circuit switching is used, how many users can be supported?
b.
For the remainder of this problem, suppose packet switching is used. Why will there be essentially no queuing delay before the link if two or fewer users transmit at the same time? Why will there be a queuing delay if three users transmit at the same time?
c.
Find the probability that a given user is transmitting.
d.
Suppose now there are three users. Find the probability that at any given time, all three users are transmitting simultaneously. Find the fraction of time during which the queue grows.
#### Ans
a. → 2
b. → There are 2 Mbps avaliable, so if only 2 users to share this capacity, the Mbps will be shared equally. However, if there are 3 users to shapre this capacity, they cannot share eqaully, which means that a user must wait.
c. → 20% = 0.2, so 0.2(active)
d. → 0.2 * 0.2 * 0.2 = 0.008
***
R18.
A user can directly connect to a server through either long-range wireless or a twisted-pair cable for transmitting a 1500-bytes file. The transmission rates of the wireless and wired media are 2 and 100 Mbps, respectively. Assume that the propagation speed in air is 3 x 10
8
m/s, while the speed in the twisted pair is 2 x 10
8
m/s. If the user is located 1 km away from the server, what is the nodal delay when using each of the two technologies.
#### Ans
1. Transmission Delay
- 1500 bytes = 1500x8 = 12000 bits
- wireless: 12000 / 2 Mbps = 0.006
- wired: 12000 / 100 Mbps = 0.00012
3. Propagation delay
- wireless: 1000 (m) / 3 x $10^8$(m/s) = 0.0000033
- wired: 1000 (m) / 2 x $10^8$(m/s) = 0.0000050
4. Transmission Delay + Propagation delay
- Wireless → 0.006 + 0.0000033
- Wired →0.00012 + 0.0000050
***
R19.
Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rate R1 = 500 kbps, R2 = 2 Mbps, and R3 = 1 Mbps.
#### Ans
a. → 500 kbps
b. 4 million bytes * 8 / 1000 = kbps; 4 million bytes * 8 / 1000 / 500 = 64 (sec), so Ans → 64 (sec)
c. new throughput is 100 kbps; 4 million bytes * 8 / 1000 / 100 = 320 (sec)
***
P2.
Equation 1.1 gives a formula for the end-to-end delay of sending one packet of length L over N links of transmission rate R. Generalize this formula for sending P such packets back-to-back over the N links.
#### Ans
- Links: N * L/R
- Packets: (P-1) * L/R
- so, (N * (L/R)) + ((P-1) * (L/R)) → Ans
***
P4.
Consider the circuit-switched network in Figure 1.13. Recall that there are 4 circuits on each link. Label the four switches A, B, C, and D, going in the clockwise direction.
#### Ans
a. 4 * 4 = 16
b. 4 * 2 = 8 (A-B-C) and (A-D-C)
c. Yes
- (A-C)
- (A-B-C) * 2
- (A-D-C) * 2
- (B-D)
- (B-C-D) * 2
- (B-A-D) * 2
- so, sum of the numbers, then, get 8
***
P5.
Review the car-caravan analogy in Section 1.4. Assume a propagation speed of 100 km/hour. Tollbooths are 75 km apart, and the cars propagate at 100km/hr. A tollbooth services a car at a rate of one car every 12 seconds. There are 10 cars.
#### Ans
a.
1. 12 (sec) * 10 = 120
2. 12 * 3 = 360 sec
3. 360 / 3600 = 0.1 hr
4. (75 / 100) * 2 = 1.5 hr
5. 1.5+0.1 = 1.6hr
b.
1. 12 * 8 = 96
2. 96 * 3 = 288 sec
3. 1.5 hr + 288 sec → ans
***
P6.
#### Ans
a. d_prop = m/s
b. d_trans = L/R
c. d_end_2_end = d_prop + d_trans
d. last bit of the packet does not enter the link
e. on the link, but not reach Host B
f. first bit of the packet has already reached Host B
g. L * s = m * R; 120 * (2.5 * 10^8) = m * 56kbps, so m = 535714 (m)
***
P7.
#### Ans
packet generate time = 7 msec
transmission delay = 0.224 msec
propagation delay = 10 msec
so, 17.224 msec
***
p8.
#### Ans
a. 3 * 1024 / 150
b. 0.1 or 10 %
c. 0.1^(n) * (0.9)^(120-n)
d. 0.794%
***
P9.
#### Ans
a. 10
b. 1 - P(X<=N) // I don't know how to present my answer in pdf using mathematical symbols.
***
P10.
#### Ans
Yes
***
P11.
#### Ans
d2 >= (L/R1) - (L/R2) +d1
***
P12.
#### Ans
N * (h/R) + (L/R)
***
P13.
#### Ans
a. (N*(N-1))/2N * L/R, so 1/2 * (N-1) * L/R
b. 1/2 * (N-1) * L/R
***
P14.
#### Ans
a. (L/R) / (1-I)
b. 
***
P15.
#### Ans
total = a/(2(u-a)) + 1/u
***
P16.
#### Ans
500 avg per arrival rate
***
P20.
#### Ans
***
P21.
#### Ans
R_i in network A is higher than the minimum among in network B.
***
P22.
#### Ans
(1/(1-p)^N) -1
***
P23.
#### Ans
***
P24.
#### Ans
fastest way: 3.
***
P25.
#### Ans
a. 160000 bits
b. 160000 bits
c. the difination of bandwidth-delay product is how much data can be send into(or on (?)) network link before it's delivered
d. 125 > [90,120]
e. wide of bit general experession = s/R
***
P26.
#### Ans
a. 1 * 10^9 * 0.1 = 1 * 10^8 bits
b. 1 * 10^8 bits
c. 0.2
***
P27.
#### Ans
after 8, 8/2 = 4(at most four messages), if >4, resulting in losing.
***
P28.
#### Ans
m * (Rs/Rc+1)
***
P29.
#### Ans
a. 0.15 seconds
b. 1500000 bits
c. 600000000 bits
***
P31.
#### Ans
a. 4 sec, 12 sec
b. 0.005 sec, 0.01 sec
c. 4.01 sec, 7.99 sec
d. Faster, Congestion Control
e. Potential for Increased Delay due to Errors
***
P32.
#### Ans
Segmentation is more beneficial than non-segmentation. The main reasons is that in the no segmentation scenario, the entire message must propagate before the next message can begin(queue), which adds a full propagation delay to the total transmission time.
***
P33.
#### Ans
0?