CS447_Summer2005_Mid..

advertisement
CS 447-Network and Data Communication
Midterm Exam No.1 (SOLUTIONS)
Summer, 2005
6:00-7:15 P.M.
June 20, 2005
This exam is a closed-book and closed note exam. There are 8 questions in this exam.
You have 75 minutes to finish the questions. Please write your answers on separated
piece of papers. To avoid grading problems, please staple your papers in the ascending
order in the question number. Calculator can be used during this exam, but you can not
share a calculator with anyone else.
Name: _______________________________
Last 4 digits of your SID: ___________________
QUESTION #1 (10 minutes)
#1: Name each layer of OSI seven-layer model (from low level to high level).
(1) Physical layer
(2) Data-link layer
(3) Network layer
(4) Transport layer
(5) Session layer
(6) Presentation layer
(7) Application layer
#2: What is the purpose of network layer (please describe it using at most two sentences)?
To manage point-to-point data transmission
#3: What is synchronous transmission (please give the brief definition – the one we got
in the class)?
The synchronous transmission is a type of data transmission where receiver
resynchronize the sender at every bit (or a type of data transmission where
transmitted signals have timing information for receiver synchronization).
1
Note: A similar definition with a correct idea will be acceptable
#4: Show the six procedures of asynchronous transmission at the receiver side
 Detect the first downward signal transition
 Adjust the local clock
 Receive as many data bits as the receiver is supposed to.
 Receive the parity bit
 Perform parity error detection
 Skip (ignore any signal) while stop bit(s)
#5: What are the five key words that describe “what is “socket” (you do NOT have to
describe them, just name the five key words)?
Virtual connection
 Socket is bi-directional
Socket is dynamic (can be created/deleted any time)
 Communication tool for most of the Internet network applications
Two process communicate using a socket
QUESTION #2 (10 minutes)
#1: What is the minimum requirement (for transmission rate) for the shared link for a
statistical TDM shown below? Assumptions are given on the pack.
Multiplexer
De-Multiplexer
N input
lines
N output
lines
Assumptions are:
The shared multiplexed line
(1) Assuming there are n inputs (the number of the input lines is assumed to be
powers of 2 for simplicity, such as 2, 4, 8, 16, …2x).
(2) All the input lines have the same transmission rate of 5Mbps.
(3) The slot size for each input line is s bits
Solution:
s  ceiling (log 2 N )
 (5  N ) Mbps
s
2
#2: Access speed of the memory in “buffered-statistical” TDM is potentially a problem.
Mention two possible problems.
(1) Memory Access Speed
(2) Buffer capacity
#3: What is the advantage and disadvantage in synchronous transmission (mention one
for each)?


Advantage: High reliability (or something equivalent)
Disadvantage: Base transmission rate must be doubled.
#4: Describe what is “port”? How you can choose available port?
Port is a logical connecting point for two communicating processes using socket.
Note: the key word is “connecting point”. It’s not a connection, but a connecting
point.
#5: Encapsulation” is essential to layering. Please describe why “encapsulation” is
essential to layering.
A header and payload data in the upper layer will be handled simply as payload
and a header will be added to the payload data. Without this scheme, layering is
impossible.
Grading Criteria: Something similar will be fine. However, the underlined part
(or something equivalent) should be mentioned.
QUESTION #3 (7.5 minutes)
Assuming that all other factors remain unchanged, what is the effect to the
link utilization (for Stop-and-Wait and Sliding-Window Flow Control) if we
changed a factor (as mentioned below)? Choose one from the following four
options (or combination of the four, if needed) for each: "improved",
"unchanged", "lower" or "can't tell". You do NOT have to describe your
answer. For sliding-window, assume that the utilization is currently 50%
and that window size is larger than one. Assume the window size for the
sliding window is some integer larger than 1.
(a) if the link distance becomes shorter?
Stop-and-Wait: IMPROVED
Sliding-Window: IMPROVED
(b) if the transmission rate is decreased?
3
Stop-and-Wait: IMPROVED
Sliding-Window: IMPROVED
(c) if the frame (packet) size is increased?
Stop-and-Wait: IMPROVED
Sliding-Window: IMPROVED
(d) if half-duplex transmission is used (this assumes that we are currently using
full-duplex transmission)?
Stop-and-Wait: NO-CHANGE
LOWER
Sliding-Window:
QUESTION #4 (10 minutes)
This is exercise question #7.4 from the textbook (with a minor modification): In the
figure below, frames (packets) are generated at node A and sent to node C through node
B. Determine the minimum data rate required between nodes B and C so that the
buffers at node B are not flooded, based on the following assumptions. If it is not
possible, show that it is impossible.








The data between A and B is 10 Mbps (M = 106)
The propagation delay is 5s/Km for both lines
There are full-duplex lines for both lines
All data frames are 1,000 bits long; ACK frames are separate frames of
negligible length.
Sliding-window flow control is used for link A-B.
Stop-and-wait flow control is used for link B-C
Window size = 100
No error
A
B
4,000Km
C
1,000Km
Solution:
(a) For link A-B:
TP = 5s  4,000 = 20,000s
TF = 1000/10Mbps = 103/107 = 102/106 = 100s
U = (100  100)/(2  20,000 + 100) = 10,000/40,100 = 25%.
Throughput = 10Mbps  0.25 -= 2.5Mbps.
(b) For link B-C:
4
TP = 5s  1,000 = 5,000s
TF = 1000/R
U = (1000/R)/(2  0.005 + 1000/R)
Throughput of (b)  Throughput of (a)
Throughput of (b)  2.5Mbps
U  R  2.5Mbps
((1000/R)/(2  0.005 + 1000/R)  R)  2.5Mbps
1000/(0.01 + 1000/R)  2.5Mbps
1000  2.5Mbps  (0.01 + 1000/R)
1000  25,000 + (2.5  109)/R
1,000  R  25,000R + (2.5  109)
- (2.5  109)  24,000  R
This will not give us a positive value for R, implying that it is impossible to
achieve.
QUESTION #5 (10 minutes)
CRC error detection still can end up with non-detectable errors. Demonstrate an
example of a non-detectable error in CRC (you need to prove that your example is really
a non-detectable error by showing the error detection at the receiver side) using the
following assumptions:


Message bits: "1 0 1 1 1 1" (6 bits)
Key: "1 1 0" (3 bits)
You need to show the bit errors that will end up with an non-detectable error in CSC
error detection.
A sample solution is attached to the end of this document.
QUESTION #6 (10 minutes)
This is exercise question #6.5 from the textbook (with a minor modification): An
asynchronous transmission scheme uses 8 data bits, and even parity bit, and two
stop-bits. What percentage of clock skew can be tolerated at the receiver with respect to
the framing error? Assume that each bit will be correctly recognized (i.e., no bit error)
as long as a bit is sampled within its bit time (i.e., if sampling does not occur beyond the
5
bit boundary to its neighboring bit). Show your work.
Solution:
If everything works fine (i.e., three is no clock skew), the boundary of every frame will
be always correctly recognized by the receiver (as shown by the figure below).
In the figure:





Each rectangle represents a bit
Blue rectangle indicates “1” bit
The small notch at the middle of each bit indicates a sampling point by
the receiver side.
The red up-going transitions are those that indicate a correct frame
head
The green up-going transitions are those that indicate an incorrect
frame head.
Sender’s Recognition
frame i
frame (i+1)
01
transition
01
transition
S         P T1 T2 S  
frame i
frame (i+1)
Receiver’s Recognition
There are two different ways framing error can happen: (a) if the receiver clock is faster
or (b) if the receiver clock is slower than that of the sender clock. Let us see each case
one by one.
(a) If the receiver clock is faster: The minimum clock skew for a framing error to
happen is that the receiver sampling of the first stop bit (T1) goes across the
boundary of 8th payload bit and the parity bit (this is the earliest position where a
fake up-going transition can happen). See the figure below.
For this case, the amount of clock drift is: 1.5 bits (from the middle of the first stop
bit (T1) divided by 10.5 bit (from the beginning of frame i to the middle of the first
stop bit (T1)). 1.5/10.5 = 14.3%
Sender’s Recognition
frame i
frame (i+1)
S         P T1 T2 S  
frame i
6
frame (i+1)
Receiver’s Recognition
(b) If the receiver clock is slower: The minimum clock skew for a framing error to
happen is that the receiver sampling of the second stop bit (T2) goes across the bit
boundary between the second stop bit and the start bit of the next frame. If this is
the case, the receiver will sample the second stop bit (T2) as “1”, which is
impossible. Then, the receiver starts looking for the next 01 transition, which can
happen between the first payload bit and the second payload bit (or later).
For this case, the amount of clock drift is: 0.5 bits (from the middle of the second
stop bit (T2) divided by 11.5 bit (from the beginning of frame i to the middle of the
second stop bit (T2)). 0.5/11.5 = 0.4%
Sender’s Recognition
frame i
frame (i+1)
01
transition
01
transition
S         P T1 T2 S  
frame i
frame (i+1)
Receiver’s Recognition
QUESTION #7 (7.5 minutes)
Suppose we are transmitting data using synchronous transmission. The transmission
cable is capable of transmitting at 10MHz (10 millions cycles of square-wave signals
per second). Assume that the frame header is 128 bits, payload field is 256 bytes and the
trailer is 64 bits. If we transfer data using asynchronous transmission, using the same
transmission cable, how large the payload in a frame should be to achieve the same line
throughput for the synchronous transmission? Assume 1-bit start-bit, 1-bit parity and
2-bit stop bits for the asynchronous transmission.
The utilization of the synchronous transmission is:
2048
2048

 0.9142
128  (256  8)  64 2240
7
Since the throughput is a product of utilization and the transmission bandwidth, its
throughput is:
10Mbps  0.9142 = 9.412Mbps
Asynchronous transmission can transmit 20 million bits using 10MHz cable. Assuming
that the utilization of the asynchronous transmission is U, we will get the following
formula for the throughput of the asynchronous transmission:
U  20Mbps  9.142Mbps
Solving the above equation, we will get: U  0.4571
Assuming the payload size of the asynchronous transmission is x bits, then, we need to
satisfy the following condition:
x
 0.4571
1 x 1 2
Solving this formula for x, we will get, x  3.368. However, x must be an integer,
therefore, x  4 (the payload size must be 4 bits or more).
QUESTION #8 (10 minutes)
A channel has a data rate of R bps and a propagation delay of T seconds/Km. The
distance between the sending and receiving nodes is L kilometers. Nodes exchange
fixed-size frames of B bits using Sliding-Window flow control. Find a formula that
gives the minimum sequence field size of the frame as a function of R, T, B, and L
(considering maximum utilization). Assume that ACK frames are negligible in size and
the processing at the nodes is instantaneous.
Solution:
First, we need to find the open-window size to reach U = 100%.
Tp = (T  L) seconds
Tf = B/R seconds
The condition for Sliding-Window to reach U = 100% is: N  Tf  ((2  Tp) + Tf).
Solving this equation for N, we will get N 
2  Tp  T f
Tf
.
For having N frames “on the fly” in the transmission link,
8






 2  Tp  T f

Tf

we need Ceiling  log 2  Ceiling 
sequence number in the frame header.
9
  
  bits for storing the frame


Solution for QUESTION #5
10
___________________________________________________________________
CS447, Network and Data Communication, Midterm #1, June 20, 2005
11
Download