Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

22 Questions for Midterm Exam - Network Programming | CS 228, Exams of Computer Science

Material Type: Exam; Class: Network Programming; Subject: Computer Science; University: Northern Michigan University; Term: Unknown 2009;

Typology: Exams

Pre 2010

Uploaded on 08/01/2009

koofers-user-dg1-1
koofers-user-dg1-1 🇺🇸

5

(1)

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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 www.ceasar.com it
takes 400 milliseconds round trip, and that a 100 byte packet takes 300 milliseconds. What is
the bandwidth between me and www.ceasar.com?
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?
pf3
pf4

Partial preview of the text

Download 22 Questions for Midterm Exam - Network Programming | CS 228 and more Exams Computer Science in PDF only on Docsity!

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 www.ceasar.com it takes 400 milliseconds round trip, and that a 100 byte packet takes 300 milliseconds. What is the bandwidth between me and www.ceasar.com?
  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?
  1. 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
  1. 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
  1. 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).
  2. (true/false) Part of the TCP header is the congestion detection bit.
  3. (true/false) Part of the IP header is the destination MAC address.
  4. When your computer turns on, it does the DHCP thing. How many packets must it send to get a IP number?
  5. When you use DHCP, the (client/server/neither) determines the lease length.
  6. 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.
  7. 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?
  8. Why don't all senders start with a sequence number of zero? Why mess with starting elsewhere? What's the point?