0% found this document useful (0 votes)
3 views

Module 2

The transport layer in the TCP/IP suite facilitates process-to-process communication, providing essential services such as flow control, error control, and congestion control. It utilizes port numbers for addressing and ensures reliable data transfer through protocols like Stop-and-Wait and Go-Back-N. The transport layer operates between the application and network layers, managing the delivery of messages to the correct processes on the appropriate hosts.

Uploaded by

leojoychan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Module 2

The transport layer in the TCP/IP suite facilitates process-to-process communication, providing essential services such as flow control, error control, and congestion control. It utilizes port numbers for addressing and ensures reliable data transfer through protocols like Stop-and-Wait and Go-Back-N. The transport layer operates between the application and network layers, managing the delivery of messages to the correct processes on the appropriate hosts.

Uploaded by

leojoychan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 86

Module2

Transport Layer
Transport
Layer
• The transport layer in the TCP/IP suite is located between the
application layer and the network layer.
• It provides services to the application layer and receives
services from the network layer.
• The transport layer acts as a liaison between a client program and a
server program, process-to-process connection .
• It is the end-to-end logical vehicle
• The heart of the TCP/IP protocol suite.
Transport-Layer
Services
• Process-to-Process Communication
• Addressing: Port Numbers
• Encapsulation and Decapsulation
• Multiplexing and Demultiplexing
• Flow Control
• Error Control
• Congestion Control
Process-to-process
communication
• The first duty of a transport-layer protocol is to provide process-to-
process communication.
• A process is an application-layer entity (running program).
• A process on the local host (client), needs services from a
process usually on the remote host(server).
• Both processes (client and server) have the same name.
Host-to-host communication Vs
process-to-process communication
• The network layer is responsible (host-to-host communication).
• A network-layer protocol can deliver the message only to the destination
computer.
• A transport-layer protocol is responsible for delivery of the message to
the appropriate process.
• The destination IP address defines the host and the port number
defines one of the processes on this particular host.
Network layer versus transport
layer
Addressing: Port
Numbers
• local host, local process, remote host, and remote process.
• The local host and the remote host are defined using IP addresses .
• To define the processes, we need port numbers.
• Port numbers are integers between 0 and 65,535 (16 bits).
• The client program defines itself with a port number, called the ephemeral
port number (short-lived).
• The server process must also define itself with a port number.
• This port number cannot be chosen randomly.
• TCP/IP has decided to use universal port numbers for servers; these
are called well-known port numbers.
• ICANN has divided the port numbers into three ranges: well-known,
registered, and dynamic (or private).

• The ports ranging from 0 to 1,023 are assigned and controlled by ICANN. These are the well-known ports.

• The ports ranging from 1,024 to 49,151 are not assigned or controlled by ICANN. They can only be registered with ICANN to prevent

duplication.

• The ports ranging from 49,152 to 65,535 are neither controlled nor registered. They can be used as temporary or private port

numbers .
ICANN stands for Internet Corporation for Assigned Names and Numbers.
It is a nonprofit organization responsible for coordinating the global Domain Name System (DNS), IP address allocation, and other internet
infrastructure functions.
Encapsulation and
Decapsulation
• To send a message from one process to another, the
transport-layer protocol encapsulates and decapsulates messages.
• Encapsulation happens at the sender site.
• When a process has a message to send, it passes the message to the
transport layer along with a pair of socket addresses.
• The transport layer receives the data and adds the
transport-layer header.
• Decapsulation happens at the receiver site.
• When the message arrives at the destination transport layer, the
header is dropped and the transport layer delivers the message to
Multiplexing and Demultiplexing
• The transport layer at the source performs multiplexing; the
transport layer at the destination performs demultiplexing.

• Whenever an entity accepts items from more than one source, this
is referred to as multiplexing (many to one); whenever an entity
delivers items to more than one source, this is referred to as
demultiplexing (one to many).
Flow Control
• If the items are produced faster than they can be consumed, the consumer
can be overwhelmed and may need to discard some items.
• We need to prevent losing the data items at the consumer site.
• If the sender delivers items whenever they are produced without a prior
request from the consumer⎯the delivery is referred to as pushing
;there is a need for flow control,
• If the producer delivers the items after the consumer has requested
them, the delivery is referred to as pulling.
• One of the solutions is normally to use two buffers: one at the sending
transport layer and the other at the receiving transport layer.
• When the buffer of the sending transport layer is full, it informs the application
layer to stop passing chunks of messages; when there are some vacancies, it
informs the application layer that it can pass message chunks again.
• When the buffer of the receiving transport layer is full, it informs the sending
transport layer to stop sending packets. When there are some vacancies, it
informs the sending transport layer that it can send packets again.
Error Control
• Since the network layer (IP) is unreliable, we need to make the
transport layer reliable if the application requires reliability.
• Reliability can be achieved to add error control services to the
transport layer.
• Error control at the transport layer is responsible for
• 1. Detecting and discarding corrupted packets.
• 2. Keeping track of lost and discarded packets and resending them.
• 3. Recognizing duplicate packets and discarding them.
• 4. Buffering out-of-order packets until the missing packets arrive.
• We can add a field to the transport-layer packet to hold the sequence
number of the packet.
• When a packet is corrupted or lost, the receiving transport layer can
somehow inform the sending transport layer to resend that packet
using the sequence number.
• For error control, the sequence numbers are modulo 2m, where m is
the size of the sequence number field in bits.
• The receiver side can send an acknowledgment (ACK) for each of a
collection of packets.
• The sender can detect lost packets if it uses a timer.
• When a packet is sent, the sender starts a timer. If an ACK does not
arrive before the timer expires, the sender resends the packet.
• These two requirements can be combined if we use two numbered
buffers, one at the sender, one at the receiver.
• At the sender, when a packet is prepared to be sent, we use the
number of the next free location, x, in the buffer as the sequence
number of the packet.
• When the packet is sent, a copy is stored at memory location x,
awaiting the acknowledgment from the other end.
• When an acknowledgment related to a sent packet arrives, the
packet is purged and the memory location becomes free.
• At the receiver, when a packet with sequence number y arrives, it is
stored at the memory location y until the application layer is ready to
receive it.
• An acknowledgment can be sent to announce the arrival of packet y.
Sliding Window
• A circle can represent the sequence numbers from 0 to 2^m − 1
• The buffer is represented as a set of slices, called the sliding window, that occupies
part of the circle at any time.

• At the sender site, when a packet is sent, the corresponding slice is marked.
• When an acknowledgment arrives, the corresponding slice is unmarked.
Congestion Control
• Congestion in a network may occur if the load on the network—the
number of packets sent to the network—is greater than the capacity of the
network—the number of packets a network can handle.
• Congestion control refers to the mechanisms and techniques that control
the congestion and keep the load below the capacity.
• Congestion in a network or internetwork occurs because routers and
switches have queues—buffers that hold the packets before and after
processing.
• A router, for example, has an input queue and an output queue for each
interface.
• If a router cannot process the packets at the same rate at which
they arrive, the queues become overloaded and congestion occurs.
• Congestion at the transport layer is actually the result of congestion at the
network layer.
Principles of Congestion Control
• A TCP sender can be slowed down due to congestion within the IP
network; this form of sender control is referred to as congestion
control.
• Specific TCP mechanisms are used to provide for a reliable
data transfer service in the face of packet loss.
• Packet loss typically results from the overflowing of router buffers
as the network becomes congested.
• Packet retransmission thus treats a symptom of network
congestion (the loss of a specific transport-layer segment) but
does not treat the cause of network congestion.
CONGESTION CONTROL

TCP uses a congestion window and a congestion policy


(that avoid congestion) to detect and alleviate congestion after
it has occurred.

Congestion Window
• The sender window size is determined by the available buffer space in
the receiver (rwnd).

• It is only the receiver that can dictate to the sender the size of the
sender’s window.
TCP/IP Protocol Suite 12
Congestion Window
• Ifthe network cannot deliver the data as fast as it is
created by the sender, it must tell the sender to slow down.
• In other words, in addition to the receiver, the network is
a second entity that determines the size of the sender’s window.
• The sender has two pieces of information:
▪ the receiver-advertised window size
▪ and the congestion window size.
• The actual size of the window is the minimum of these two.
Actual window size = minimum (rwnd, cwnd)
Congestion Policy
• TCP’s general policy for handling congestion is based on three phases:
• Slow start, congestion avoidance, and congestion detection.

• In the slow start phase, the sender starts with a


slow transmission, but increases the rate rapidly to reach a
threshold.
• When the threshold is reached, the rate of increase is reduced.
• Finally if ever congestion is detected, the sender goes back to the slow
start or congestion avoidance phase, based on how the congestion is
detected.
Slow Start: Exponential Increase
• The slow start algorithm is based on the idea that the size of the
congestion window (cwnd) starts with one maximum segment size
(MSS).

• The MSS is determined during connection establishment using


an option of the same name.

• The size of thewindow increases one MSS each time one


acknowledgement arrives.

• As thename implies, thealgorithm starts slowly, butgrows


exponentially.
Figure 15.34 Slow start, exponential increase

TCP/IP Protocol Suite 18


Slow start, exponential increase
Congestion Avoidance: Additive
Increase
• If we start with theslow start algorithm, thesize of the
congestion window increases exponentially.

• To avoid congestion beforeit happens, one must slow down


this exponential growth.

• TCP defines another algorithm called congestion avoidance,


which
increases the cwnd additively instead of exponentially.
Figure 15.35 Congestion avoidance, additive increase

TCP/IP Protocol Suite 21


Congestion Avoidance: Additive Increase
Congestion Detection: Multiplicative
Decrease
• If congestion occurs, the congestion window size must be decreased.
• The only way a sender can guess that congestion has occurred is the
need to retransmit a segment.
• However, retransmission can occur in one of two cases:
• when the RTO (retransmission time-out) timer times out or
• when three duplicate ACKs are received.
• In both cases, the size of the threshold is dropped to half (multiplicative decrease).
1. If a time-out occurs, there is a stronger possibility of congestion; a
segment has probably been dropped in the network and there is no
news about the following sent segments. In this case TCP reacts
strongly:

a. It sets the value of the threshold to half of the current window size.
b. It reduces cwnd back to one segment.
c. It starts the slow start phase again.
2. If three duplicate ACKs arereceived, there is a weaker
possibility of congestion; a segment may have been dropped but
some segments after that have arrived safely since three duplicate
ACKs are received. This is called fast transmission and fast recovery.

In this case, TCP has a weaker reaction as shown below:

a. It sets the value of the threshold to half of the current window size.
b. It sets cwnd to the value of the threshold (some implementations add
three segment sizes to the threshold).
c. It starts the congestion avoidance phase.
Connectionless and Connection-Oriented Services

• Connectionless service at the transport layer means


independence between packets;
• Connection-oriented means dependency.
Connectionless Service
• In a connectionless service, the source process (application program)
needs to divide its message into chunks of data of the size acceptable
by the transport layer and deliver them to the transport layer one by
one.
• When a chunk arrives from the application layer, the transport
layer encapsulates it in a packet and sends it.
• Assume that a client process has three chunks of messages to
send to a server process.
• The chunks are handed over to the connectionless transport
protocol in order.
• However, since there is no dependency between the packets at the
transport layer, the packets may arrive out of order at the destination
and will be delivered out of order to the server process.
• If these three chunks of data belong to the same message, the server
process may have received a strange message.
• Since there is no numbering on the packets, the receiving transport
layer has no idea that one of the messages has been lost.
• no flow control, error control, or congestion control can be effectively
implemented in a connectionless service.
Connection-Oriented Service

• The client and the server first need to establish a logical connection
between themselves.
• The data exchange can only happen after the connection
establishment.
• After data exchange, the connection needs to be turn down.
• We can implement flow control, error control, and congestion control
in a connection oriented protocol.
PROTOCOLS FOR RELIABLE DATA
TRANSFER (unidirectional)

• Simple Protocol
• Stop-and-Wait Protocol
• Go-Back-N Protocol (GBN)
• Selective-Repeat Protocol
States of Simple Protocol
Simple Protocol

• It is a simple connectionless protocol with neither flow nor error


control. It is assumed that the receiver can immediately handle any
packet it receives. In other words, the receiver can never be
overwhelmed with incoming packets.
• The transport layer at the sender gets a message from its application
layer, makes a packet out of it, and sends the packet.
• The transport layer at the receiver receives a packet from its network
layer, extracts the message from the packet, and delivers the message
to its application layer.
• The transport layers of the sender and receiver provide transmission
services for their application layers.
Stop-and-Wait Protocol (connection-oriented protocol)
• It is a connection-oriented protocol, which uses both flow and error
control. Both the sender and the receiver use a sliding window of size 1.
• The sender sends one packet at a time and waits for an
acknowledgment before sending the next one. In the Stop-and-Wait
protocol, the acknowledgment number always announces, in modulo-2
arithmetic, the sequence number of the next packet expected.
• To detect corrupted packets, we need to add a checksum to each data
packet. When a packet arrives at the receiver site, it is checked. If its
checksum is incorrect, the packet is corrupted and silently discarded.
• Every time the sender sends a packet, it starts a timer. If the timer expires,
the sender resends the previous packet.
• To prevent duplicate packets, the protocol uses sequence numbers and
acknowledgment numbers.
Go-Back-N Protocol (GBN)

• The key to Go-back-N is that we can send several packets before


receiving acknowledgments, but the receiver can only buffer one
packet.
• We keep a copy of the sent packets until the acknowledgments arrive.
• several data packets and acknowledgments can be in the channel at
the same time.
• if the acknowledgment number (ackNo) is 7, it means all packets with
sequence number up to 6 have arrived, safe and sound, and the
receiver is expecting the packet with sequence number 7.
• This protocol is inefficient if the underlying network protocol loses a
lot of packets.
• Each time a single packet is lost or corrupted, the sender resends all
outstanding packets, even though some of these packets may have
been received safe and sound but out of order.
• If the network layer is losing many packets because of congestion
in the network, the resending of all of these outstanding packets
makes the congestion worse, and eventually more packets are lost.
• This has an avalanche effect that may result in the total collapse of
the network.
Selective-Repeat Protocol

• It resends only selective packets, those that are actually lost.


• The Selective-Repeat protocol uses two windows: a send window and
a receive window.
• The receive window is the same size as the send window.
• In the Selective-Repeat protocol, an ACK number defines the
sequence number of the error-free packet received.
Q: Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and 5. The sender receives an ACK with
ackNo = 3. What is the interpretation if the system is using GBN or SR?

Ans: If the system is using GBN, it means that packets 0, 1, and 2 have been received uncorrupted
and
the receiver is expecting packet 3. If the system is using SR, it means that packet 3 has been
received uncorrupted; the ACK does not say anything about other packets.
Bidirectional Protocols:
Piggybacking
• In real life, data packets are normally flowing in both directions: from
client to server and from server to client.
• This means that acknowledgments also need to flow in
both directions.
• A technique called piggybacking is used to improve the efficiency of
the bidirectional protocols.
• When a packet is carrying data from A to B, it can also carry
acknowledgment feedback about arrived packets from B.
Internet Transport-Layer
Protocols
• UDP and TCP
• These protocols are located between the application layer and the
network layer and serve as the intermediary between the application
programs and the network operations.
• UDP is an unreliable connectionless transport-layer protocol used for
its simplicity and efficiency in applications where error control can be
provided by the application-layer process.
• TCP is a reliable connection-oriented protocol that can be used in any
application where reliability is important.
UDP takes messages from the application process, attaches
source and destination port number fields for the
multiplexing/demultiplexing service, adds two other small
fields, and passes the resulting segment to the network
layer.
▪ The network layer encapsulates the transport-layer
segment into an IP datagram and then makes a best-effort
attempt to deliver the segment to the receiving host.
▪ If the segment arrives at the receiving host, UDP uses the
destination port number to deliver the segment’s data to the
correct application process.
▪ Note that with UDP there is no handshaking between
sending and receiving transport-layer entities before
sending a segment. For this reason, UDP is said to be
connectionless.
Many applications are better suited for UDP for the
following reasons:
1. application-level control over what data is sent, and
when.
2. No connection establishment-UDP does not introduce
any delay to establish a connection. This is probably
the principal reason why DNS runs over UDP rather
than TCP.
3. No connection state.
4. Small packet header overhead. The TCP segment has
20 bytes of header overhead in every segment,
whereas UDP has only 8 bytes of overhead.
Explanation
application-level control over what data is sent, and when
 an application process passes data to UDP, UDP will
package the data inside a UDP segment and immediately
pass the segment to the network layer.

 TCP, on the other hand, has a congestion-control


mechanism that throttles the transport-layer TCP sender.

 TCP will also continue to resend a segment until the receipt


of the segment has been acknowledged by the destination,
regardless of how long reliable delivery takes.

 Since real-time applications often require a minimum


sending rate, do not want to overly delay segment
transmission, and can tolerate some data loss, TCP’s service
model is not particularly well matched to these applications’
needs.
Explanation
No connection state
TCP maintains connection state in the end systems. This
connection state includes receive and send buffers,
congestion-control parameters, and sequence and
acknowledgment number parameters.

 UDP, on the other hand, does not maintain connection state


and does not track any of these parameters. For this reason,
a server devoted to a particular application can typically
support many more active clients when the application runs
over UDP rather than TCP.
 The UDP header has only four fields, each consisting of two
bytes.
 The port numbers allow the destination host to pass the
application data to the correct process running on the
destination end system (that is, to perform the demultiplexing
function).
 The length field specifies the number of bytes in the UDP
segment (header plus data).
 An explicit length value is needed since the size of the data
field may differ from one UDP segment to the next.
 The checksum is used by the receiving host to check whether
errors have been introduced into the segment.
 The UDP checksum provides for error detection.

 That is, the checksum is used to determine whether bits


within the UDP segment have been altered (for example, by
noise in the links or while stored in a router) as it moved
from source to destination.

 UDP at the sender side performs the 1s complement of the


sum of all the 16-bit words in the segment, with any
overflow encountered during the sum being wrapped
around.

 This result is put in the checksum field of the UDP


segment.
0110011001100000
0101010101010101
1000111100001100

The sum of first two of these 16-bit words is


0110011001100000
0101010101010101
1011101110110101

Adding the third word to the above sum


gives 1011101110110101
1000111100001100
1,0100101011000001

0100101011000001
1
-----------------------
0100101011000010
 Note that this last addition had overflow, which was wrapped
around.

 The 1s complement is obtained by converting all the 0s to 1s


and converting all the 1s to 0s.

 Thus the 1s complement of the sum 0100101011000010 is


1011010100111101, which becomes the checksum.

 At the receiver, all four 16-bit words are added, including the
checksum. If no errors are introduced into the packet, then
clearly the sum at the receiver will be 1111111111111111.

 If one of the bits is a 0, then we know that errors have been


introduced into the packet.
0110011001100000
0101010101010101
1000111100001100
1011010100111101
---------------------------
- 1111111111111111
Message is accepted.
TRANSMISSION CONTROL PROTOCOL (TCP)
• Transmission Control Protocol (TCP) is a connection-oriented, reliable
protocol.
• TCP explicitly defines connection establishment, data transfer, and
connection teardown phases to provide a connection-oriented
service.
• TCP uses a combination of GBN and SR protocols to provide
reliablity.
• To achieve this goal, TCP uses checksum (for error detection),
retransmission of lost or corrupted packets, cumulative and selective
acknowledgments, and timers.
• TCP is the most common transport-layer protocol in the Internet.
TCP
Services
✔ Process-to-Process Communication
✔ Stream Delivery Service
✔ Full-Duplex Communication
✔ Multiplexing and Demultiplexing
✔ Connection-Oriented Service
✔ Reliable Service

TCP/IP Protocol Suite 64


TCP segment format

TCP/IP Protocol Suite 65


• Source port address. This is a 16-bit field that defines the port
number of the application program in the host that is sending the
segment.
• Destination port address. This is a 16-bit field that defines the port
number of the application program in the host that is receiving the
segment.
• Sequence number. This 32-bit field defines the number assigned to
the first byte of data contained in this segment.
• Acknowledgment number. This 32-bit field defines the byte number
that the receiver of the segment is expecting to receive from the
other party.
• Header length. This 4-bit field indicates the number of 4-byte words
in the TCP header.
• Control. This field defines 6 different control bits or flags.
• One or more of these bits can be set at a time.
• These bits enable flow control, connection establishment and
termination, connection abortion, and the mode of data transfer in
TCP.
• Window size. This field defines the window size of the sending TCP in
bytes.The length of this field is 16 bits. This value is normally referred
to as the receiving window (rwnd) and is determined by the receiver.
• Checksum. This 16-bit field contains the checksum. The calculation of
the checksum for TCP follows the same procedure as the one
described for UDP. However, the use of the checksum in the UDP
datagram is optional, whereas the use of the checksum for TCP is
mandatory.
• Urgent pointer. This 16-bit field, which is valid only if the urgent
flag is set, is used when the segment contains urgent data.
• Options. There can be up to 40 bytes of optional information in the
TCP header.
Figure 15.8 Encapsulation

TCP Application-layer data


heade
r

IP
header

Fram
e
heade
r
TCP
payload IP
payload
Data-link layer payload
TCP/IP Protocol Suite 69
TCP Connection phases

• TCP is connection-oriented.
• In TCP, connection-oriented transmission requires three phases:
• connection establishment
• data transfer
• connection termination.
Connection Establishment

• TCP transmits data in full-duplex mode.


• Each party must initialize communication and get approval from the
other party before any data are transferred.
• The connection establishment in TCP is called
three-way handshaking.
• The process starts with the server. The server program tells its TCP
that it is ready to accept a connection. This request is called a passive
open.
• The client program issues a request for an active open.
• 1. The client sends the first segment, a SYN segment, in which only
the SYN flag is set.
• This segment is for synchronization of sequence numbers.
• The SYN segment is a control segment and carries no data.
• However, it consumes one sequence number because it needs to be
acknowledged.
• 2. The server sends the second segment, a SYN + ACK segment.
• This segment has a dual purpose. First, it is a SYN segment for
communication in the other direction. The server also acknowledges
the receipt of the SYN segment from the client by setting the ACK
flag. It also needs to define the receive window size, rwnd (to be used
by the client).
• 3. The client sends the third segment. This is just an ACK segment. An
ACK segment, if carrying no data, consumes no sequence number.
Data Transfer

• After connection is established, bidirectional data transfer can take


place. The client and server can send data and acknowledgments in
both directions.
• In this example, after a connection is established, the client sends
2,000 bytes of data in two segments. The server then sends 2,000
bytes in one segment. The client sends one more segment.
• The data segments sent by the client have the PSH (push) flag set.
Connection Termination

• Either of the two parties involved in exchanging data (client or server)


can close the connection, although it is usually initiated by the client.
• Most implementations today allow two options for connection
termination: three-way handshaking and four-way handshaking with
a half-close option.
• In TCP, one end can stop sending data while still receiving data. This is
called a halfclose. Either the server or the client can issue a half-close
request. It can occur when the server needs all the data before
processing can begin.
Three-Way Handshaking for termination

• 1. In this situation, the client TCP, after receiving a close command


from the client process, sends the first segment, a FIN segment in
which the FIN flag is set.
• 2. The server TCP, after receiving the FIN segment, informs its process
of the situation and sends the second segment, a FIN+ACK segment.
• 3. The client TCP sends the last segment, an ACK segment, to confirm
the receipt of the FIN segment from the TCP server.
Three way Handshaking for termination
Four-way Handshaking for termination with Half-Close
Connection Reset

• TCP at one end may deny a connection request, may abort an existing
connection, or may terminate an idle connection.
• All of these are done with the RST (reset) flag.
Mechanisms for reliable data transfer
• Checksum
• Used to detect bit errors in a transmitted packet.
• Timer
• Used to timeout/retransmit a packet, possibly because the packet (or its ACK) was
lost within the channel.
• Sequence number
• Used for sequential numbering of packets of data flowing from sender to receiver.
• Acknowledgment
• Used by the receiver to tell the sender that a packet or set of packets has been
received correctly.
• Negative acknowledgment
• Used by the receiver to tell the sender that a packet has not been received
correctly.
• Window, pipelining
• The sender may be restricted to sending only packets with sequence numbers that
SYN Flooding Attack

• The connection establishment procedure in TCP is susceptible to a serious


security problem called SYN flooding attack.
• This happens when one or more malicious attackers send a large number of SYN
segments to a server pretending that each of them is coming from a different
client by faking the source IP addresses in the datagrams.
• The server, assuming that the clients are issuing an active open, allocates the
necessary resources, such as creating transfer control block (TCB) tables and
setting timers.
• The TCP server then sends the SYN + ACK segments to the fake clients, which
are lost.
• When the server waits for the third leg of the handshaking process, however,
resources are allocated without being used.
• If, during this short period of time, the number of SYN segments is large, the server
eventually runs out of resources and may be unable to accept connection requests
from valid clients.
• This SYN flooding attack belongs to a group of security attacks known as a denial of
service attack, in which an attacker monopolizes a system with so many service
requests that the system overloads and denies service to valid requests.
• Fortunately, an effective defense known as SYN cookies are now deployed in most
major operating systems.
pipelining

• The sender is allowed to send multiple packets without waiting for


acknowledgments.
• Since the many in-transit sender-to-receiver packets can be visualized as
filling a pipeline, this technique is known as pipelining.

• Pipelining has the following consequences for reliable data


transfer protocols:
• The range of sequence numbers must be increased, since each in-
transit packet (not counting retransmissions) must have a unique
sequence number and there may be multiple, in-transit,
unacknowledged packets.
• The sender and receiver sides of the protocols may have to buffer
more than one packet.
• A data transfer protocol responds to lost, corrupted, and overly
delayed packets.
• Two basic approaches toward pipelined error recovery can
be identified: Go-Back-N and selective repeat.
Flow control in TCP

• TCP provides a flow-control service to its applications to eliminate


the possibility of the sender overflowing the receiver’s buffer.
• Flow control is thus a speed-matching service—matching the rate at
which the sender is sending against the rate at which the receiving
application is reading.
• TCP provides flow control by having the sender maintain a variable
called the receive window.
• Informally, the receive window is used to give the sender an idea of
how much free buffer space is available at the receiver.

You might also like