DOC PREVIEW
GT ECE 4110 - ECE 4110 Midterm

This preview shows page 1-2-3 out of 9 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 9 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

ECE4110 Spring Semester, 2010Midterm Exam 2SAMPLE NAME:OPEN BOOK, OPEN NOTES, CLOSED OLD TESTS.1. TCP Sequence vs. Time Graph See the sample sequence vs. time graph on the next page. Note the Y axis isin units of bytes. Consider tearing the page off so you can see both the question and the graph at the same time.(a) Estimate the initial value of the slow start threshold, and explain how you determined this value.(b) Estimate the value of the round trip time at about time 1.6 seconds, and explain how you determined thisvalue.(c) Estimate the value of the congestion window value (CWnd) at time 1.0, and explain how you determinedthis value.(d) Just before time 3.0, a single ack appears to generate a large number of data packets (10 or so). Explainwhy this happened.122. RIP Routing Table UpdatesThe table below gives the initial contents of a routing table at router A. Router A then receives three RIP updatemessages from routers C, B, and D (in that order). For each update, fill in the contents of A0s routing tableafter the update is received and processed.Original Routing Table at ADestination Distance Next HopNet1 3 CNet2 4 ANet3 2 BNet6 8 ENet7 3 BUpdate Message From CDestination DistanceNet1 4Net2 3Net3 4Net4 8Net7 6Routing Table at A after update from CDestination Distance Next HopUpdate Message From BDestination DistanceNet1 6Net3 4Net7 2Routing Table at A after update from BDestination Distance Next HopUpdate Message From DDestination DistanceNet1 6Net2 4Net3 2Net4 2Net7 2Routing Table at A after update from DDestination Distance Next Hop33. Using select to manage multiple sockets.On the next pages are excerpst from the chat server and client that we discussed in class.(a) What would have been the difference (if any) in behavior of the client and server if we specified an largetimeout (perhaps 10 seconds) in the select at line 33 in chatserv.cc rather than a 1 second timeoutspecified?(b) In the server, what would cause the actual variable to have a value of zero at line 50?(c) In the client, what would cause the break at line 30 to execute?(d) In the client, the keyboard input buffer is set to 10,000 bytes at line 37. What would be the observablebehavior if we set this buffer way too small, perhaps at only 10 bytes?41 // Demonstrate the use of "select" to implement a multiple socket manager2 // George F. Riley, Georgia Tech, Spring 201034 // This is the server side5 // Includes omitted for brevity6 vector<int> clientSockets; // Maintains a collection of client socket numbers78 int main(int argc, char**argv)9 {10 // Create socket and bind11 int listenSock = socket(AF INET, SOCK STREAM, 0);12 // Bind and listen here, omitted for brevity13 while(true)14 {15 fd set readSet;16 fd set errorSet;17 // Clear all bits to zero18 FD ZERO(&readSet);19 FD ZERO(&errorSet);20 // Now set the read bit for the listening socket21 int maxSock = listenSock;22 FD SET(listenSock, &readSet);23 // Set the read bits for each client socket24 for (unsigned i = 0; i < clientSockets.size(); ++i)25 {26 if (clientSockets[i] < 0) continue; // No longer used27 if (clientSockets[i] > maxSock) maxSock = clientSockets[i];28 FD SET(clientSockets[i], &readSet);29 }30 struct timeval t; // This specifies wait time31 t.tv sec = 1; // Wait for one second32 t.tv usec = 0;33 select(maxSock + 1, &readSet, &writeSet, 0, &t);34 // See if listening socket can be "read", ie. call accept35 if (FD ISSET(listenSock, &readSet))36 {37 int s = accept(listenSock, 0, 0);38 cout << "Got accept, socket " << s << endl;39 clientSockets.push back(s);40 }41 // Check each client for input data42 char buf[10000];43 for (unsigned i = 0; i < clientSockets.size(); ++i)44 {45 if (clientSockets[i] < 0) continue; // No longer used46 if (FD ISSET(clientSockets[i], &readSet) ||47 FD ISSET(clientSockets[i], &errorSet))48 {49 int actual = read(clientSockets[i], buf, sizeof(buf));50 if (actual <= 0)51 {52 clientSockets[i] = -1; // Note no longer used53 }54 else55 {56 // And echo this data to each clientProgram chatserv.cc557 for (unsigned j = 0; j < clientSockets.size(); ++j)58 {59 if (clientSockets[j] < 0) continue;60 int wrote = write(clientSockets[j], buf, actual);61 }62 }63 }64 }65 }66 }Program chatserv.cc (continued)61 // Demonstrate the use of "select" to implement a multiple socket manager2 // George F. Riley, Georgia Tech, Spring 201034 // This is the client side5 // Includes omitted for brevity6 int main(int argc, char**argv)7 {8 int s = socket(AF INET, SOCK STREAM, 0);9 // Connect to chat server here (omitted for brevity)10 while(true)11 {12 // We need to use select to read either from standard in (handle = 1)13 // or the socket14 fd set readSet;15 fd set errorSet;16 FD ZERO(&readSet);17 FDZERO(&errorSet);18 // Set two bits in the readSet bitmap, standard in and the socket19 FD SET(STDIN FILENO, &readSet);20 FD SET(STDIN FILENO, &errorSet);21 FD SET(s, &readSet);22 FD SET(s, &errorSet);23 // here we don’t use the write set or the time outvalue24 select(s + 1, &readSet, 0, &errorSet, 0);25 if (FD ISSET(s, &readSet) ||26 FD ISSET(s, &errorSet))27 { // Read from socket28 char buf[10000];29 int actual = read(s, buf, sizeof(buf));30 if (actual <= 0) break;31 // write the data to standard out32 write(STDOUT FILENO, buf, actual);33 }34 if (FD ISSET(STDIN FILENO, &readSet) ||35 FD ISSET(STDIN FILENO, &errorSet))36 { // Data available from keyboard37 char buf[10000];38 int actual = read(STDINFILENO, buf, sizeof(buf));39 if (actual <= 0) break;40 // Write to socket41 int wrote = write(s, buf, actual);42 }43 }44 close(s);45 }Program chat.cc74. Domain Name System - 16 pointsOn the next page is shown an packet capture of a DNS response packet. The packet capture starts with the Layer3 (IP) header. For all questions below you can give the answer in either hex or decimal.(a) What is the requestor’s IP address?(b) What is the source port number?(c) What is the domain name lookup being requested?(d) How many answers are present?(e) What is the domain name and IP address of the first answer.?(f) How many additional responses are there?(g) What is the IP address of the DNS server being used?(h) What is the domain name and IP address of one of the the associated name servers for this domain?8DNS Response Packet0x0000: 4500 013c 459b 4000 fe11 9fed 82cf e6050x0010: 8fd7 9d7b 0035 dc32 0128 0e78 5385 81800x0020: 0001 0009 0003 0003 0377 7777 0363 6e6e0x0030: 0363 6f6d 0000 ff00 01c0 0c00 0100 01000x0040: 0000 1f00 049d a6ff 13c0 0c00 0100 01000x0050: 0000 1f00


View Full Document

GT ECE 4110 - ECE 4110 Midterm

Documents in this Course
PUSH Flag

PUSH Flag

17 pages

Ethernet

Ethernet

33 pages

Load more
Download ECE 4110 Midterm
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view ECE 4110 Midterm and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view ECE 4110 Midterm 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?