Docsity

Communications System - Computer Netrwork - Solved exam, Exams of Computer Networks

Toggle sidebar
bg1
Mid-Term Exam for Computer Networks Fall 2009
>>> SOLUTIONS <<<
Welcome to the Mid-Term Exam for Computer Networks. Read each problem carefully. There are eight
required problems (each worth 12 points – you get 4 points for correctly following these instructions). There is
also an additional extra credit question worth 10 points. You may have with you a calculator, pencils and/or
pens, erasers, blank paper, and one 8.5 x 11 inch “formula sheet”. On this formula sheet you may have anything
you want (definitions, formulas, homework answers, old exam answers, etc.) as handwritten by you in pencil
or ink on both sides of the sheet. Photocopies, scans, or computer generated and/or printed text are not allowed
on this sheet. Note to tablet PC users – you may not print-out your handwritten text for the formula sheet. You
have 75 minutes for the exam. Please use a separate sheet of paper for the answer to each question. Good
luck and be sure to show your work!
Problem #1
Answer the following questions regarding the basics of computer networks and the Internet.
a) What are the fundamental measures of a communications system?
0.25 each and round-up (2 pts total)
Throughput, delay, loss, cost, mobility, robustness, and secrecy
b) What are the basics tasks of a communications system?
0.25 each and round-up (2 pts total)
Message formatting, error detection and recovery, addressing, routing, flow control, system management,
security, and QoS
c) Consider the definitions of protocol and interface. Identify what is the same and what is different in a
protocol and interface.
1 each for same and difference (3 pts total)
Both are a complete set of rules for information exchange (same). A protocol is between same level layers, an
interface is between adjacent layers (different). A protocol is between sites, an interface is within a single site
(different).
d) Name the major components that typically constitute an end node. Do the same for an intermediate node.
Given an example of an end node and of an intermediate node.
0.25 each and round-up – identifying adapters is critical (2 pts total)
An end node will have a bus, CPU, memory, I/O, and an adapter. An intermediate node will have a bus, CPU,
memory, and more than one adapter. A PC (or iPhone or etc.) is an example of an end node. A router (or switch
or access point) is an example of an intermediate node.
e) Sketch the OSI model. Describe the purpose of each layer in one sentence or less.
0.5 each and round-up (3 pts total)
+------------------+
| Application | 7 – Provides access to applications
+------------------+
| Presentation | 6 – Provides data independence
+------------------+
| Session | 5 – Manages end-to-end connections
+------------------+
| Transport | 4 – Provides reliable end-to-end data transfer
+------------------+
| Network | 3 – Maintains point-to-point connections
+------------------+
| Data link | 2 – Provides reliable error-free point-to-point data transfer
+------------------+
| Physical | 1 – Transmission of bit stream (cabling, voltages, etc.)
+------------------+
pf3
pf4
pf5
pf8

Partial preview of the text

Download Communications System - Computer Netrwork - Solved exam and more Exams Computer Networks in PDF only on Docsity!

Mid-Term Exam for Computer Networks Fall 2009

>>> SOLUTIONS <<<

Welcome to the Mid-Term Exam for Computer Networks. Read each problem carefully. There are eight

required problems (each worth 12 points – you get 4 points for correctly following these instructions). There is

also an additional extra credit question worth 10 points. You may have with you a calculator, pencils and/or

pens, erasers, blank paper, and one 8.5 x 11 inch “formula sheet”. On this formula sheet you may have anything

you want (definitions, formulas, homework answers, old exam answers, etc.) as handwritten by you in pencil

or ink on both sides of the sheet. Photocopies, scans, or computer generated and/or printed text are not allowed

on this sheet. Note to tablet PC users – you may not print-out your handwritten text for the formula sheet. You

have 75 minutes for the exam. Please use a separate sheet of paper for the answer to each question. Good

luck and be sure to show your work!

Problem

Answer the following questions regarding the basics of computer networks and the Internet.

a) What are the fundamental measures of a communications system?

0.25 each and round-up (2 pts total) Throughput, delay, loss, cost, mobility, robustness, and secrecy

b) What are the basics tasks of a communications system?

0.25 each and round-up (2 pts total) Message formatting, error detection and recovery, addressing, routing, flow control, system management, security, and QoS

c) Consider the definitions of protocol and interface. Identify what is the same and what is different in a

protocol and interface.

1 each for same and difference (3 pts total) Both are a complete set of rules for information exchange (same). A protocol is between same level layers, an interface is between adjacent layers (different). A protocol is between sites, an interface is within a single site (different).

d) Name the major components that typically constitute an end node. Do the same for an intermediate node.

Given an example of an end node and of an intermediate node.

0.25 each and round-up – identifying adapters is critical (2 pts total) An end node will have a bus, CPU, memory, I/O, and an adapter. An intermediate node will have a bus, CPU, memory, and more than one adapter. A PC (or iPhone or etc.) is an example of an end node. A router (or switch or access point) is an example of an intermediate node.

e) Sketch the OSI model. Describe the purpose of each layer in one sentence or less.

0.5 each and round-up (3 pts total) +------------------+ | Application | 7 – Provides access to applications +------------------+ | Presentation | 6 – Provides data independence +------------------+ | Session | 5 – Manages end-to-end connections +------------------+ | Transport | 4 – Provides reliable end-to-end data transfer +------------------+ | Network | 3 – Maintains point-to-point connections +------------------+ | Data link | 2 – Provides reliable error-free point-to-point data transfer +------------------+ | Physical | 1 – Transmission of bit stream (cabling, voltages, etc.) +------------------+

Problem

Answer the following general questions:

a) What are the factors that cause delay in a computer network? Sketch queueing delay as a function of offered

load (think of offered load as a percentage of the capacity of the network) for a typical case.

0.5 pt each cause and 2 pts for graph and round up (4 pts total) The factors the cause delay are processing, transmission, propagation, and queueing. Queueing delay is non- linear and approaches infinity as offered load approaches 100%, something like this:

100% Offered load

Queuing delay

b) How can packet delay be reduced?

0.5 pt each cause and round up (2 pts total) Packet delay can be reduced by faster processing at end nodes, a faster transmission rate, and reduced distance between end-points.

c) Given a transmission link with data rate 10 Mb/s and a distance of 1000 miles. Assume a packet length of

1500 bytes. What is the packet transmission time and the packet propagation time? Are these times within

threshold for detection by a human (explain why or why not).

2 pt each (6 pts total) Transmission time is packet length divided by transmission rate, this is 1.2 milliseconds for this case. Propagation delay is the distance multiplied by the propagation rate. At 1 nanosecond per foot = 5 microseconds per mile we get about 5 milliseconds for the propagation delay. The human threshold for delay is about 100 milliseconds, so both of these delays are “instantaneous” to a human.

Problem

Answer the following questions regarding the Application Layer.

a) The application layer is which layer (i.e., which layer number) in the layered model used in our book (that is,

a layered model of the Internet “stack”)?

1 pt Layer 5 (the top layer)

b) An application layer protocol typically defines four things. What are these four things? Hint: Think about our

class standard.

1 pt each (4 pts total) Types of messages, syntax of messages, semantics of messages, and timing (when and how).

c) Identify in correct order the headers and trailers of a typical HTTP message transported on an Ethernet

network (for example, an HTTP response message from a server to a client).

0.5 each and round-up (3 pts total) In order, Ethernet header, IP header, TCP header, HTTP header, HTTP message, Ethernet trailer

a) What is the formula for link utilization for the sliding window protocol used on a single link from a sender to

a receiver? Give the formula in terms of link data rate, R (b/s), packet size, S (b), window size, W (pkts), link

distance, D (m), and medium propagation speed, p (m/s). Identify the constraint for 100% utilization of the

link. You may assume that the time to transmit an ACK packet and the time to process a packet are

negligible.

2 pts each part (4 pts total)

U = W ⋅ tfr ( 2 t pr + tfr ) where t pr = D / p and t fr = S / R. U cannot be greater than 1.0. For 100% utilization the

constraint is W ⋅ tfr > 2 t (^) pr + tfr.

b) Identify the six flags in the TCP header and briefly explain the purpose of each.

0.5 pts and round-up (3 pts total) URG – Urgent, location of urgent byte for received is indicated in urgent data pointer ACK – Acknowledgement of a segment received PSH – Indicates that receiver should pass (push) data to application layer immediately RST – Reset a connection SYN – Synchronize, used for initating a connection set-up FIN – Finish, used for initiating a connection close from one side

c) Why does TCP not update smoothed RTT estimates (for computing RTO) on retransmissions? Does TCP

modify RTO when retransmitting a packet? The key parameters (e.g., multipliers) in the RTO computation

algorithms are all powers of 2, why?

1 pts each (5 pts total) When retransmitting a packet after a time-out it is impossible to determine if a received ACK is for the original or re-transmitted packet. As such, TCP cannot correctly update the RTT estimate. On retransmission, TCP “backs- off” (typically, doubles) RTO. Using multipliers that are a power of 2 enables simple shift operations for multiplication and division (the floating point unit is not needed).

Problem

Answer the following questions about congestion control and fairness.

a) What is the fundamental trade-off in any congestion control scheme?

1 pt each (2 pts total) Throughput (or efficiency) versus fairness.

b) How does TCP detect congestion and how does it respond to it?

2 pt each (4 pts total) TCP implicitly detects congestion by a time-out (that is, ACK does not return before RTO times-out). TCP responds to this implicit detection of congestion by reducing its window size.

c) Consider 5 users (call them A, B, C, D, and E) that have connections on a single 10 Mb/s link. Connections

last for several minutes or perhaps even hours (i.e., they are bounded in time). Assume that user A requests 5

Mb/s for its connection, B requests 4 Mb/s, C requests 3 Mb/s, D requests 2 Mb/s, and E request 1 Mb/s.

Find a max-min fair allocation of bandwidth to the 5 users.

6 pts total Allocating 2 Mb/s to all nodes we find that E is “happy” with 1 Mb/s leaving 1 Mb/s to re-allocate, D is happy with 2 Mb/s (leaving nothing to re-allocate), and C, B, and A all have 2 Mb/s and need more. The 1 Mb/s is then allocated to C, B, and A (1/3 Mb/s to each) with a final max-min fair allocation of A get 2.33 Mb/s, B get 2.33 Mb/s, C gets 2.33 Mb/s, D gets 2 Mb/s, and E gets 1 Mb/s.

Problem

Answer the following questions about the network layer.

a) What is the fundamental purpose or service of the network layer?

0.5 each and round-up (1 pts total) To deliver packets end to end.

b) The purpose of a routing algorithm is to find the least cost path from source to destination. What are some of

the possible cost metrics (list at least five)? Identify which metrics are static and which are dynamic.

0.5 each and round-up (3 pts total) Cost metrics include hops, link capacity, throughput, congestion, and delay. The first two are static, the last three are dynamic (that is, they change as a function of offered load on the network).

c) For the six node network topology given below with link costs as shown, find the shortest path from node D

to node A using Dijkstra’s algorithm. Clearly state the order of nodes as they are added one-by-one by the

algorithm and give the path cost from node D to the added node. If there is more than one way (or order) of

adding links, given all possible ways (or orderings). To get you started, the first node added is E and the path

its cost is DE = 1.

1 pt each step and 1 pt for final path and cost (6 pts total) The solution is: {D,E} DE = 1 {D,E,C} DEC = 2 {D,E,C,F} DEF = 3 {D,E,C,F,B} DB = 3. {D,E,C,F,B,A} DECA = 3.5 (Final path from D to A is DECA at a cost of 3.5)

Extra Credit

Appendix B contains the RDT sender and receiver FSMs as developed in the textbook. Suppose an application

that uses RDT 3.0 somehow forces the receiver to keep sending back alternating ACK 0 and ACK 1 even if the

corresponding data have not arrived at the receiver (so, this would be a channel with very low utilization given

normal stop-and-wait operation). Would this change result in higher channel utilization? Why? Would there be

any side-effects? Why?

2.5 each (10 pts total) Yes, this actually causes the sender to send a number of pipelined data into the channel without waiting for a corresponding ACK. Yes, there are side effects. If data segments are lost in the channel, then the sender of rdt 3. won’t re-send those segments, unless there are some additional mechanism in the application to recover from loss.

// >>> Step #3 <<< // Receive from the server using the client socket retcode = recv(client_s, in_buf, sizeof(char), 0); if (retcode < 0) { printf("*** ERROR - recv() failed \n"); exit(-1); }

// Output the received message printf("Received from server: %s \n", out_buf);

// >>> Step #4 <<< // Send to the server using the client socket strcpy(out_buf, "This is a reply message from CLIENT to SERVER"); retcode = send(client_s, out_buf, strlen(out_buf), 0); if (retcode < 0) { printf("*** ERROR - send() failed \n"); exit(-1); }

// >>> Step #5 <<< // Close the client socket #ifdef WIN retcode = close(client_s); if (retcode == 0) { printf("*** ERROR - closesocket() failed \n"); exit(-1); } #endif #ifdef BSD retcode = close(client_s); if (retcode == 0) { printf("*** ERROR - close() failed \n"); exit(-1); } #endif

#ifdef WIN // Clean-up winsock WSACleanup(); #endif }

Appendix B – FSMs for textbook RDT protocol