Protocols at the Transport layer (layer 4) are concerned with delivery of multiplexed application data.
They instruct a host what to do with the data in a packet, and optionally, how to verify that it is complete.
________ are preassigned by the Internet Assigned Numbers Authority (IANA) to “well-known” server applications.
Port numbers 0 through 1,023; Other server applications have been registered in the port range 1,024 through 49,151.
_______ are designated for private or dynamic use.
The remaining ports (up to 65,535)
Protocol in the TCP/IP suite operating at the transport layer to provide connection-oriented, guaranteed delivery of packets. works at the Transport layer to provide connection-oriented, guaranteed communication using acknowledgments to ensure that delivery has occurred. an be used for unicast transmission only.
The Transmission Control Protocol (TCP)
takes data from the Application layer as a stream of bytes and divides it up into segments, each of which is given a header. segments become the payload of the underlying IP datagrams.
TCP
The main fields in the header of a TCP segment are the following:
Source port
Destination port
Sequence number
Ack number
Data length
Flags
Window
Checksum
Urgent pointer
Options
TCP port of sending host.
Source port
TCP port of destination host.
Destination port
The ID number of the current segment (the sequence number of the last byte in the segment). This allows the receiver to rebuild the message correctly and deal with out-of-order packets.
Sequence number
The sequence number of the next segment expected from the other host (that is, the sequence number of the last segment received +1). Packets might be out of order because they are delayed, but they could also be lost completely or arrive in a damaged state. In the first case, the lack of acknowledgment results in the retransmission of data and, in the second case, a Negative Acknowledgment (NAK or NACK) forces retransmission.
Ack number
Length of the TCP segment.
Data length
Type of content in the segment (ACK, SYN, FIN, and so on).
Flags
The amount of data the host is willing to receive before sending another acknowledgment. TCP’s flow control mechanism means that if it is getting overwhelmed with traffic, one side can tell the other to slow the sending rate.
Window
Ensures validity of the segment. The checksum is calculated on the value of not only the TCP header and payload but also part of the IP header, notably the source and destination addresses. Consequently, the mechanism for calculating the checksum is different for IPv6 (128-bit addresses) than for IPv4 (32-bit addresses).
Checksum
If urgent data is being sent, this specifies the end of that data in the segment.
Urgent Pointer
Allows further connection parameters to be configured. The most important of these is the maximum segment size. This allows the host to specify how large the segments it receives should be, minimizing fragmentation as they are transported over data link frames.
Options
is typically established to transfer a single file, so a client session for something like a webpage (HTTP) might involve multiple _________ being opened with the server.These connections are managed using handshake transactions, which make use of a number of TCP flags.
TCP connections
A connection is established using a three-way handshake:
To close a connection, also referred to as teardown, the following basic steps are performed:
also works at the Transport layer, but unlike TCP, it is a connectionless, nonguaranteed method of communication with no acknowledgments or flow control.
The User Datagram Protocol (UDP)
is suitable for applications that send small amounts of data in each packet and do not require acknowledgment of receipt. It is used by Application layer protocols that need to send multicast or broadcast traffic. It may also be used for applications that transfer time-sensitive data but do not require complete reliability, such as voice or video.
UDP
This table shows the structure of a UDP header.
Source port
Destination port
Message length
Checksum
The header size is 8 bytes, compared to 20 bytes (or more) for TCP.
allows you to check the state of ports on the local host. You can use ______ to check for service misconfigurations, such as a host running a web or FTP server that a user installed without authorization. You may also be able to identify suspicious remote connections to services on the local host or from the host to remote IP addresses.
netstat
displays all open ports, including both active TCP and UDP connections and ports in the listening state.
netstat -a