0% found this document useful (0 votes)
24 views5 pages

Transport Layer

The transport layer is responsible for logical communications between applications and uses either TCP or UDP. TCP provides reliable connections using acknowledgements while UDP provides faster transmission without reliability.

Uploaded by

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

Transport Layer

The transport layer is responsible for logical communications between applications and uses either TCP or UDP. TCP provides reliable connections using acknowledgements while UDP provides faster transmission without reliability.

Uploaded by

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

The transport layer is responsible for logical communications between applications running on

different hosts. The transport layer has no knowledge of the destination host type, the type of media
over which the data must travel, the path taken by the data, the congestion on a link, or the size of
the network.

There are only 2 protocols in transport layer:


 TCP – Transmission Control Protocol
 UDP – User Datagram Protocol

Transport Layer responsibilities:


 Tracking individual conversation – maintaining and tracking
 Segmenting data and Reassembling segments – dividing data into smaller segments or
datagrams
 Add header information – “numbering” the segments to make sure they are all in correct
order to correct destinations
 Identifying the applications - separate and managing multiple applications, by segregating
them into different ports that differs with type of service
 Conversation Multiplexing – allows multiple applications access the internet in the same
time by segmenting into smaller parts, error checking can be performed by segments during
the transmission to determine problems

TCP is reliable transport layer protocol with “full-service”, connection-oriented.


TCP provides reliability and flow control using these basic
operations:
 Number and track data segments transmitted to a specific host from a specific application
 Acknowledge received data
 Retransmit any unacknowledged data after a certain amount of time
 Sequence data that might arrive in wrong order
 Send data at an efficient rate that is acceptable by the receiver

UDP is connectionless protocol, it uses datagrams which are also referred to segments, it is best-
effort which means it is faster. UDP provides no flow control or acknowledgement.
Except of data segmentation and reassembling, TCP provides:
 Establishing the session – how much traffic can be do at one time
 Ensures reliable delivery – acknowledgement
 Provides same order delivery – segments in correct order
 Supports flow control – if recourses of a device are overtaxed, TCP can reduce the rate of
data flow.

In TCP header, there are additional 20 bytes of data header


which includes:
 Source and destination port – 2x16 bits, what port is it on source and destination
 Sequence number – 32 bits for “numbering” segments for reassembly
 Acknowledgement number – 32 bits for checking if the data arrived
 Header length – 4 bits for indicate TCP segment header (“data offset”)
 Reserved – 6-bit for future use
 Control bits – bit codes or flags that indicate function of TCP segment
 Window size – 16-bit, indicates number of bytes that can be accepted at one time
 Checksum – 16-bit, error checking
 Urgent – 16-bit, if data is urgent

Applications that use TCP:


 HTTP
 FTP
 STMP
 SSH
UDP header contains:
 Source and Destination port – 2x16 bits, on what port is source and destination
 Length – 16 bits, length of UDP data header
 Checksum – error checking

Applications that use UDP:


 DHCP
 DNS
 SNMP
 TFTP
 VoIP
 Video conferencing

Overall media and video, simple messages apps and apps that handle reliability by themselves

Ports in TCP and UDP are used to Multiple Separate


communications.
When source host wants to send a request to the page, dynamic port number is assigned to that
request, then while sending this request, it gets destination port to which will send a request.
the IP and port numbers are known as socket pairs.
By the netstat command we can check to which TCP or UDP ports we are connected.

An individual server cannot have two services on the same port.

Three-way handshake:

1. SYN – initialling client requests to client-to-server session with a server


2. ACK and SYN – acknowledge to hosts SYN, requesting for server-to-client SYN
3. ACK – host sends acknowledge to the server

It validates that destination is ready to connect.

Two-way handshake (finish the session):


1. FIN – when there is no more data to stream
2. ACK – acknowledge to finish
3. then it repeats so it will be FIN-ACK-FIN-ACK

Control bits are flags that say what flag for TCP is set on:

 URG - Urgent pointer field significant


 ACK - Acknowledgment flag used in connection establishment and session termination
 PSH - Push function
 RST - Reset the connection when an error or timeout occurs
 SYN - Synchronize sequence numbers used in connection establishment
 FIN - No more data from sender and used in session termination

During session setup, the initial sequence number (ISN) is set to provide “numbering” the segments if
they arrive in not proper order.

To provide retransmission during data loss TCP uses SEQ (sequence number) and ACK (acknowledge)
by sending ACK past not proper SEQ number received, then source have to retransmit the all-next
segments, unless they use:

 SACK (selective acknowledgement) then source have to resend only valid segments.

The window size is the number of bytes that the destination device of a TCP session can accept and
process at one time:

 Initial window size is agreed during three-way handshake.


 After acknowledge, the window size is enlarged by the size of all segments sent to acknowledge
time.
 Today devices use sliding windows that work like source send 2 packets and ACK, the number of
segments may vary.

Maximum segment size is agreed during three-way handshake, it indicates the maximum size of the
segment that can be sent at one time:

 the default is 1460 bytes because of 20 bytes of IP and 20 bytes of TCP for IPv4, the default
doesn’t include TCP header itself.

To avoid congestions, if TCP doesn’t get expected acknowledge, it sends packet second time, but after
some time to avoid congestions (it often happens because of router discards the segment) it makes the
segment smaller to provide better communication.

UDP provides no establishment but it is best-effort:

 If data sequence is important to the application, it has to segregate it by itself.


 UDP works on ports like TCP.
 The UDP client process dynamically selects a port number from the range of port numbers
and uses this as the source port for the conversation.

You might also like