Sei sulla pagina 1di 30

Network Fundamentals Lecture 4

1
Objectives
Explain the role of Transport Layer protocols and
services in supporting communications across data
networks
Analyze the application and operation of TCP
mechanisms that support reliability
Analyze the application and operation of TCP
mechanisms that support reassembly and manage
data loss.
Analyze the operation of UDP.

2
Transport Layer Role and Services

Transport layer also:


Enables multiple applications to
communicate over the network at the
same time on a single device
Ensures that, if required, all the data is
received reliably and in order by the
correct application
Employs error handling mechanisms

3
Transport Layer Role and Services
Major functions of the transport layer and the role it
plays in data networks

4
Transport Layer Role and Services
Supporting Reliable Communication

UDP TCP

5
Transport Layer Role and Services
Basic characteristics of the UDP and TCP protocols

6
TCP Header Fields
Source and destination TCP port numbers are the
communication endpoints for sending and receiving
devices.
Message senders use sequence numbers to mark the
ordering of a group of messages. Both senders and
receivers use the acknowledgement numbers field to
communicate the sequence numbers of messages that
are either recently received or expected to be sent.
The header length field stores the total size of a TCP
header in multiples of four bytes. A header not using the
optional TCP field has a header length of 5
(representing 20 bytes), while a header using the
maximum-sized optional field has a header length of
15 (representing 60 bytes). 7
TCP Header Fields
Reserved data in TCP headers always has a value of
zero. This field serves the purpose of aligning the total
header size as a multiple of four bytes (important for
efficiency of computer data processing).
Flag bits are used to setup, tear down, reset
connections, push urgent data

8
TCP Header Fields
TCP senders use a number called window size to
regulate how much data they send to a receiver before
requiring an acknowledgement in return. If the window
size becomes too small, network data transfer will
happen unnecessarily slowly, while if the window size
becomes too large, the network link can become
saturated (unusable for any other applications) or
receiver may not be able to process incoming data
quickly enough (also resulting in slow performance).
Windowing algorithms built into the protocol
dynamically calculate size values and use this field of
TCP headers to co-ordinate changes between senders
and receivers.
9
TCP Header Fields
The checksum value inside a TCP header is generated
by the protocol sender as a mathematical technique to
help the receiver detect messages that are corrupted or
tampered with.
The urgent pointer field is often set to zero and
ignored, but in conjunction with one of the control flags,
it can be used as a data offset to mark a subset of a
message as requiring priority processing.

10
11
UDP Datagram Header

12
UDP Header Fields
Source Port : 16-bit field whose values can range from
0 to 65,535 specifying the source port.
Destination Port : 16-bit field whose values can range
from 0 to 65,535 specifying the destination port.
Length : 16-bit field whose values can range from 0 to
65,535. it is the length of the UDP header and the UDP
data in bytes. The minimum value for this field is 8
bytes.
UDP Checksum : 16-bit field whose values can range
from 0 to 65,535. The UDP checksum covers the UDP
header and the UDP data. With UDP the checksum is
optional, while the TCP it is mandatory.
13
14
Transport Layer Role and Services
Port numbers in the TCP and UDP protocols identify
the layer 7 applications in communication.

15
Transport Layer Role and Services

16
Application and Operation of TCP Mechanisms

17
Application and Operation of TCP Mechanisms

TCP Flags Field

18
Application and Operation of TCP Mechanisms
Port numbers used to establish TCP sessions and
directing segments to server process

19
A three way handshaking process is used to establish a TCP connection

Use netstat command at command prompt to see TCP/UDP connections.


20
Managing TCP Sessions
TCP sequence numbers are used to reconstruct the
data stream with segments placed in the correct order

21
During data transfer the TCP protocol uses sequence numbers
and acknowledgement numbers to manage the exchange.

See TCP Wireshark example. 22


The handshaking process is also used to terminate the TCP
connection in an orderly fashion.

23
Managing TCP Sessions
Retransmission is the remedy employed by TCP for lost
data

24
Flow control
TCP provides mechanisms for flow control.
Flow control assists the reliability of TCP
transmission by adjusting the effective rate
of data flow between the two services in
the session. When the source is informed
that the specified amount of data in the
segments is received, it can continue
sending more data for this session.

This Window Size field in the TCP header


specifies the amount of data that can be
transmitted before an acknowledgement
must be received. The initial window size is
determined during the session start-up via
the three-way handshake.

TCP feedback mechanism adjusts the


effective rate of data transmission to the
maximum flow that the network and
destination device can support without
loss. TCP attempts to manage the rate of
transmission so that all data will be
received and retransmissions will be
minimized.

25
Managing TCP Sessions
Shown are the mechanisms in TCP that manage the interrelationship
between window size, data loss and congestion during a session

26
UDP Protocol
UDP protocol low overhead, no sequencing, no
retransmission, no acknowledgements
connectionless protocol

27
UDP Protocol

28
UDP Protocol
Servers use port numbers to identify a specified
application layer process and direct segments to the
proper service or application

29
UDP Protocol
In the UDP protocol port numbers are utilized in client-
server communication.

30

Potrebbero piacerti anche