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

Ch 5_5f7d4d89cdc0f8ced47e32a15713ef8c

Uploaded by

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

Ch 5_5f7d4d89cdc0f8ced47e32a15713ef8c

Uploaded by

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

Ch5: Transport Layer

1
If You Can't Explain It Simply You Don't Understand It Well Enough

Introduction
Transport Layer

3
Transport Layer Functions
• The following are the main functions of the Network layer:
1. Segmentation and Reassembly.
2. Multiplexing and Demultiplexing.
3. Process-Level Addressing.

4
1. Segmentation and Reassembly
• The Transport layer segments the large amounts of data into
smaller pieces on the source machine, and then reassemble them
on the destination machine.
• Each segment contains a header (TCP or UDP) and a payload
field for holding the data.

5
2. Multiplexing and De-multiplexing
Multiplexing and De-multiplexing: transport layer protocols on a sending
device multiplex the data received from many application programs for
transport, combining them into a single stream of data to be sent.

6
3. Process-Level Addressing
• Host has many different software application processes running
concurrently, and generates data that it sends to TCP or UDP.
• TCP and UDP add address, called port, that allows a more
software process to be identified within a particular IP address.

7
Cont.
• For instance, assume a host is initiating a web page request from
a web server. When the host initiates the web page request, the
source port number is dynamically generated by the host to
uniquely identify the conversation. Each request generated by a
host will use a different dynamically created source port number.
This process allows multiple conversations to occur
simultaneously.

8
Demonstration

9
Socket
• The source and destination ports are placed within the segment.
The segments are then encapsulated within an IP packet. The IP
packet contains the IP address of the source and destination. The
combination of the source IP address and source port number, or
the destination IP address and destination port number is known
as a socket.

10
Port Number Groups

11
Key protocols port numbers

12
Cont.

13
Viewing the Active Connections
• The command netstat at command prompt view the Active
Connections on the PC.

• Unexplained TCP connections can pose a major security threat.


They can indicate that something or someone is connected to the
local host. Sometimes it is necessary to know which active TCP
connections are open and running on a networked host.
Dr. Mosleh Abualhaj 14
TCP and UDP

• The two most common Transport layer protocols are Transmission


Control Protocol (TCP) and User Datagram Protocol (UDP).

15
If You Can't Explain It Simply You Don't Understand It Well Enough

Transmission Control Protocol


(TCP)
TCP Header Format

17
TCP Fields
• Source port: The port number of the application on the host
sending the data.
• Destination port: The port number of the application requested
on the destination.
• Sequence number: A number used by TCP that puts the data back
in the correct order or retransmits missing or damaged data, a
process called sequencing.
• Acknowledgment number: The TCP octet that is expected next.
• HLEN (Header Length): This field contains two meaning. First, it
tells the size of TCP header (32-bit words). Secondly, it indicates
the offset of data in current packet in the whole TCP segment.
• Code bits/flags: Includes bit codes, or flags, that indicate the
purpose and function of the TCP segment
18
Cont.
• Reserved: This field is reserved for the future. Always set to zero.
• Window size: The window size the sender is willing to accept, in
octets.
• Checksum: Because TCP doesn’t trust the lower layers and checks
everything. The CRC checks the header and data fields.
• Urgent Pointer: A valid field only if the URG in the code bits is
set. This value indicates the offset from the current sequence
number, in octets, where the segment of non-urgent data begins.
• Options and Padding: May be 0 or a multiple of 32 bits, if any.
What this means is that no options have to be present (option
size of 0). However, if any options are used that do not cause the
option field to total a multiple of 32 bits, padding of 0s must be
used to make sure the data begins on a 32-bit boundary
19
TCP Services

• In addition to supporting the basic functions of data segmentation


and reassembly, TCP also provides the following services:
1. Establishes a Session.
2. Ensures Reliable Delivery.
3. Provides Same-Order Delivery.
4. Supports Flow Control .

20
1. Establishes a Session
• TCP is a connection-oriented transport protocol: the sender should
be sure of existing of the receiver before sending him the data
and may notify him.
• TCP is a full-duplex protocol, where each connection represents
two one-way communication streams, or sessions.
• TCP establishes a session in three steps using a three-way
handshake.
A B
• Step1: A sends SYN request to B.
• Step2: B sends ACK response and
SYN request to A.
• Step3: A sends ACK response to B.

TCP Control Bits

21
Session Termination Analysis
The termination process can be
initiated by any two hosts that have
an open session:
Step1: When the client has no more
data to send in the stream, it sends a
segment with the FIN flag set.
Step2: The server sends an ACK to
acknowledge the receipt of the FIN
to terminate the session from client
to server.
Step3: The server sends a FIN to the
client, to terminate the server to
client session.
Step4: The client responds with an TCP Control Bits
ACK to acknowledge the FIN from
the server.
22
2. Ensures Reliable Delivery
• Ensures Reliable Delivery- For
many reasons, it is possible for
a segment to become
corrupted or lost completely, as
it is transmitted over the
network. TCP ensures that each
segment that is sent by the
source arrives at the
destination.
• When TCP at the source host
has not received an
acknowledgement after a
predetermined amount of time,
it retransmits the data from
23
that point forward.
3. Same order delivery
• TCP ensures data is delivered sequentially as it was sent, using the sequence
number in the header.

24
4. Flow Control
• Network hosts have limited resources (i.e., memory and
processing power).
• When TCP is aware that these resources are overtaxed, it can
request that the sending application reduce the rate of data flow.
• This is done by TCP regulating the amount of data the source
transmits.
• Flow control can prevent the need for retransmission of the data
when the resources of the receiving host are overwhelmed.

25
Cont.

26
Cont.

27
UDP Header Format

28
UDP Features
• UDP is a best-effort transport protocol. UDP is a lightweight
transport protocol that offers the same data segmentation and
reassembly as TCP, but without TCP reliability and flow control.
• UDP is such a simple protocol that it is usually described in terms
of what it does not do compared to TCP.
• UDP features include the following:
– Data is reconstructed in the order that it is received.
– Any segments that are lost are not resent.
– There is no session establishment.
– The sending is not informed about resource availability.

29
Key features of TCP and UDP

TCP UDP
Connection-oriented Connectionless
Sequenced Unsequenced
More overhead Low overhead
Acknowledgments No acknowledgment
Windowing flow control No windowing or flow control

• Connection-oriented and Connectionless: Before a transmitting,


the sender TCP contacts the destination TCP to establish a
connection, connection-oriented. While, the sender UDP does not
contact the destination UDP, Connectionless.
Dr. Mosleh Abualhaj 30
Cont.
• Data Sequences: TCP numbers and sequences each segment so
that the receiver can put the segments back into the order
the application intended, while UDP not.
• Overhead: The UDP header size is 8 bytes, while TCP is 20 bytes.
Therefore, the TCP adds more overhead than UDP
• Acknowledgment: The TCP receiver send back an
acknowledgment to the sender, while The UDP not
• Windowing and flow control: TCP agree on he amount of
information that’s going to be sent before the recipient’s TCP
sends back an acknowledgment. While UDP not.

31
Applications that use TCP
• TCP handles all tasks associated with dividing the data stream into
segments, providing reliability, controlling data flow, and
reordering segments. TCP frees the application from having to
manage any of these tasks. Applications, like those shown in the
figure, can simply send the data stream to the transport layer and
use the services of TCP.

32
Cont.
• The TCP reliability processes place additional overhead on
network resources due to the processes of acknowledgement,
tracking, and retransmission. To support these reliability
processes, more control data is exchanged between the sending
and receiving hosts.

33
Applications that use UDP
• There are three types of applications that are best suited for
UDP:
– Live video and multimedia applications: These applications can tolerate
some data loss, but require little or no delay. Examples include VoIP and
live streaming video.
– Simple request and reply applications: Applications with simple
transactions where a host sends a request and may or may not receive a
reply. Examples include DNS and DHCP.
– Applications that handle reliability themselves: Unidirectional
communications where flow control, error detection, acknowledgments,
and error recovery is not required, or can be handled by the application.
Examples include SNMP and TFTP.

34
Cont.

35

You might also like