Networking Protocols: ARQ, TCP, HTTP, WiFi, and Link Layer Analysis
An ARQ protocol operates between a sender and receiver on a 10Mbps channel (in both directions). Data packets are 10,000 bits each (including headers), and acknowledgment packets are 100 bits each (including headers). The wire is 20Km long. Assume the signal propagation speed on the channel is 2×10^8 m/sec. Assume there is no packet loss and processing delays are negligible.
a) Consider a scenario where the receiver acknowledges every packet, how long does it take from when the sender starts transmitting a packet until the sender fully receives an ACK for that packet?
Transmission Time = 10000/10^7 sec
Ack Time = 100/10^7 sec
Prop Delay = 20000/2×10^8 sec
Total time = Transmission time + Ack Time + 2x Prop delay
b) Now consider a situation where the protocol uses a constant window size of 5 packets. The window does not change. The sender has a large number of packets to send and the receiver acknowledges every 5th packet. What is the throughput (in bits per second) of the channel from the data sender to the data receiver?
Throughput = 50000/(5 x Transmission Time + 1 ACK Time + 2xPropagation Delay)
Give one reason for each of the following statements:
i) In the Internet, very small packets are undesirable. Too much overhead from packet headers
ii) In the Internet very large packets are undesirable. Bit errors more likely, or head of line blocking (large packets blocking small packets in queues)
a. List the five functions/services performed by the Transport Layer. Just list them – no need to explain them.
- (De)Multiplexing
- Error Detection
- Reliability/Sequencing
- Flow Control
- Congestion Control
b. Transport segments include a Transport Layer Header and a Payload. Do routers change the transport layer header in any way? Yes or No? Explain your answer. No. Routers don’t change transport headers. Note that NATs are not routers. Transport protocols are end-to-end protocols (or something similar in explanation)
Consider the TCP exchange shown above. Segment 1 has Sequence number 100. All segments contain 1024 bytes each. Look at the picture carefully. It is somewhat different from the one in HW4. Answer the following questions:
a) What is the sequence number in segment 2? 1124
b) What is the acknowledgment number in ACK 3? 1124 + 2048 = 3172
time Lost Segments ACKS 1 2 3 4 5 6 8 1 2 3 4 5 6 Name __________________________ GTID________________
c) What are the ACK numbers in ACKs 4 and 5? 3172 for both
d) Segment 8 is a retransmission. What has caused this retransmission? Explain how you can tell. Timeout. Lost packet but only 2 dup acks.
a) TCP Congestion Detection
i) How does TCP detect congestion? Packet Loss
ii) Is this indication of congestion guaranteed to be correct (why or why not)? NO there are other reasons for packet loss like bit error or TTL expiry or missing routing table entry. (no need to list reasons for packet loss)
iii) What happens to the congestion window once congestion is detected in TCP Reno. Make sure you describe the two possible scenarios. T/O Drop window to IW or 1MSs or 2MSS 3 dup ack: cut window in half
Persistent HTTP opens one TCP connection and downloads all objects in series (original and embedded) over this connection. Non-persistent HTTP, opens a TCP connection to download the original object, then opens a separate connection for each of the embedded objects. For the purposes of this question, Name __________________________ GTID________________ assume that non-persistent HTTP downloads all embedded objects in series. Consider the following two scenarios:
i) The original object contains 100 small (in terms of size in bytes) objects
ii) The original object contains 2 very large objects.
Accounting for all TCP overheads, answer the following questions:
a) In both scenarios, persistent HTTP will be faster than non-persistent HTTP. Explain why? TCP connection overheads
b) For which of these scenarios will the difference between the performance of persistent and non-persistent HTTP be the largest? Explain your answer. Many small objects will have the most difference because of the connection overhead being a large portion of the latency.
In a DASH video streaming service, the client starts by requesting a number of video chunks back-to-back. The client then goes into so-called On/Off Behavior where the client requests an n-seconds video chunk every n seconds. Answer the following questions:
a) What protocol is used for the client to request video chunks? Just name the protocol? HTTP
b) What is the purpose of requesting chunks aggressively (back-to-back) at the start of the video session? Fill out the playout buffer before playing to reduce likelihood of video stall (or rebuffering)
c) Why does the client then revert to the On/Off Behavior once the back-to-back phase is completed? To avoid sending data that the client will not watch later. Just give the client what they need to keep watching.
A WiFi (802.11) device senses the channel before and will only transmit if the channel is idle.
a) Why does this carrier sensing not guarantee that no collisions will occur? Because of signal propagation on the medium (at close to speed of light) So someone may have started transmitting and not be heard by others for a short duration.
b) If a data frame reaches the access point, it will respond with an acknowledgement. What is the mechanism used in the WiFi protocol to protect the Acknowledgment from colliding with a data frame? Uses DIFS and SIFS. Transmitter needs to wait for DIFS and ACK transmitted within SIFS and DIFS > SIFS.
c) If two devices are out of each other’s range, carrier sensing will not work. How does the WiFi protocol attempt to avoid collisions in that case. RTS/CTS
For each of the following protocols (HTTP, UDP, TCP, IP, WiFi) answer the following questions:
I) Which layer in the Internet architecture does the protocol belong to?
- HTTP App
- UDP,TCP Transport
- IP Network
- WiFi Link Layer
Name __________________________ GTID________________
II) Does the protocol deploy an error detection function? If so, describe the scope of the error detection in the protocol, i.e., which data is the error detection protecting?
- TCP, Header and payload (Pseudoheader includes IP addresses)
- UDP, Header and Payload (Pseudoheader includes IP addresses)
- WiFI, Header and payload
- IPv4 Header only (IPv 6 does not have error detection by default)
III) For each protocol make a reasoned argument for why or why not error detection is required and why the scope of error detection is the way it is.
- TCP, UDP Need it because IP only checks header for errors. And early network didn’t have error checking in layer.
- WiFi, Need it to detect bit errors. And wireless has high bit error potential.
- IPv4, need to check header to avoid misrouting. Needed in early days because ,link layer did not have error detection.
Link Layer Functions
The link layer has several functions, including link sharing. Various protocols were discussed, including:
Aloha: A random access protocol.
TDMA: A protocol that avoids collisions.
CSMA (Carrier Sense Multiple Access): Listen before transmitting.
CSMA/CD (Carrier Sense Multiple Access with Collision Detection): Listen while transmitting to detect collisions.
In the case of a collision, a random back-off time is required before retransmission to avoid further collisions.
Ethernet and Modern Internet
Ethernet is a traditional method of networking that still uses collision detection, although modern internet connections are primarily switched, reducing the need for collision management. However, some setups still utilize shared cables.
Addressing in the Link Layer
IP addresses are 32-bit addresses, while MAC (Media Access Control) addresses are 48-bit identifiers unique to each device on a shared link. MAC addresses are typically burned into the network interface card (NIC) and are written in hexadecimal format. Unlike IP addresses, MAC addresses do not change when devices move between networks.
Address Resolution Protocol (ARP)
ARP is used to map IP addresses to MAC addresses. It creates an ARP table that contains pairs of IP and MAC addresses, with a time-to-live (TTL) for each entry. If a device needs to send data, it must first determine the MAC address of the destination device using ARP.
Collision Detection and Acknowledgments
In the link layer, a cyclic redundancy check (CRC) is used for error checking. If a collision occurs, the device must wait for a random amount of time before attempting to retransmit. Acknowledgments are crucial for confirming successful data transmission.
Wi-Fi Overview
Wi-Fi, standardized by the IEEE 802.11 committee, has evolved through various versions (A, B, G, N, AC, and the latest, AX). Each version improves upon the physical layer, increasing speed and range. Wi-Fi operates on regulated frequencies, primarily in the ISM bands, which are available for unlicensed use.
Wi-Fi Modes
Wi-Fi can operate in two modes:
Infrastructure Mode: Devices communicate through an access point.
Ad Hoc Mode: Devices communicate directly with each other.
Access Protocols in Wi-Fi
Wi-Fi uses CSMA/CA (Carrier Sense Multiple Access with Collision Avoidance) to prevent collisions. Devices listen to the channel before transmitting and must wait for a clear channel (DIFS) before sending data. If the channel is busy, devices back off for a random time before retrying.
RTS/CTS Mechanism
The RTS/CTS (Request to Send / Clear to Send) mechanism helps manage the hidden terminal problem in wireless networks. Before transmitting, a device sends an RTS to the access point, which responds with a CTS. This process reserves the channel for the duration specified in the CTS, preventing other devices from transmitting during that time.
Conclusion
Understanding the link layer, including protocols, addressing, and collision management, is crucial for effective networking. The lecture covered various aspects of the link layer, including Ethernet, Wi-Fi standards, and access protocols, providing a comprehensive overview of how data is transmitted over networks.