Transport Layer
Transport Layer
Accepting data from Session layer, split it into segments and send to the
network layer.
Ensure correct delivery of data with efficiency.
Isolate upper layers from the technological changes.
Error control and flow control.
UDP
Where,
Source port address: It defines the address of the application process that
has delivered a message. The source port address is of 16 bits address.
Destination port address: It defines the address of the application process
that will receive the message. The destination port address is of a 16-bit
address.
Total length: It defines the total length of the user datagram in bytes. It is a
16-bit field.
Checksum: The checksum is a 16-bit field which is used in error detection.
TCP
Stream data transfer: TCP protocol transfers the data in the form of
contiguous stream of bytes. TCP group the bytes in the form of TCP
segments and then passed it to the IP layer for transmission to the
destination. TCP itself segments the data and forward to the IP.
Reliability: TCP assigns a sequence number to each byte transmitted and
expects a positive acknowledgement from the receiving TCP. If ACK is
not received within a timeout interval, then the data is retransmitted to the
destination.
The receiving TCP uses the sequence number to reassemble the segments if
they arrive out of order or to eliminate the duplicate segments.
Flow Control: When receiving TCP sends an acknowledgement back to
the sender indicating the number the bytes it can receive without
overflowing its internal buffer. The number of bytes is sent in ACK in the
form of the highest sequence number that it can receive without any
problem. This mechanism is also referred to as a window mechanism.
Multiplexing: Multiplexing is a process of accepting the data from
different applications and forwarding to the different applications on
different computers. At the receiving end, the data is forwarded to the
correct application. This process is known as demultiplexing. TCP
transmits the packet to the correct application by using the logical channels
known as ports.
Logical Connections: The combination of sockets, sequence numbers, and
window sizes, is called a logical connection. Each connection is identified
by the pair of sockets used by sending and receiving processes.
Full Duplex: TCP provides Full Duplex service, i.e., the data flow in both
the directions at the same time. To achieve Full Duplex service, each TCP
should have sending and receiving buffers so that the segments can flow in
both the directions. TCP is a connection-oriented protocol. Suppose the
process A wants to send and receive the data from process B. The following
steps occur:
i. Establish a connection between two TCPs.
ii. Data is exchanged in both the directions.
iii. The Connection is terminated.
Where,
URG: The URG field indicates that the data in a segment is urgent.
ACK: When ACK field is set, then it validates the acknowledgement
number.
PSH: The PSH field is used to inform the sender that higher throughput is
needed so if possible, data must be pushed with higher throughput.
RST: The reset bit is used to reset the TCP connection when there is any
confusion occurs in the sequence numbers.
SYN: The SYN field is used to synchronize the sequence numbers in three
types of segments: connection request, connection confirmation ( with the
ACK bit set ), and confirmation acknowledgement.
FIN: The FIN field is used to inform the receiving TCP module that the
sender has finished sending data. It is used in connection termination in
three types of segments: termination request, termination confirmation, and
acknowledgement of termination confirmation.
i. Window Size: The window is a 16-bit field that defines the size of the
window.
ii. Checksum: The checksum is a 16-bit field used in error detection.
iii. Urgent pointer: If URG flag is set to 1, then this 16-bit field is an offset
from the sequence number indicating that it is a last urgent data byte.
iv. Options and padding: It defines the optional fields that convey the
additional information to the receiver.
Differences b/w TCP & UDP
TCP-window management
Window size: window size determines the amount of data that you can transmit
before receiving an acknowledgment. Sliding window refers to the fact that the
window size is negotiated dynamically during the TCP session.