Professional Documents
Culture Documents
Transport Layer
Transport Layer
2
Transport layer
3
Process-to-Process Delivery
Client-Server Paradigm
Addressing
Multiplexing
Demultiplexing
Connectionless/Connection-Oriented
Reliable/Unreliable
4
Types of data deliveries
5
Port numbers
6
IP addresses versus port numbers
IANA ranges
7
A socket is one endpoint of a two-way communication link between two
programs running on the network. A socket is bound to a port number so that
the TCP layer can identify the application that data is destined to be sent to. An
endpoint is a combination of an IP address and a port number
Socket address
8
Multiplexing and demultiplexing
9
Connection Establishment
10
Connection Termination
11
Error Control
12
Transport Layer Protocols
There are five basic protocols for the Transport
Layer:
Transmission Control Protocol (TCP)
User Datagram Protocol (UDP)
Datagram Congestion Control Protocol (DCCP)
Stream Control Transmission Protocol (SCTP)
Resource Reservation Protocol (RSVP)
13
UDP
Port Numbers
User Datagram
Applications
14
Note:
UDP is a connectionless,
unreliable protocol that has
no flow and error control. It
uses port numbers to
multiplex data from the
application layer.
15
Well-known ports used by UDP
Port Protocol Description
17
UDP
The calculation of checksum and its inclusion in the
user datagram are optional.
UDP is not a convenient transport-layer protocol for
applications that provide flow and error control. It is
also used by multimedia applications.
18
Use of UDP
UDP is suitable for a process that requires simple request-
response communication with little concern for flow and error
control. It is not usually used for a process such as FTP that needs
to send bulk data
UDP is suitable for a process with internal flow and error control
mechanisms. For example, the Trivial File Transfer Protocol (TFTP)
process includes flow and error control. It can easily use UDP.
UDP is a suitable transport protocol for multicasting. Multicasting
capability is embedded in the UDP software but not in the TCP
software.
UDP is used for management processes such as SNMP.
UDP is used for some route updating protocols such as Routing
Information Protocol (RIP)
19
TCP
Port Numbers
Services
Sequence Numbers
Segments
Connection
Transition Diagram
Flow and Error Control
Silly Window Syndrome
20
Well-known ports used by TCP
Port Protocol Description
Echoes a received datagram back to the
7 Echo
sender
9 Discard Discards any datagram that is received
11 Users Active users
13 Daytime Returns the date and the time
17 Quote Returns a quote of the day
19 Chargen Returns a string of characters
20 FTP, Data File Transfer Protocol (data connection)
File Transfer Protocol (control
21 FTP, Control
connection)
23 TELNET Terminal Network
25 SMTP Simple Mail Transfer Protocol
53 DNS Domain Name Server
67 BOOTP Bootstrap Protocol
79 Finger Finger
80 HTTP Hypertext Transfer Protocol
21
111 RPC Remote Procedure Call
Stream Delivery
22
TCP segments
23
Example 1
Imagine a TCP connection is transferring a file of 6000
bytes. The first byte is numbered 10010. What are the
sequence numbers for each segment if data are sent in five
segments with the first four segments carrying 1000 bytes
and the last segment carrying 2000 bytes?
Solution
The following shows the sequence number for each segment:
Segment 1 ==> sequence number: 10,010 (range: 10,010 to 11,009)
Segment 2 ==> sequence number: 11,010 (range: 11,010 to 12,009)
Segment 3 ==> sequence number: 12,010 (range: 12,010 to 13,009)
Segment 4 ==> sequence number: 13,010 (range: 13,010 to 14,009)
Segment 5 ==> sequence number: 14,010 (range: 14,010 to 16,009)
24
TCP
The bytes of data being transferred in each
connection are numbered by TCP. The numbering
starts with a randomly generated number.
The value of the sequence number field in a segment
defines the number of the first data byte contained in
that segment.
The value of the acknowledgment field in a segment
defines the number of the next byte a party expects
to receive.
The acknowledgment number is cumulative.
25
TCP segment format
26
Control Field
27
Description of flags in the control field
Flag Description
28
Three-step connection establishment
29
Four-step connection termination
30
States for TCP
State Description
32
Sender Buffer
33
Receiver window
34
Sender buffer and sender window
35
Sliding the sender window
36
Expanding the sender window
37
Shrinking the sender window
38
TCP window size
In TCP, the sender window size is totally controlled
by the receiver window value (the number of empty
locations in the receiver buffer). However, the actual
window size can be smaller if there is congestion in
the network
The source does not have to send a full
window’s worth of data
The size of the window can be increased or
decreased by the destination
39
Lost Segment
40
Lost Acknowledgment
41