Problem 1 (10 points)
You are responsible for a network client application and a server application which is used for a vending machine. You must design an application programming interface as well as the network protocols needed to communicate between the vending machine and the vending machine control center.
The user flows/capabilities must include: (remember to consider error cases)
- Logging in using a username/password using the vending machine touch screen.
- User selection of product and user being able to confirm the purchase after seeing the price. Price is stored and can be retrieved from the vending machine control centre.
- User must use a credit card through the card reader for payment. Card reader must communicate with the control centre in order to charge the credit card. User must be shown the correct approval or decline message from the control centre.
- User must be able to retrieve the product and see a thank you message on the machine. (Thank you message is dynamic and can be retrieved from control centre) - Machine must report back to control center its current stock level per product. - Machine must not enable a user to pay for a product which is not in stock.
a) What protocols will you use for layer 1, 2, 3, and 4?
b) Draw the Finite State Machine for the Vending Machine.
c) Draw the Finite State Machine for the Command Center Server.
d) Define the application protocol. Clearly define the methods (functions) for the protocol, the expected and possible responses to the requests as well as a diagram that shows the order and direction of the message flows between the vending machine and control center.
e) Explain how you can mitigate accidental double credit card charges and in what conditions these mitigations are needed for this error to occur using your protocol.
Problem 2 (10 points)
See following cost and network diagram:
a) Use the link state routing algorithm (Dijkstra’s) to compute the paths of least cost from node a to other nodes (See Table 5.1 in textbook for example)
b) Create the forwarding table for node a. (see Figure 5.4 in textbook for example)
c) Use the link state routing algorithm (Dijkstra’s) to compute the paths of least cost from node e to other nodes (See Table 5.1 in textbook for example)
d) Create the forwarding table for node e. (see Figure 5.4 in textbook for example)
Problem 3 (2 points)
a) Explain the benefits of TCP Reno to TCP Tahoe. In what scenarios would TCP Reno be better than TCP Tahoe?
b) Explain the benefits of TCP Tahoe to TCP Reno. In what scenarios would TCP Tahoe be better than TCP Reno?
Problem 4 (8 points)
a) Describe the difference between TCP flow control and congestion control.
b) How is the TCP congestion window used to ensure fair network access amongst multiple clients on a network?
c) In what field of the TCP header is the Receive Window communicated and what is the unit for this window? (in bits or bytes?) (As in, does this indicate the number of bits or bytes that the receiver can consume).
d) What should a TCP server do if the receive window is equal to 0?
Extra Credit (2 points)
Explain the benefits of implementing the network stack in a layered model. What flexibility does this provide?