CS 228 Midterm of Fun

1)I plug my Ethernet card into a switch. Then I turn on the switch. How does the switch know the MAC address of my Ethernet card?

2)I have a Macbook Pro. I has a 1Ghz CPU. It has 512 megabytes of ram. I'm connected to the cable modem with a 100 megabits/second ethernet. The cable company tells me my account in 1 megabits/second each way. I notice that if I send a 1,000 byte packet to it takes 400 milliseconds round trip, and that a 100 byte packet takes 300 milliseconds. What is the bandwidth between me and

3)Name one thing that select can do that poll simply cannot.

4)Assume this code is correctly used, and that fd1, fd2, and max are correctly set. Someone running the following could would have a problem. Which problem would they have?
void wait4it(int fd1, int fd2, int max) {
while(1) {
fd_set r;
struct timeval tv;
FD_ZERO(&r);
FD_SET(fd1, &r); FD_SET(fd2, &r);
tv.tv_sec = 0; tv.tv_usec = 100;
int ret = select(max+1, &r, 0, 0, &tv);
if (ret < 0) { cout < “Error”; exit(1); }
if (ret >0) break;
}
}

5)Does a switch decide which port to forward a packet based on MAC addresses or IP numbers?

6)Why is an Ethernet's maximum theoretical usage 34%, but normal Aloha is only 17%? What makes Ethernet so much more theoretically able to use more of it's bandwidth?

7)I want to be able to send smaller packets than the current Ethernet allows. What must I change to allow smaller ethernet packets

  1. Lower voltages
  2. Shorter cables
  3. Lower bandwidth
  4. Smaller time-to-live field

8)Suppose I notice a packet with the ACK, SNY, and FIN bits all set to true. What do I conclude?

  1. This is part of the initial three way handshake
  2. This is a normal data packet
  3. This is part of the end-of-conversation dialog

9)I wish to program my router to only allow outgoing connections. Therefore I should set my router to drop all packets with the ______bit set to ______, the ______bit set to ______, and heading (inward/outward).

10)(true/false) Part of the TCP header is the congestion detection bit.

11)(true/false) Part of the IP header is the destination MAC address.

12)When your computer turns on, it does the DHCP thing. How many packets must it send to get a IP number?

13)When you use DHCP, the (client/server/neither) determines the lease length.

14) Suppose that a TCP sender notices replies come back after delays of (in order) 10,10,10,10,10,10,10,10,10,10,10,200. Is the next timeout value based on only the 200, or do the 10's have an effect.

15)Lets suppose in TCP you have already sent an ack with value 1000. Then you receive a packet containing bytes 800-900. What should you do?

16)Why don't all senders start with a sequence number of zero? Why mess with starting elsewhere? What's the point?

17)When is the sliding window protocol much better than ping pong, and almost as good as selective repeat?

  1. With small packet sizes and low latencies and high error rates.
  2. With small packet sizes and high latencies and high error rates.
  3. With large packet sizes and low latencies and low error rates.
  4. With large packet sizes and high latencies and low error rates.

18)What is the maximum latency before a node can access the ethernet?

  1. Twice the propogation delay across the cable.
  2. Twice the propgation delay accross the cable plus the length of time needed to transmit a maximum size packet.

19)Spock has 3 piles of Mars sand. Kirk has 4 piles of Mars sand. If they put them together, how many piles do they have? ______

20)A different receiver and transmitted are to be used between the Mars orbiter and the Mars lander. The raw bandwidth is 1megaBYTE per second each way, and the latency is 0.1 seconds each way. The maximum packet size is 1 KB, and acks take just 1 byte. The error rate is effectively zero. The designer wants to use the ping pong protocol. What effective throughput should she expect (within 20% or so)?

21)Suppose the same designer wants to use the sliding window protocol. What effective throughput should she expect (within 20% or so)?

22)What bug did I find in Microsoft Spider Solitare?