1. Home
  2. Explore
  3. Computer Science
  4. TCP Concepts Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

TCP Concepts Overview

  • 26Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: TCP Handshake Basics

What is the primary purpose of the SYN flag in the TCP three-way handshake?

26 questions

  1. 1

    What is the primary purpose of the SYN flag in the TCP three-way handshake?

    1. A

      To acknowledge receipt of data from the other host

    2. B

      To indicate that the sender has finished transmitting data

    3. C

      To reset the connection when an error occurs

    4. D

      To synchronize sequence numbers between the two communicating hosts

    Correct answer
    D

    To synchronize sequence numbers between the two communicating hosts

    Explanation

    The SYN flag is used to synchronize sequence numbers. The client sends its initial sequence number (ISN) in the SYN, and the server responds with its own SYN plus an acknowledgment of the client's ISN.

  2. 2

    In the TCP three-way handshake, what is the sequence of flags exchanged?

    1. A

      SYN, SYN-ACK, ACK

    2. B

      ACK, SYN, SYN-ACK

    3. C

      SYN, ACK, SYN-ACK

    4. D

      SYN-ACK, SYN, ACK

    Correct answer
    A

    SYN, SYN-ACK, ACK

    Explanation

    The standard three-way handshake starts with the client sending a SYN, the server responds with SYN-ACK, and the client finalizes with an ACK.

  3. 3

    What is an Initial Sequence Number (ISN)?

    1. A

      The number of bytes sent in the first data segment

    2. B

      The acknowledgment number from the server

    3. C

      A randomly generated number used as the starting point for sequence numbering in a TCP connection

    4. D

      The port number assigned to the client

    Correct answer
    C

    A randomly generated number used as the starting point for sequence numbering in a TCP connection

    Explanation

    The ISN is a random number chosen by each side to begin counting bytes in its direction. It is exchanged during the SYN and SYN-ACK to synchronize sequence numbers.

  4. 4

    Why does Wireshark display relative sequence numbers by default?

    1. A

      To hide the initial sequence numbers for security reasons

    2. B

      To show the actual raw sequence numbers without modification

    3. C

      To align sequence numbers with the TCP header fields

    4. D

      To make it easier for humans to work with smaller numbers by starting at zero

    Correct answer
    D

    To make it easier for humans to work with smaller numbers by starting at zero

    Explanation

    Wireshark subtracts the initial sequence number from each packet in the conversation, so the first sequence number appears as 0. This simplifies analysis.

  5. 5

    In the TCP handshake, what is meant by a 'ghost byte'?

    1. A

      An optional byte used for window scaling

    2. B

      The one-byte increment in sequence number caused by the SYN flag itself

    3. C

      The acknowledgment number that is not actually sent

    4. D

      A byte of payload that is silently discarded

    Correct answer
    B

    The one-byte increment in sequence number caused by the SYN flag itself

    Explanation

    The SYN flag consumes one sequence number even though no data is sent. This 'ghost byte' allows the receiver to acknowledge the SYN by incrementing its own acknowledgment number by one.

  6. 6

    How does the acknowledgment number in a SYN-ACK relate to the client's initial sequence number?

    1. A

      It equals the client's initial sequence number minus one

    2. B

      It is a completely independent random number

    3. C

      It is the same as the client's initial sequence number

    4. D

      It equals the client's initial sequence number plus one

    Correct answer
    D

    It equals the client's initial sequence number plus one

    Explanation

    When the server sends a SYN-ACK, it sets the acknowledgment number to the client's sequence number plus one, confirming receipt of the client's SYN.

  7. 7

    A client uses source port 54846 to connect to a server on port 80. What type of port is 54846?

    1. A

      A registered port for a specific application

    2. B

      A reserved port below 1024

    3. C

      An ephemeral port, typically above 1023

    4. D

      A well-known port assigned to HTTP

    Correct answer
    C

    An ephemeral port, typically above 1023

    Explanation

    The source port is randomly chosen from the ephemeral range (usually 1024-65535) for the client side. Port 80 is the well-known destination port for HTTP.

  8. 8

    What constitutes a four-tuple that uniquely identifies a TCP conversation?

    1. A

      Sequence number, acknowledgment number, window size, checksum

    2. B

      Source MAC, destination MAC, source IP, destination IP

    3. C

      Source IP, source port, destination IP, destination port

    4. D

      SYN flag, ACK flag, FIN flag, RST flag

    Correct answer
    C

    Source IP, source port, destination IP, destination port

    Explanation

    The combination of source and destination IP addresses and source and destination port numbers defines a unique TCP stream, often called a four-tuple.

  9. 9

    After the initial SYN, which flag is set in every subsequent packet of a TCP connection (except in rare cases like some resets)?

    1. A

      The SYN flag

    2. B

      The ACK flag

    3. C

      The FIN flag

    4. D

      The PSH flag

    Correct answer
    B

    The ACK flag

    Explanation

    Once the handshake begins, the ACK flag is set on all packets except the first SYN. This indicates that the acknowledgment number field is valid.

  10. 10

    Which TCP flags are most commonly encountered during normal TCP analysis?

    1. A

      ACK, PUSH, RST, SYN, FIN

    2. B

      URG, ACK, RST, SYN, FIN

    3. C

      SYN, FIN, RST, URG, PSH

    4. D

      ECE, CWR, URG, ACK, PSH

    Correct answer
    A

    ACK, PUSH, RST, SYN, FIN

    Explanation

    The frequently seen flags are SYN (synchronize), ACK (acknowledgment), PUSH (push data to application), RST (reset), and FIN (finish). Others like URG and ECN are rare.

  11. 11

    How can you filter for all SYN packets in Wireshark?

    1. A

      Using the filter tcp.flags == 0x002

    2. B

      Using the filter tcp.syn == 1

    3. C

      Using the filter tcp.flags.syn == 1

    4. D

      Using the filter tcp.header.syn == 1

    Correct answer
    C

    Using the filter tcp.flags.syn == 1

    Explanation

    The correct display filter is tcp.flags.syn == 1. Wireshark provides the syntax for each flag in the packet details pane.

  12. 12

    What is the maximum window size that can be advertised without using the window scale option?

    1. A

      1,048,576 bytes

    2. B

      256 bytes

    3. C

      1,460 bytes

    4. D

      65,535 bytes

    Correct answer
    D

    65,535 bytes

    Explanation

    The window size field is 2 bytes, so the maximum value is 65535. To advertise larger windows, the window scale option must be used.

  13. 13

    During the TCP handshake, the client advertises a window scale shift count of 6. What does this mean?

    1. A

      The receiver should multiply the window size field by 26=642^6 = 6426=64 to get the actual window

    2. B

      The window scale option length is 6 bytes

    3. C

      The window size field should be divided by 64

    4. D

      The sender will use a window size of 6 segments

    Correct answer
    A

    The receiver should multiply the window size field by 26=642^6 = 6426=64 to get the actual window

    Explanation

    The shift count indicates a multiplier of 2shift2^{shift}2shift. A shift of 6 means multiply the window field by 64 to obtain the true receive window.

  14. 14

    What happens if one side does not include a window scale option in the SYN?

    1. A

      Window scaling is still used but only by the side that advertised it

    2. B

      The connection is rejected with a reset

    3. C

      Window scaling cannot be used for that connection; both sides must agree

    4. D

      The window scale is assumed to be 1

    Correct answer
    C

    Window scaling cannot be used for that connection; both sides must agree

    Explanation

    Window scaling is a negotiated option. If one side does not include it in its SYN, then the other side cannot use it. The handshake determines which optional features will be used.

  15. 15

    A TCP receiver's calculated window size drops to zero. What condition does this indicate?

    1. A

      The receiver has closed the connection

    2. B

      The sender has finished transmitting

    3. C

      The receiver's buffer is full and it cannot accept more data

    4. D

      A network congestion event has occurred

    Correct answer
    C

    The receiver's buffer is full and it cannot accept more data

    Explanation

    A zero window means the receive buffer is full. The sender must stop sending until the receiver advertises a non-zero window, known as the 'zero window' condition.

  16. 16

    What is the purpose of the Maximum Segment Size (MSS) option in the TCP handshake?

    1. A

      To define the maximum transmission unit for the network layer

    2. B

      To limit the size of the TCP header

    3. C

      To advertise the largest TCP segment payload the sender can receive

    4. D

      To set the maximum number of segments allowed in a window

    Correct answer
    C

    To advertise the largest TCP segment payload the sender can receive

    Explanation

    MSS is an advertisement of the maximum payload size in a single TCP segment. It is not negotiated but simply announced; both sides may have different MSS values.

  17. 17

    Why is it important to capture the TCP handshake when analyzing a TCP flow?

    1. A

      Because TCP options like window scale and SACK are only exchanged in the handshake

    2. B

      Because the handshake contains all the data payload

    3. C

      Because the handshake sets the maximum number of packets

    4. D

      Because the handshake determines the IP addresses used

    Correct answer
    A

    Because TCP options like window scale and SACK are only exchanged in the handshake

    Explanation

    Key options such as window scale, MSS, and selective acknowledgment (SACK) are announced only in the SYN and SYN-ACK packets. Without the handshake, these options are unknown, leading to misinterpretation of window sizes and other parameters.

  18. 18

    The TCP header length field is 4 bits. What is the maximum header length it can represent?

    1. A

      44 bytes (as seen in many handshakes)

    2. B

      48 bytes

    3. C

      60 bytes (15 32-bit words)

    4. D

      40 bytes

    Correct answer
    C

    60 bytes (15 32-bit words)

    Explanation

    The header length field counts 32-bit words. A value of 15 (max) corresponds to 60 bytes. The header length must be sufficient to include options, which is why handshake packets often have a header length of 44 bytes (11 words).

  19. 19

    What does the SACK (Selective Acknowledgment) option allow a TCP receiver to do?

    1. A

      Increase the maximum segment size during the connection

    2. B

      Acknowledge all bytes up to the sequence number, even if some are missing

    3. C

      Acknowledge only the missing bytes, allowing the sender to retransmit exactly what was lost

    4. D

      Reduce the window size when congestion is detected

    Correct answer
    C

    Acknowledge only the missing bytes, allowing the sender to retransmit exactly what was lost

    Explanation

    SACK allows the receiver to inform the sender about exactly which segments are missing, avoiding unnecessary retransmissions of already-received data.

  20. 20

    In the transcript, the delta time between SYN and SYN-ACK is about 20 milliseconds. What does this value represent?

    1. A

      The retransmission timeout value

    2. B

      The round-trip time (RTT) between the client and server

    3. C

      The time between packets on the network interface

    4. D

      The time it takes for the server to process the SYN

    Correct answer
    B

    The round-trip time (RTT) between the client and server

    Explanation

    The delta time from SYN to SYN-ACK is one half of the RTT (the client-to-server delay). Multiplying by 2 gives the full RTT. This helps estimate network latency.

  21. 21

    A packet has a TTL of 238. If the typical starting TTL for the operating system is 255, approximately how many hops away is the source?

    1. A

      255 hops

    2. B

      17 hops

    3. C

      238 hops

    4. D

      Cannot be determined

    Correct answer
    B

    17 hops

    Explanation

    TTL decreases by one per hop. Starting TTL 255 minus current TTL 238 equals 17 hops. Common starting TTL values are 64, 128, and 255.

  22. 22

    In Wireshark, a check mark next to a packet indicates what?

    1. A

      That the packet acknowledges data in the previous packet

    2. B

      That the packet has been decrypted

    3. C

      That the packet is part of a duplicate ACK

    4. D

      That the packet is a retransmission

    Correct answer
    A

    That the packet acknowledges data in the previous packet

    Explanation

    Wireshark places a check mark on a packet that is ACKing the data from the preceding packet, visually confirming that the data was received.

  23. 23

    Sequence numbers in a TCP connection are direction-dependent. This means:

    1. A

      Sequence numbers are shared between both directions for efficiency

    2. B

      Both directions use the same sequence number but different acknowledgment numbers

    3. C

      The client and server each maintain their own independent sequence number space

    4. D

      Sequence numbers are only used for data from client to server

    Correct answer
    C

    The client and server each maintain their own independent sequence number space

    Explanation

    Each side tracks its own sequence number for bytes it sends. The client's sequence numbers never interact with the server's; they are separate counters.

  24. 24

    What is the purpose of the TCP segment length column in Wireshark?

    1. A

      To show the total frame size including Ethernet and IP headers

    2. B

      To show the number of segments in the stream

    3. C

      To show the remaining window size

    4. D

      To show only the payload size of the TCP segment, excluding headers

    Correct answer
    D

    To show only the payload size of the TCP segment, excluding headers

    Explanation

    TCP segment length displays the number of bytes of payload in the TCP segment. This helps distinguish data packets from empty ACKs.

  25. 25

    Which of the following statements about the MSS (Maximum Segment Size) is correct?

    1. A

      The MSS cannot exceed the window size

    2. B

      The MSS is advertised in the SYN and is not negotiated; it is an announcement

    3. C

      The MSS is automatically set to the same value on both sides after negotiation

    4. D

      The MSS is calculated from the IP packet size

    Correct answer
    B

    The MSS is advertised in the SYN and is not negotiated; it is an announcement

    Explanation

    Each side announces the maximum segment size it can receive. They do not have to match, and no negotiation occurs; each side simply respects the other's announced limit.

  26. 26

    When troubleshooting a slow file transfer, which TCP metric should you monitor to detect buffer issues?

    1. A

      The checksum – errors cause retransmissions

    2. B

      The initial sequence number – a high value indicates congestion

    3. C

      The SYN flag – repeated SYNs show a handshake problem

    4. D

      The calculated window size – a value dropping to zero indicates a stuck buffer

    Correct answer
    D

    The calculated window size – a value dropping to zero indicates a stuck buffer

    Explanation

    A window size that decreases repeatedly and reaches zero signals that the receiver's buffer is full, preventing the sender from transmitting more data. This can cause throughput issues.

Question 1 of 26
Question 1 of 26

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent