Chapter 3, Part 2 (3.5-3.7)
What bad things could happen with the IP service (network layer protocol IP)?
1. Datagrams can overflow router buffers and never reach their destination 2. Datagrams can arrive out of order 3. Bits in the datagram can get corrupted (flipped from 0 to 1) - Because transport-layer segments are carried across the network by IP datagrams. transport-layer segments can suffer from these problems as well
For network-assisted congestion control, congestion information is typically fed back from the network to the sender in one of two ways:
1. Direct feedback may be sent from the network router to the sender. This form of notification typically takes the form of a choke packet (essentially saying, "I'm congested!") 2. The second and more common form of notification occurs when a router marks/updates a field in a packet flowing from sender to receiver to indicate congestion. Upon receipt of a marked packet, the receiver then notifies the sender of the congestion indication. This latter form of notification takes a full round-trip time
List the costs of a congested network
1. Large queuing delays are experienced as the packet-arrival rate near the link capacity 2. The sender must perform retransmissions in order to compensate for dropped (lost) packets due to buffer overflow 3. Unneeded retransmissions by the sender in the face of large delays may cause a router to use its link bandwidth to forward unneeded copies of a packet 4. When a packet is dropped along a path, the transmission capacity that was used at each of the upstream links to forward that packet to the point at which it is dropped ends up having been wasted
What are the 3 components of the TCP congestion-control algorithm?
1. Slow start 2. Congestion avoidance 3. Fast recovery
List the things found in a TCP segment header
1. Source and Destination Port Number 2. The 32-bit sequence number field and the 32-bit acknowledgement number field, which are used by the TCP sender and receiver in implementing a reliable data transfer 3. The 16-bit receive window field, which is used for flow control 4. The 4-bit header length field, which specifies the length of the TCP header in 32-bit words. Typically the option field is empty, so the length of a typical TCP header is 20 bytes 5. The optional and variable-length options field, which is used when a sender and receiver negotiate the maximum segment size (MSS) or as a window scaling factor for use in high-speed networks 7. The flag field, which contains 6 bits. The ACK bit is used to indicate that the value carried in the acknowledgement field is valid; that is, the segment contains an acknowledgement for a segment that has been successfully received
List the steps a host (client) takes to establish connection to another host (server)
1. The client-side TCP first sends a special TCP segment to the server-side TCP (contains no application layer data, but one of the flag bits in the segment's header, the SYN bit, is set to 1) 2. once the IP datagram containing the TCP SYN segment arrives at the server host (assuming it does arrive), the server extracts the TCP SYN segment from the datagram, allocates the TCP buffers and variables to the connection, and sends a connection-granted segment to the client TCP (contains no application layer data) 3. Upon receiving the SYNACK segment, the client also allocates buffers and variables to the connection. The client host then sends the server yet another segment; this last segment acknowledges the server's connection-granted segment. The SYN bit is now set to zero, since the connection is established. This third stage of the three-way handshake may carry client-to-client server data in the segment payload
To explore a specific TCP port, say port 6789, on a target host, nmap will send a TCP SYN segment with destination port 6789 to that host. What are the 3 possible outcomes?
1. The source hosts receives a TCP SYNACK segment from the target host. Since this means that an application is running with TCP port 6789 on the target post, nmap returns "open" 2. The source host receives a TCP RST segment from the target host. This means that the SYN segment reached the target host, but the target host is not running an application with TCP port 6789. But the attacker at least knows that the segments destined to the host at port 6789 are not blocked by any firewalls on the path between source and target hosts 3. The source receives nothing. This likely means that the SYN segment was blocked by an intervening firewall and never reached the target host
How are flow and congestion control similar?
Both throttle the sender
A TCP connection consists of?
Buffers, variables, a socket connection to a process in one host, another set of buffers, variables, and a socket connection to a process in another host
In TCP, the process initiating the connection is called the?
Client process
What mode are we in when the congestion window (cwnd) >= slow-start threshold (ssthresh)?
Congestion avoidance
A TCP sender can also be throttled due to congestion within the IP network; this form of sender control is referred to as?
Congestion control
The RST, SYN, and FIN bits are used for?
Connection setup and teardown
What is the congestion window?
Denoted by cwnd, it imposes a constraint on the rate at which a TCP sender can send traffic into the network
At the network layer, two bits (with 4 possible values, overall) in the Type of Service field of the IP datagram header are used for ____
ECN
What are the 2 broad approaches to congestion control?
End-to-end congestion control and Network-assisted congestion control
It is desirable to set the timeout equal to the ____ plus some margin
EstimatedRTT
More recently, extensions to both IP and TCP have been proposed, implemented, and deployed that allow the network to explicitly signal congestion to a TCP sender and receiver. This form of network-assisted congestion control is known as?
Explicit Congestion Notification (ECN)
The Maximum Segment Size (MSS) is typically set by?
First determining the length of the largest link-layer frame that can be sent by the local sending host (the so-called maximum transmission unit, MTU) and then setting the MSS to ensure that a TCP segment (when encapsulated in an IP datagram) plus the TCP/IP head length (typically 40 bytes) will fit into a single link-layer frame
What is Network-assisted congestion control?
In this approach, routers provide explicit feedback to the sender and/or receiver regarding the congestion state of the network. This feedback may be as simple as a single bit indicating congestion at a link (an approach taken in the early IBM SNA architectures and ATM network architectures. More sophisticated feedback is also possible. For example, in ATM Available Bite Rate (ABR) congestion control, a router informs the sender of the maximum host sending rate it (the router) can support on an outgoing link. As noted above, the Internet-default version of IP and TCP adopt an end-to-end approach towards congestion control
What is End-to-end congestion control?
In this approach, the network layer provides no explicit support to the transport layer for congestion control purposes. Even the presence of network congestion must be inferred by the end systems based only on observed network behavior (for example, packet loss and delay)
What does the selective acknowledgement modification to TCP do?
It allows a TCP receiver to acknowledge out-of-order segments selectively rather than just cumulatively acknowledging the last correctly received, in-order segment
What does TCP's reliable data transfer service do?
It ensures that the data stream that a process reads out of its TCP receive buffer is uncorrupted, without gaps, without duplication, and in sequence; that is, the byte stream is exactly the same byte stream that was sent by the end system on the other side of the connection
What happens when an application uses multiple parallel connections?
It gets a larger fraction of the bandwidth in a congested link
What is Telnet?
It is a popular application-layer protocol used for remote login. It runs over TCP and is designed to work between any pair of hosts. Additionally, it is an interaction application
What is a duplicate ACK?
It is an ACK that re-acknowledges a segment for which the sender has received in early acknowledgements
What is the receive window used for?
It is used in flow control to give the sender an idea of how much free buffer space is available at the receiver. The sender maintains this variable
What does it mean that TCP provides a full-duplex service?
It means that if there is a TCP connection between Process A on one host and Process B on another host, then application-layer data can flow from Process A and Process B at the same time as the application-layer data flows from Process B to Process A
What does TCP, like the rdt protocol, do to recover from lost segments?
It uses a timeout/retransmit mechanism
Is TCP a GBN or an SR protocol?
It's best categorized as a hybrid between both
What is multicasting?
Its the transmission of data to multiple specific recipients
In TCP, are buffers or variables allocated to the connection in the network elements (routers, switches, and repeaters) between hosts?
No, there are no buffers or variables allocated to the connection in the network elements between hosts
Is multicasting possible with TCP?
No, this is because TCP is point-to-point (1 sender and 1 receiver)
Do intermediate network elements maintain TCP connection state?
No, this is because TCP protocols run only in the end systems, and not in the intermediate network elements (routers and link-layer switches)
Is fast recovery a required component of TCP?
No, thought it is recommended
In TCP, what happens after the stream of data through the socket?
Once through the socket, the data is in the hands of TCP running in the client. TCP directs this data to the connection's send buffer, which is one of the buffers that is set aside during the initial three-way handshake. From time to time, TCP will grab chunks of data from the send buffer and pass the data to the network layer
Setting the ____ bit indicates that the receiver should pass the data tot he upper layer immediately
PSH
A congestion-control mechanism is said to be fair if the average transmission rate of each connection is approximately ____; that is, each connection gets an equals hare of the link bandwidth
R/K
Describe TCP acknowledgement numbers
Receiver acknowledges all correct segments received - Error segments are not acknowledged at all Header for acknowledgement segment (ACK) is the same as for other segments - Receiver calculates data bytes received by subtracting 4x "header length" from TCP segment total byte-count - "Acknowledgement number" field contains the number of the next byte expected ACK may also contain data - TCP is full-duplex. Data can flow in both directions simultaneously - Typical (no data) ACK has a bogus number in the "sequence number" field
What is a fast retransmit?
Retransmitting the missing segment before the segment's timer expires
What mode are we in when the congestion window (cwnd) < slow-start threshold (ssthresh)?
Slow start
What are the mandatory components of TCP?
Slow start and Congestion avoidance
The approach taken by ____ is to have each sender limit the rate at which it sends traffic into its connection as a function of perceived network congestion. If a TCP sender perceives that there is little congestion on the path between itself and the destination, then the TCP sender increases it send rate; if the sender perceives that there is congestion along the path, then the sender reduces its send rate
TCP
It is interested that an early version of TCP, known as ____, unconditionally cut its congestion window to 1 MSS and entered the slow-start phase after either a timeout-indicated or triple-duplicate-ACK-indicated loss event. The newer version of TCP, TCP Reno, incorporated fast recovery
TCP Tahoe
TCP pairs each chunk of client data with a TCP header, thereby forming?
TCP segments
The ____ bit is used to indicate that there is data in this segment that the sending-side upper layer entity has marked as "urgent"
URG
Describe the three-way handshake
When 3 segments are sent between two hosts
Why does a receiver send a duplicate ACK?
When a TCP receiver receives a segment with a sequence number that is larger than the next, expected, in-order sequence number, it detects a gap in the data stream--that is, a missing segment. This gap could be the result of lost or reordered segments within the network. Since TCP does not use negative acknowledgements, the receiver cannot send an explicit negative acknowledgement back to the sender. Instead, it simply re-acknowledges the last in-order byte of data it has received
Does TCP number the bytes it sends?
Yes, it number the bytes it sends and if one is missing, it can easily check
Is the network layer protocol IP unreliable?
Yes, the protocol IP is unreliable. It does not guarantee datagram delivery, guarantee in-order delivery of datagrams, and doe snot guarantee the integrity of the data in the datagrams
An _____ indicates that the network is delivering the sender's segments to the receiver, and hence, the sender's rate can be increased when an ACK arrives for a previously unacknowledged segment
acknowledged segment
The ____ is the sequence number of the next byte of data that the host is waiting for
acknowledgement number
TCP congestion control is often referred to as an _____ form of congestion control
additive-increase, multiplicative-decrease (AIMD)
What is the formula for the average TCP throughput of a connection? (TCP throughout formula)
average throughput of a connection = (0.75 x w)/RTT // w = window size
What is the formula relating the throughput of a TCP connection as a function of the loss rate (L), the round-trip time (RTT), and the maximum segment size (MSS)?
average throughput of a connection = (1.22 x MSS)/RTT x squarRoot(L)
A lost segment implies ____, and hence, the TCP sender's rate should be decreased when a segment is lost
congestion
TCP is said to be ____ because before one application process can begin to send data to another, the two processes must first "handshake" with each other--that is, they must send some preliminary segments to each other to establish the parameters of the ensuing data transfer
connection-oriented
TCP acknowledgements are ____ and correctly received but out-of-order segments are not individually ACKed by the receiver
cumulative
Because TCP only acknowledges bytes pu to the first missing byte in the stream, TCP is said to provide ____
cumulative acknowledgements
On entry to the congestion-avoidance state, the value of ____ is approximately half its value when congestion was last encountered. Thus, rather than doubling the value of cwnd every RRT, TCP adopts a more conservative approach and increases the value of cwnd by just a single MSS every RRT
cwnd
A sender can often detect packet loss well before the timeout event occurs by nothing so-called ____
duplicate ACKs
In ____, the value of cwnd is increased by 1 MSS for every duplicate ACK received for the missing segment that cause TCP to enter the fast-recovery state
fast recovery
TCP provides a _____ to its applications to eliminate the possibility of the sender overflowing the receiver's buffer. Thus, the service is a speed-matching service (matching the rate at which the sender is sending against the rate at which the receiving application is reading)
flow-control service
In TCP, the maximum amount of data that can be grabbed and placed in a segment is limited by the _____
maximum segment size
The acknowledgement for client-server data is carried in a segment carrying server-to-client data; this acknowledgement is said to be ____ on the server-to-client data segment
piggybacked
A TCP connection is also always _____, that is, between a single sender and a single receiever
point-to-point
TCP creates a ____ on top of IP's unreliable best effort service
reliable data transfer service
Because TCP uses acknowledgements to trigger (or clock) its increase in congestion window size, TCP is said to be ____
self-clocking
The ____ of a segment is the sequence number of the first byte in the data field
sequence number
The ____ is therefore the byte-stream number of the first byte in the segment
sequence number for a segment
In the ____ state, the value of cwnd begins at 1 MSS and increases by 1 MSS every time a transmitted segment is first acknowledged
slow-start
The location of the last byte of this urgent data is indicated by the 16-bit ____
urgent data pointer field
What is one of the problems with timeout-triggered retransmissions?
The timeout period can be relatively long. When a segment is lost, this long timeout period forces the sender to delay resending the lost packet, thereby increasing the end-to-end delay
An initial TimeoutInterval value of ____ second(s) is recommended
1
What is the MTU of Ethernet and PPP link-layer protocols?
1,500 byes
What does a host do when it receives out-of-order segments in a TCP connection?
There are 2 choices: 1. The receiver immediately discards out-of-order segments (more efficient in terms of network bandwidth) 2. The receiver keeps the out-of-order bytes and waits for the missing bytes to fill in the gaps
In a TCP segment header, what are the source and destination port numbers used for?
They are used for multiplexing (sending data onto the link) and demultiplexing (delivering data to the correct socket) data from/to upper-layer applications
Describe this python command: clientSocket.connect((serverName, serverPort))
This command initializes a TCP connection. "serverName" is the name of the server and "serverPort" identifies the process on the server
Why must TCP use end-to-end congestion control rather than network-assisted congestion control?
This is because since the IP layer provides no explicit feedback to the end systems regarding network congestion
Why do many users prefer to use SSH protocols rather than Telnet?
This is because when data sent in a Telnet connection (including passwords), it is not encrypted
How big are TCP headers?
20 bytes
How big are UDP headers?
8 bytes
What is the Offered Load?
The rate at which the transport layer sends segments (containing original data and retransmitted data) into the network
What are the 2 most important field in the TCP segment header?
The sequence number field and the acknowledgement number field
In TCP congestion control, what happens if there is a timeout?
The slow-start threshold is set to the congestion window halved (cwnd) and the congestion window is set the 1 MSS (basically it reset)
In TCP congestion control, what happens if the sender receives 3 duplicate ACKs (acknowledgements)?
The slow-start threshold is set to the congestion window halved (cwnd/2) and the congestion window is set to that same value (half of what it was)