TCP

Transmission Control Protocol. TCP subdivides large file into many segments, and sends it. Client regathers them and gives them to HTTP. After an initial service request connects to the well-known port number (e.g. 80!), the port is freed by switching the servicing of the request to a dedicated, connection-specific port number.

27 flashcards · Computer Science · by lakesare

  1. How does TCP implement error control?

    Receiving computer sends positive acknowledgements for every successfully received message. If it wasn't sent within some predefined time limit, sender retransmits the message. There is no negative acknowledgement.

  2. Name 5 parts of a TCP segment header.

    Source port Destination port Sequence number Acknowledgement number Window size - amount of bytes that can still be transferred in a window Checksum

  3. What does Connection: Keep-Alive header achieve in HTTP?

    Reuses the same TCP connection for multiple HTTP request-responses. It makes server establish an HTTP keep-alive, or HTTP persistent connection. Instead of closing and reopening a connection for every client-server HTTP interaction, we reuse the same TCP connection for multiple HTTP request-response cycles.

  4. How does a sender know that a packet with a particular Sequence number n has been received?

    Acknowledgement number n + packet length must be sent back. If nothing is sent during some time - it must be retransmitted.

  5. Describe the 3-way TCP handshake.

    1. SYN (client sends) SYN: 1 sequence number: random number S 2. SYN-ACK (server sends) SYN: 1 ACK: 1 sequence number: random number A acknowledgment number: S+1 3. ACK (client sends) ACK: 1 sequence number: S+1 acknowledgement number: A+1

  6. What's an active OPEN vs passive OPEN?

    passive OPEN: when server starts listening to a port (Before a client attempts to connect with a server, the server must first bind to and listen at a port to open it up for connections) active OPEN: when client initiates a 3-way handshake (once the passive open is established, a client may initiate an active open)

  7. What does sequence number VS acknowledgement number signify?

    Sequence number: how many bytes exactly this computer has already sent in a tcp session Acknowledgement number: how many bytes I received from another computer

  8. How long are acknowledgement and sequence numbers?

    32 bits

  9. Computer A sent a request of 100 bytes (NOT including the headers) to computer B. Its sequence number was 1. What is the next sequence number it will send to computer B?

    101 Station A sends a GET request to Station B. This request is 100 Bytes long. The sequence number for station A starts at 1, but this packet has 100 Bytes of data in it. We add the amount of data sent to the current sequence number, then we get the next expected sequence number, 101.

  10. What uniquely identifies a TCP connection over the internet?

    Socket pair: client IP + client port; server IP + server port It is the socket pair (the 4-tuple consisting of the client IP address, client port number, server IP address, and server port number) that specifies the two endpoints that uniquely identifies each TCP connection in an internet. (TCP-IP Illustrated Volume 1, W. Richard Stevens)

  11. When should the ACK flag be set?

    Indicates that the Acknowledgment field is significant. All packets after the initial SYN packet sent by the client should have this flag set.

  12. Name one of the reasons for a repeated TCP segment being sent.

    Ack packet got lost.

  13. Why is the sliding window named so?

    Because we can imagine a window sliding and allowing some packets to be sent if it gets freed up. Links: youtube video explanation

  14. What's an ARQ?

    Automatic Repeat reQuest is a method used in many protocols for error control using only ACKs. The sender waits for an ACK for the byte range sent to the client and when not received, resends the packets, after a particular interval. If the sender does not receive an acknowledgment before the timeout, it usually re-transmits the frame/packet until the sender receives an acknowledgment or exceeds a predefined number of re-transmissions .

  15. What's meant by a flow control in TCP?

    Limits the rate a sender transfers data to guarantee reliable delivery. TCP uses a sliding window flow control protocol. In each TCP segment, the receiver specifies in the receive window field the amount of additionally received data (in bytes) that it is willing to buffer for the connection.The sending host can send only up to that amount of data before it must wait for an acknowledgment and window update from the receiving host.

  16. Name 3 types of flow control (ARQ).

    The types of ARQ protocols include: Stop-and-Wait Go-Back-N Selective Repeat All three protocols usually use some form of sliding window protocol to tell the transmitter to determine which (if any) packets need to be retransmitted. Links: wikipedia on flow control

  17. What type of ARQ does TCP use?

    TCP has many different specs! Original spec used Go-Back-N strategy. Now it's possible, using a SACK header option, to use a Selective Repeat.

  18. What is the the most ineffective ARQ?

    Stop-and-wait ARQ. Stop-and-wait is inefficient compared to other ARQs, because the time between packets, if the ACK and the data are received successfully, is twice the transit time (assuming the turnaround time can be zero). The throughput on the channel is a fraction of what it could be. To solve this problem, one can send more than one packet at a time with a larger sequence number and use one ACK for a set. This is what is done in Go-Back-N ARQ and the Selective Repeat ARQ.

  19. What is the difference between Go-Back-N and Selective Repeat ARQs?

    Go-Back-N ARQ is a more efficient use of a connection than Stop-and-wait ARQ, since unlike waiting for an acknowledgement for each packet, the connection is still being utilized as packets are being sent. In other words, during the time that would otherwise be spent waiting, more packets are being sent. However, this method also results in sending frames multiple times – if any frame was lost or damaged, or the ACK acknowledging them was lost or damaged, then that frame and all following frames…

  20. What's the original TCP specification?

    The Transmission Control Protocol (TCP) was initially defined in RFC 793. Several parts of the protocol have been improved since the publication of the original protocol specification. However, the basics of the protocol remain and an implementation that only supports RFC 793 should inter-operate with today’s implementation. Links: proof

  21. What is options in TCP segment's header?

    Optional header extension is used to add optional information to the TCP header. Thanks to this header extension, it is possible to add new fields to the TCP header that were not planned in the original specification. This allowed TCP to evolve since the early eighties.

  22. During the handshake multiple things can be negotiated apart from the sequence number using the options header part. Name 3 of these options.

    Maximum Segment Size - size of the largest segment that a TCP entity is able to process. Selective ACKnowlegement (SACK) - approves a diapason of received bits Window scale - allows to increase a header's window size. Can be set only one during the connection. A number (e.g. 7) that tells us by how many bits to left shift the header's window size (explanation) Links: great video in russian describing options

  23. Types of ARQ: what do Stop-and-Wait GBN SR stand for?

    Stop-and-Wait Go-Back-N Selective Repeat

  24. What is a sliding window?

    A sliding window is the amount of bytes a sender can send on a particular connection before it gets an acknowledgment back from the receiver that it has gotten some of it.

  25. Name 2 types of acknowledgements used in TCP.

    Cumulative ACKnowledgements - one ACK acknowledges all previous segments, used by default (Go-Back-N ARQ) Selective ACKnowledgements (SACK) - defined in RFC2018, needs an additional SACK option mentioned (Selective Repeat ARQ) Imagine you passed 1GB of segments, and only one segment in the middle got lost. With cumulative acks you can only ack 1GB/2 bytes. With selective ACKs we can retransmit only this one lost segment. Links: RFC2018

  26. What does it mean when sender receives many successive acknowledgements for the same packet?

    The fast retransmit enhancement works as follows: if a TCP sender receives a specified number of acknowledgements which is usually set to three duplicate acknowledgements with the same acknowledge number, the sender can be reasonably confident that the segment with the next higher sequence number was dropped, and will not arrive out of order.

  27. What does PCM stand for?

    Pulse-Code Modulation