During the third week, the part concerning the transport and application layers will be taken up in this course. This module is intended to equip you with:
Ability to explain TCP ports and sockets.
Identification of various features of the TCP header.
Known differentiation between connection-oriented and connectionless protocols.
An idea of the mechanism through which TCP ensures data integrity.
PRACTICE QUIZ: THE TRANSPORT LAYER
1. What ordering of TCP flags makes up the Three-way Handshake?
FIN, FIN/ACK, ACK
SYN, ACK, SYN, ACK
SYN, ACK, FIN
SYN, SYN/ACK, ACK (CORRECT)
Great work! The computer that initiates the connection will transmit a packet made to establish a new connection by including a SYN flag. The central server will send back a packet containing two flags: SYN and ACK. Finally, the initiating computer will send a packet configured with only the ACK flag to complete the handshake.
2. Transport layer protocols, like TCP and UDP, introduce the concept of a port. How many bits is a port field?
4 bits
8 bits
16 bits (CORRECT)
32 bits
Nice job! A TCP or UDP port is a number which comprises 16 bits, theoretically enabling it to take on one of 65,536 possible values ranging from 0 to 65,535.
3. Please select all valid TCP control flags.
LISTEN
ACK (CORRECT)
CLOSE
RST (CORRECT)
Fantastic! “ACK” signifies “acknowledgement,” proof of receiving the data successfully.
Precisely! Here “RST” means ‘reset’, as in putting everything back in order when anything goes wrong.
4. A device that blocks traffic that meets certain criteria is know as a ________.
Hub
Switch
Firewall (CORRECT)
Router
That’s right! The main purpose of a firewall is to block certain types of traffic according to some predefined rules.
PRACTICE QUIZ: THE APPLICATION LAYER
1. Unlike our five-layer model, the OSI network model adds two more layers on top of the Application Layer. Select examples of these new layers below.
The encryption layer
The interconnection layer
The compression layer
The session layer (CORRECT)
The presentation layer
Thanks! The session layer manages the delivery of information from transport to application so that communication can be properly organized.
Right! The presentation layer takes care of data compression, encryption, and other aspects that render the data ready for the application.
2. An example of something that operates at the application layer is:
TCP
A router
A web browser (CORRECT)
UDP
Wohoo! Sure enough! The web browsers and web servers operate at application layer that acts directly on behalf of the user for providing services like browsing websites, sending emails, and accessing applications.
3. What’s the standard number for a TTL field?
8
16
32
64 (CORRECT)
Awesome! Yes, true! Although this value can be anywhere from 0 to 255 the default recommendation is said to be 64. This most often refers to the “time to live” (TTL), as in the value that decrees how many hops within a network an IP packet can traverse before being discarded.
4. Which member of a CSIRT is responsible for tracking and managing the activities of all teams involved in the response process?
Technical lead
Public relations representative
Incident coordinator (CORRECT)
Security analyst
The incident coordinator is in charge of the all-important task of monitoring and coordinating the response activities of all teams organized to respond to the incident.
GRADED QUIZ: THE TRANSPORT AND APPLICATION LAYER
1. If a TCP socket is ready and listening for incoming connections, it’s in the ______ state.
ESTABLISHED
CLOSE_WAIT
SYN_SENT
LISTEN (CORRECT)
That is correct! The LISTEN state indicates that a port is open and waiting for incoming connections. It’s the server’s way of announcing that it’s ready to accept connections from clients.
2. The most common example of a connection-oriented protocol is _____
UDP
TCP (CORRECT)
IP
Great work! Indeed! Other connection-oriented protocols exist, but none is as popularly used as TCP (Transmission Control Protocol). The TCP protocol guarantees reliable, ordered, and error-checked delivery of data between applications residing on hosts connected through a packet-switched network.
3. A 32-bit number that’s used to keep track of where you are in a sequence of TCP segments is known as a(n) ______ number.
acknowledgement
TCP
address
sequence (CORRECT)
Great work! This is right. A sequence number in TCP is utilized in order to keep a record of the position of each segment in a continuous stream of data; it guarantees that the data are reassembled in the correct order and allows reliable transfer.
4. Application layer data lives in the _____ section of the transport layer protocol.
data payload (CORRECT)
header
footer
flags
Awesome! Exactly! Payloads from layers in the TCP/IP model or the OSI model are what matter to this payload section. In any case, every layer receives data from the layer above, wraps it in its own headers, and sends it down to the next.
5. How many bits are used to direct traffic to specific services running on a networked computer?
12
32
8
16 (CORRECT)
Great work! Ultimately! A port is a 16-bit number that serves to guide incoming traffic to specific services or applications running on a networked computer. In this way, several services can run at the same time on the same machine, each using a different port number.
6. A user requests an unencrypted webpage from a web server running on a computer, listening on the Internet Protocol address 10.1.1.150. What will be the socket address?
10.1.1.150:21
10.1.1.150:80 (CORRECT)
10.1.1.150.21
10.1.1.150.80
You got it! You got that! The address socket “10.1.1.150:80” says the address IP (10.1.1.150) along with port number: (80). Port 80 is the default used for unencryption web traffic and as HTTP. The colon separates the IP address from the port number.
7. A connection has been terminated and no communication is possible. What is the Transmission Control Protocol (TCP) socket state?
FINISHED
CLOSE_WAIT
CLOSED (CORRECT)
FIN_WAIT
Woohoo! True! That is exactly what the TCP socket it then transitions into the CLOSED state at the time when the connection has been entirely terminated; that is, at the side of both communication ends the teardown process has got completed. Further communication is not possible since it has completely closed the connection. It indicates that all the resources can now be freed.
8. A device receives a Transmission Control Protocol (TCP) packet. The device understands where the actual data payload begins. Which portion of the TCP header provides this information?
Checksum
Data offset (CORRECT)
Sequence number
Acknowledgement number
Great work! Absolutely correct. The data offset field in the TCP header represents the length of TCP header, which is essential for a receiving device to know where the data payload actually starts. This ensures a good parsing and processing of the data received.
9. Which field in a Transmission Control Protocol (TCP) header is not typically used in modern networking?
Sequence number
Checksum
Acknowledgement number
Urgent pointer (CORRECT)
Right on! Correct! The pointer urgent field in TCP is rarely used in modern networking. This was designed to signal that specific data within a segment must be prioritized or must be treated as urgent. Though this has not been adopted much, it has been generally unused in most current network protocols.
10. How many bits are in the checksum field in a Transmission Control Protocol (TCP) header?
4
8
16 (CORRECT)
12
Great work! Exactly! The checksum field is a 16-bit field in the TCP header to ensure the transmission integrity. This is done by calculating the checksum value of data both at sending and receiving ends and comparing the values in order to verify the data with which it has been associated whether not it is lost or has been corrupted.
11. Connection-oriented protocols protect against dropped data by forming connections and using what type of constant stream?
Acknowledgements (CORRECT)
Checks
Approvals
Verifiers
Woohoo! As true as that is, connection-oriented protocols would be TCP, which provides reliability on data via continuous acknowledgments. Each successfully received segment will be acknowledged specifically so that if any data is lost or corrupted, it is retried retransmission to prevent dropped data and ensure reliable communication.
12. In which scenario should you use the User Datagram Protocol (UDP)?
When you make a phone call
When you are using instant messaging with a co-worker
When you are sending an email
When you are streaming a video (CORRECT)
Great work! True! The streaming of a video may require less overhead when using a connectionless protocol like UDP compared to a connection-oriented protocol like TCP. This difference lies in the fact that UDP does not need to establish a connection or send acknowledgements that consume traffic to deliver faster transmission. On the contrary, when requesting a transmitted stream, the protocol does not ensure order or retransmission of lost segments.
13. You are sending a very fount of information that you need the listening program to respond to immediately. Which Transmission Control Protocol (TCP) flag will be used?
RST
PSH (CORRECT)
ACK
URG
You nailed it! Sure! The PSH (Push) flag has been used to deliver the IP packet directly to the application immediately upon arrival, without waiting for the buffer to fill up. This is because the user is expected to want to run some program as soon as the packet gets there, making it possible to do that for applications such as interactive sessions that require real-time communication.
14. A device involved in a Transmission Control Protocol (TCP) connection is ready to close the connection. The other device in the connection agrees. What has occured?
Three-way handshake
Four-way handshake (CORRECT)
Handshake
Two-way handshake
Awesome! A four-way handshake occurs when tearing down a session.
15. Ports 1024-49151 are known as ______ ports.
system
registered (CORRECT)
destination
source
Yep! Registered ports are used by less common applications.
16. If the transmitting device would like for the receiving device to push currently buffered data to the application on the receiving end immediately, it would set the ____ flag.
SYN
ACK
PSH (CORRECT)
FIN
You nailed it! The PSH flag ensures that the receiving end doesn’t wait for any further data.
17. The sequence of SYN, SYN/ACK, and ACK packets is known as the _________.
three-way handshake (CORRECT)
four-way handshake
two-way handshake
high five
Nice work! Such flags initiate each TCP connection by employing a sequence of flags.
18. Which field in a Transmission Control Protocol (TCP) header provides the next expected segment?
Acknowledgement number (CORRECT)
Checksum
Sequence number
Data offset
Well done! The acknowledgement number is the number of the next expected segment.
19. A communication between two devices is over the maximum limit of an ethernet frame size. The Transmission Control Protocol (TCP) splits up the data into segments. Which field in the header helps keep track of the many segments?
Sequence number (CORRECT)
Checksum
Acknowledgement number
Urgent pointer
Nice job! The sequence number is used to identify the location of a packet among a series of TCP segments.
20. A communication sent through Transmission Control Protocol (TCP) arrives out of order. What allows the data to be put back together in the correct order?
Preamble
Acknowledgement number
Sequence numbers (CORRECT)
Checksum
Well done! The proper sequence number assignment makes certain that the data has been assembled in the order it is supposed to be.
21. How many Transmission Control Protocol (TCP) control flags are there?
5
7
8
6 (CORRECT)
You got it! There are 6 TCP control flags.
22. What does a value of one in an ACK control flag represent?
There is one more packet to be transmitted.
The acknowledgement number field should be examined. (CORRECT)
It is the first transmission.
There is one packet to deliver.
Woohoo! An ACK flag field value of 1 indicates that the acknowledgement number field is to be checked.
23. A Transmission Control Protocol (TCP) connection is established and two devices ensure that they’re speaking the same protocol. What has occurred?
Four-way handshake
Three-way handshake (CORRECT)
Two-way handshake
Handshake
You nailed it! Every time a new TCP connection is formed, a handshake occurs in three segments: the first being SYN, the second is SYN-ACK, and the last is ACK.
24. The checksum doesn’t compute for a packet sent at the Internet Protocol (IP) level. What will happen to the data?
It will be sent, but may be out of order.
The data will be sent back to the sending node with an error.
The data will be discarded. (CORRECT)
The data will be resent.
Correct! At the IP or ethernet level, if a checksum doesn’t compute, all of the data is just discarded. It’s up to TCP to determine when to resend this data.
25. HTTP is an example of a(n) ______ layer protocol.
transport
data-link
application (CORRECT)
network
You got it! There are various application-layer protocols, out of which one of the most famous is HTTP.
26. The OSI network model has _____ layers.
three
five
six
seven (CORRECT)
Good! The OSI model has seven layers as compared to our model which has only five layers.
27. The concept of taking traffic that’s all aimed at the same node and delivering it to the proper receiving service is known as _________.
multiplexing
demultiplexing (CORRECT)
routing
encapsulation
You got it! Traffic of various services can be demultiplexed and sent to the same node.
28. Which field in a Transmission Control Protocol (TCP) header is chosen from ephemeral ports?
Destination port
Source port (CORRECT)
Sequence number
Acknowledgement number
You nailed it! An ephemeral port is represented as a high-numbered source port picked out from a defined range of ports.
29. How many bits are reserved for the Transmission Control Protocol (TCP) flags?
10
6 (CORRECT)
8
4
Correct! 6 bits are reserved for the 6 TCP control flags.
30. Which Transmission Control Protocol (TCP) flag is used to make sure the receiving end knows how to examine the sequence number field?
URG
ACK
PSH
SYN (CORRECT)
Correct! SYN flag is indicated as a sign of beginning a TCP connection and signifies to the corresponding destination how to understand the sequence number field的.
31. Ports 1 – 1023 are known as ______ ports.
system (CORRECT)
registered
destination
source
Yep! System ports are used for very well-known services.
32. The transport layer handles multiplexing and demultiplexing through what type of device?
Hubs
Switches
Routers
Ports (CORRECT)
Great! Ports are managed by the transport layer for multiplexer and demultiplexer functionality.
33. What port does the File Transfer Protocol (FTP) typically listen on?
443
21 (CORRECT)
25
80
Well done! FTP typically listens on port 21.
34. The instantiation of an endpoint in a potential TCP connection is known as a ______.
socket (CORRECT)
port
sequence number
TCP segment
Great work! To an applications layer network stack like an operating system is where this socket connects.
35. A Transmission Control Protocol (TCP) connection is in working order and both sides can send each other data. What is the TCP socket state?
SYN_RECEIVED
ESTABLISHED (CORRECT)
LISTEN
SYN_SENT
Yep! The ESTABLISHED state reflects that the TCP link is operational, also indicating that both sides are now in a position to freely exchange data.
36. The concept of taking traffic that’s all aimed at the same node and delivering it to the proper receiving service is known as _________.
multiplexing
demultiplexing (CORRECT)
routing
encapsulation
Awesome! Such demultiplexing permits traffic for numerous services to be sent to the particular application or process on the same node.
37. One side in a Transmission Control Protocol (TCP) connection has not been able to properly recover from a series of malformed segments. Which Transmission Control Protocol (TCP) flag will be used?
FIN
SYN (CORRECT)
RST
PSH
Great work! The SYN flag is used to make sure the receiving end knows how to examine the sequence number field.
38. A connection, at which layer, implies that every segment of data sent is acknowledged?
Data link
Transport (CORRECT)
Network
Application
Great! A connection at the transport layer implies that every segment of data sent is acknowledged.
39. Ports that are generally used to establish outbound connections are known as ______ ports.
System
reserved
ephemeral (CORRECT)
registered
Nice job! Temporary ports or ephemeral ports to be specific are ports that operating systems often get to use for outgoing connections. Assignment to them is dynamic, and thus, there is an established range for it which varies from one operating system to another. Client-side communications are made possible for client-server models, where the ports automatically close after the end of a communication session.
40. A network has the ability to direct traffic toward all of the receiving services. What provides this ability in the transport layer?
Socket address
File Transfer
Multiplexing (CORRECT)
Demultiplexing
Right on! Again, multiplexing in transport layer refers to the capability of network nodes to distribute the traffic to multiple different receiving services.