Uploaded by teeya

A1Solution

advertisement
CMPT 371 Summer 2023
Assignment 1
Q1. (10 marks) In networking, the bandwidth-delay product (BDP) metric is obtained by multiplying
the link's bandwidth by the round-trip time (RTT). Assume a home is connected to an Internet Service
Provider’s (ISP) access point with a 3 km optical fiber at 70 Mbps. The speed of signal in an optical
fiber is approximately 70% of the speed of light, the latter itself being approximately 300,000 km/s.
The ISP uses a sliding-window protocol (see Lecture 1.)
a) Calculate the BDP over this optical fiber. (1 mark)
propagation delay (pd) =
RTT= 2×pd = 2×
. ×
=
. ×
,
,
BDP= bandwidth × RTT = 70,000,000 × 2×
. ×
,
= 2,000 bits
b) What should be the minimum window size in order to get 100% efficiency; i.e., no sender idle
time? (3 marks)
Two approaches (both are acceptable for this assignment) :
1) Approximation:
To have no server idle time, the window size should be such that the server is still transmitting when
the first acknowledgement from the receiver arrives. When the sender begins transmitting, it will take
one propagation delay time for the receiver to receive the first bit. Similarly, when the receiver sends
an acknowledgement, it will take one propagation delay time for the sender to receive that. So the
minimum window size should be such that by the time the sender has finished transmitting the whole
window, the sender has just received the first ack; i.e., the sender can continue transmitting.
Assuming frame and ack sizes are negligible, the minimum window size is equivalent to transmitting
enough bits to last one RTT. At 70 Mbps, window size= 2×
×70,000,000=2,000 bits.
. ×
,
2) Accurate calculation:
If we reject the above underlined assumption, the scenario changes as follows. Assume:
frame size = p bits
ack size = a bits
The receiver sends an acknowledgement after receiving the first frame, not the first bit. Similarly, the
sender needs to be still transmitting when it completely receives the complete ack from the receiver,
not the first bit of ack. So the sizes of the frame and the ack need to be added to the approximation. A
more accurate minimum window size is therefore:
2000+p+a bits
c) How does this minimum window size compare to BDP? Based on this, what is the physical
meaning of BDP? (2 marks)
For the approximation it’s exactly equal to BDP, and for the accurate solution it is nearly equal to BDP
if p and a are small relative to the window size. Based on this, we can say that the physical meaning of
BDP is an approximation of the maximum amount of un-acknowledged bits that can be transmitted
before a sender must wait for acknowledgements; i.e., the BDP approximates the minimum window
size for having 100% efficiency.
d) Assume the ISP moves the access point for this home further away. As a result, the optical fiber
length becomes 3.75 km. What will be the efficiency if we still use the same window size as
before? To reach 100% efficiency again, what should be the new window size? (2 marks)
Efficiency measures the percentage of time the sender is not idle. Since the sender is not idle as long as
it’s transmitting the window, we can say efficiency =
, limiting it to 1 if it’s larger than one.
The new BDP is 70,000,000 × 2×
.
. ×
,
= 2,500 bits
Assuming the sender is idle during the time difference between BDP and window size, efficiency is
= 80% But if the sender transmits again during the said idle time, efficiency will be higher.
To reach 100% efficiency again, the new window size should be at least 2,500 bits.
For the accurate solution, efficiency =
and everything else is the same.
e) In all of the above, does the size of the packet have any impact on efficiency? Explain. (2 marks)
Yes, as we can see in the accurate solution of part b) and d), packet/ack sizes play a role. Also, packet
size needs to be less than window size, hopefully order of magnitude smaller, to make the sliding
window protocol viable.
Q2. (4 marks)
a) Explain why a full-duplex Ethernet hub still requires collision detection like a regular Ethernet, but
a full-duplex Ethernet switch doesn’t. (2 marks)
Because a hub simply connects all stations together at once. So if two senders transmit almost
simultaneously, there can be collision. On the other hand, at a given time, a switch connects different
pairs of stations, and each pair is isolated from the other pairs. Even if both stations in a pair transmit
almost simultaneously, no collision will happen because the physical line is full-duplex; i.e., a single
line has 2 wires, so each of the two transmissions will go on a separate wire.
b) Does a half-duplex Ethernet switch require collision detection? Why? (2 marks)
Yes, because if both stations in a pair transmit almost simultaneously, there will be collision since the
line is half-duplex; i.e., there is a single wire.
Q3. (5 marks) In Ethernet, the standard maximum allowed distance of the medium is set to 232 bits. In
other words, the total length of the cable must be such that it would take a bit no more time to
propagate from one end of the cable to the other than the time needed to transmit 232 bits. Explain how
this leads to a time slot of 51.2 μs in 10Base5. Hint: a time slot must contain the worst-case scenario of
a collided transmission; i.e., from a station’s start of transmission until that station’s complete receiving
of the jamming signal.
Time to transmit 1 bit in 10Base5 =
,
,
= 0.0000001 s = 100 ns
Size of jamming signal = 6 bytes = 6×8 = 48 bits
The worst-case scenario happens as follows: there are 2 senders, each at the extreme and opposite ends
of the cable. Sender 1 listens and the line is idle, so it starts transmitting a signal, and just before the
first bit of that signal reaches sender 2; i.e., an ε shy of the amount of time it takes to transmit 232 bits,
sender 2 listens and the line is still idle, so sender 2 transmits too. Almost immediately sender 2 detects
a collision and sends a jamming signal, the first bit of which will reach sender 1 in the same time that it
takes to transmit 232 bits. The last bit of the jamming signal will arrive 48 bits after that at sender 1.
To contain this worst-case scenario, the time slot must be 232+232+48 = 512 bits, which is equivalent
to 512 bits × 100 ns = 51,200 ns = 51.2 μs
Side note: the minimum size of an Ethernet frame is also 512 bits = 64 bytes, for the same reason.
Q4. (4 marks) A station connected to an Ethernet network is sending the message HELLO to another
station connected to the same network. Source address is 00:40:05:1c:0e:9f and destination address is
00:09:f6:01:cc:b3. Assuming the text is being transmitted in ASCII, and the message is being sent
directly from the application to the data link layer; i.e., the application is bypassing transport and
network layers, calculate the checksum field in the trailer of this Ethernet frame. You may use an
online checksum calculator with CRC-32 Ethernet, Normal Generator, Big Endian.
“HELLO” in ASCII = 72 69 76 76 79 (decimal) = 48 45 4C 4C 4F (Hex)
Field
Destination Address (6 bytes)
Source Address (6 bytes)
Length (2 bytes)
Data
Padding
Value (hex)
00 09 F6 01 CC B3
00 40 05 1C 0E 9F
00 05
48 45 4C 4C 4F
41 bytes of padding to get to the minimum frame size of 64
bytes. Recall that the checksum takes 4 bytes too.
The padding can be any bit pattern, because it will be discarded
anyway at the receiver (after checksum verification). In this
solution we are using all 0x00.
The frame without Preamble+SoF becomes:
0x0009F601CCB30040051C0E9F000548454C4C4F0000000000000000000000000000000000000000000000000000000000000000000000000000000000
which has a CRC of 52 F8 C2 FD (CRC-32 Ethernet, Normal Generator, Big Endian)
Q5. (5 marks) A 500 m, 100 Mbps CSMA/CD LAN (not 802.3) has a propagation speed of
200m/μsec. Repeaters are not allowed in this system. Data frames are 512 bits long, including 16 bits
of header, checksum, and other overhead. The first slot after a successful transmission is reserved for
the receiver to capture the channel in order to send a 16-bit acknowledgement frame. What is the
effective data rate in bits per second from one end to the other, excluding overhead, and assuming there
are no collisions? At this effective bitrate, what is the efficiency of this 100 Mbps line?
Bit propagation time over the LAN =
= 2.5 μs
Data excluding overhead = 512 - 16 = 496 bits
Time to transmit a 512-bit frame =
,
,
Time to transmit a 16-bit acknowledgement =
= 0.00000512 s = 5.12 μs
,
= 0.16 μs
,
The question is asking for the effective data rate “from one end to the other”; i.e., the sender is at one
end and the receiver is at the opposite end. From the moment the sender transmits the frame’s first bit,
it takes the receiver 2.5+5.12=7.62 μs to receive the frame’s last bit. At this point, the receiver sends an
acknowledgement, and the sender receives the last bit of that acknowledgement 2.5+0.16=2.66 μs later.
So, it has taken 7.62+2.66=10.28 μs for 496 bits of data (without overhead) to be sent and
acknowledged. Therefore, the effective data rate in this scheme is:
= 48,249,027 b/s ≈ 48.3 Mbps
.
×
Side note: the efficiency of this network is therefore =
.
= 48.3%
Q6. (2 marks) Sketch the Ethernet Manchester encoding (IEEE 802.3 encoding) for the bit stream
0100110001. Clock starts low.
01100101101001010110
Download