Hệ thống viễn thông - Chương 22
-
Upload
mrphanhieuqt -
Category
Documents
-
view
219 -
download
0
Transcript of Hệ thống viễn thông - Chương 22
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 1/25
1
Transport LayerTransport Layer
PART V PART V
Position of transport layer
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 2/25
2
Transport layer duties
Chapters
Chapter 22 Process-to-Process Delivery
Chapter 23 Congestion Control and QoS
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 3/25
3
Chapter 22
Process-to-Process Delivery:
UDP and TCP
22.122.1 ProcessProcess --toto --Process DeliveryProcess DeliveryClient-Server Paradigm
Addressing
Multiplexing and Demultiplexing
Connectionless/Connection-Oriented
Reliable/Unreliable
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 4/25
4
The transport layer is responsible for process-to-process delivery.
NoteNote ::
Figure 22.1 Types of data deliveries
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 5/25
5
Figure 22.2 Port numbers
Figure 22.3 IP addresses versus port numbers
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 6/25
6
Figure 22.4 IANA ranges
Figure 22.5 Socket address
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 7/25
7
Figure 22.6 Multiplexing and demultiplexing
Figure 22.7 Connection establishment
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 8/25
8
Figure 22.8 Connection termination
Figure 22.9 Error control
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 9/25
9
22.222.2 UDPUDP
Port Numbers
User Datagram
Applications
UDP is a connectionless, unreliable protocol that has no flow and error
control. It uses port numbers to multiplex data from the application
layer.
NoteNote ::
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 10/25
10
Table 22.1Table 22.1 Well Well -- known ports used by UDP known ports used by UDP
Simple Network Management ProtocolSNMP161
Simple Network Management Protocol (trap)SNMP162
Trivial File Transfer ProtocolTFTP69
Remote Procedure CallRPC111
Network Time ProtocolNTP123
Domain Name ServiceNameserver53
Server port to download bootstrap informationBootps67
Client port to download bootstrap informationBootpc68
Returns the date and the timeDaytime13
Returns a quote of the dayQuote17
Returns a string of charactersChargen19
Active usersUsers11
Discards any datagram that is receivedDiscard9
Echo
Protocol
Echoes a received datagram back to the sender7
Description Port
Figure 22.10 User datagram format
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 11/25
11
The calculation of checksum and itsinclusion in the user datagram are
optional.
NoteNote ::
UDP is a convenient transport-layer protocol for applications that provide flow and error control. It is also used
by multimedia applications.
NoteNote ::
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 12/25
12
22.322.3 TCPTCP
Port Numbers Services Sequence Numbers Segments Connection Transition Diagram Flow and Error Control Silly Window Syndrome
Table 22.2Table 22.2 Well Well -- known ports used by TCP known ports used by TCP
Remote Procedure CallRPC111
FingerFinger79
Hypertext Transfer ProtocolHTTP80
Simple Mail Transfer ProtocolSMTP25
Domain Name ServerDNS53Bootstrap ProtocolBOOTP67
File Transfer Protocol (data connection)FTP, Data20
File Transfer Protocol (control connection)FTP, Control21
Terminal NetworkTELNET23
Returns the date and the timeDaytime13
Returns a quote of the dayQuote17
Returns a string of charactersChargen19
Active usersUsers11
Discards any datagram that is receivedDiscard9
Echo
Protocol
Echoes a received datagram back to the sender7
DescriptionPort
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 13/25
13
Figure 22.11 Stream delivery
Figure 22.12 Sending and receiving buffers
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 14/25
14
Figure 22.13 TCP segments
Example 1 Example 1
Imagine a TCP connection is transferring a file of 6000 bytes. Thefirst byte is numbered 10010. What are the sequence numbers foreach segment if data are sent in five segments with the first foursegments carrying 1000 bytes and the last segment carrying 2000bytes?
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 15/25
15
The bytes of data being transferred ineach connection are numbered byTCP. The numbering starts with a
randomly generated number.
NoteNote ::
The value of the sequence number field in a segment defines the number of the first data byte contained in that
segment.
NoteNote ::
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 16/25
16
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.
NoteNote ::
Figure 22.14 TCP segment format
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 17/25
17
Figure 22.15 Control field
Table 22.3Table 22.3 Description of flags in the control field Description of flags in the control field
Terminate the connection.FIN
Synchronize sequence numbers during connection.SYN
The connection must be reset.RST
Push the data.PSH
The value of the acknowledgment field is valid.ACK
The value of the urgent pointer field is valid.URG
DescriptionFlag
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 18/25
18
Figure 22.16 Three-step connection establishment
Figure 22.17 Four-step connection termination
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 19/25
19
Table 22.4Table 22.4 States for TCPStates for TCP
The server is waiting for the application to close.CLOSE-WAIT
The server is waiting for the last acknowledgment.LAST-ACK
The other side has accepted the closing of the connection.FIN-WAIT-2
Waiting for retransmitted segments to die.TIME-WAIT
Connection is established.ESTABLISHED
The application has requested the closing of the connection.FIN-WAIT-1
A connection request is sent; waiting for acknowledgment.SYN-SENT
A connection request is received.SYN-RCVD
The server is waiting for calls from the client.LISTEN
There is no connection.
Description
CLOSED
State
Figure 22.18 State transition diagram
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 20/25
20
A sliding window is used to make transmission more efficient as well as to control the flow of data so that the
destination does not become overwhelmed with data. TCP’s sliding
windows are byte-oriented.
NoteNote ::
Figure 22.19 Sender buffer
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 21/25
21
Figure 22.20 Receiver window
Figure 22.21 Sender buffer and sender window
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 22/25
22
Figure 22.22 Sliding the sender window
Figure 22.23 Expanding the sender window
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 23/25
23
Figure 22.24 Shrinking the sender window
In TCP, the sender window size is totally controlled by the receiver
window value (the number of emptylocations in the receiver buffer).
However, the actual window size can be smaller if there is congestion in the
network.
NoteNote ::
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 24/25
24
Some points about TCP’s sliding windows:
NoteNote ::
The source does not have to send a fullThe source does not have to send a fullwindow’s worth of data.window’s worth of data.
The size of the window can be increased orThe size of the window can be increased ordecreased by the destination.decreased by the destination.
The destination can send an acknowledgmentat any time.
Figure 22.25 Lost segment
8/9/2019 Hệ thống viễn thông - Chương 22
http://slidepdf.com/reader/full/he-thong-vien-thong-chuong-22 25/25
Figure 22.26 Lost acknowledgment
Figure 22.27 TCP timers