Transport Layer and UDP
Transport Layer and UDP
Process-to-Process Delivery:
23.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Note
23.2
Figure 23.1 Types of data deliveries
23.3
Note
Port Addressing
Connection Control
Error Control
Flow Control
23.4
Figure 23.2 Port numbers
23.5
Figure 23.3 IP addresses versus port numbers
23.6
Figure 23.4 IANA ranges
23.7
Figure 23.5 Socket address
23.8
Figure 23.6 Multiplexing and demultiplexing
23.9
Figure 23.8 Position of UDP, TCP, and SCTP in TCP/IP suite
23.11
23-2 USER DATAGRAM PROTOCOL (UDP)
The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol.
User Datagram
Checksum
UDP Operation
Use of UDP
23.12
Table 23.1 Well-known ports used with UDP
23.13
Figure 23.9 User datagram format
23.16
Note
UDP length
23.17
Figure 23.10 Pseudoheader for checksum calculation
23.18
Example 23.2
Figure 23.11 shows the checksum calculation for a very small user datagram with only 7 bytes of
data. Because the number of bytes of data is odd, padding is added for checksum calculation. The
pseudoheader as well as the padding will be dropped when the user datagram is delivered to IP.
23.19
Figure 23.11 Checksum calculation of a simple UDP user datagram
23.20
The following is a dump of a UDP header in hexadecimal format.
0632000DOOlCE217
send data. In addition, TCP uses flow and error control mechanisms at the transport level.
TCP Services
TCP Features
Segment
A TCP Connection
Flow Control
Error Control
23.23
Table 23.2 Well-known ports used by TCP
23.24
Figure 23.13 Stream delivery
23.25
Figure 23.14 Sending and receiving buffers
23.26
Figure 23.15 TCP segments
23.27
Note
by TCP.
23.28
Example 23.3
23.29
Note
23.30
Note
23.31
Figure 23.16 TCP segment format
23.32
Figure 23.17 Control field
23.33
Table 23.3 Description of flags in the control field
23.34
Figure 23.18 Connection establishment using three-way handshaking
23.35
Note
number.
23.36
Note
sequence number.
23.37
Note
23.38
Figure 23.19 Data transfer
23.39
Figure 23.20 Connection termination using three-way handshaking
23.40
Note
23.41
Note
23.42
Figure 23.21 Half-close
23.43
Figure 23.22 Sliding window
23.44
Note
as
to control the flow of data so that the destination does not become
23.45
Example 23.4
What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size
Solution
The value of rwnd = 5000 − 1000 = 4000. Host B can receive only 4000 bytes of data before
overflowing its buffer. Host B advertises this value in its next segment to A.
23.46
Example 23.5
What is the size of the window for host A if the value of rwnd is 3000 bytes and the value of cwnd is
3500 bytes?
Solution
The size of the window is the smaller of rwnd and cwnd, which is 3000 bytes.
23.47
Example 23.6
Figure 23.23 shows an unrealistic example of a sliding window. The sender has sent bytes up to
202. We assume that cwnd is 20 (in reality this value is thousands of bytes). The receiver has sent
an acknowledgment number of 200 with an rwnd of 9 bytes (in reality this value is thousands of
bytes). The size of the sender window is the minimum of rwnd and cwnd, or 9 bytes. Bytes 200 to
202 are sent, but not acknowledged. Bytes 203 to 208 can be sent without worrying about
23.48
Figure 23.23 Example 23.6
23.49
Note
cwnd.
worth of data.
window.
acknowledged.
23.51
Note
arrived.
23.52
Note
23.53
Note
receiving TCP,
process.
23.54
Figure 23.24 Normal operation
23.55
Figure 23.25 Lost segment
23.56
Note
23.57
Figure 23.26 Fast retransmission
23.58
23-4 SCTP
layer protocol. SCTP, however, is mostly designed for Internet applications that have recently
been introduced. These new applications need a more sophisticated service than TCP can
provide.
Packet Format
An SCTP Association
23.59
Note
23.60
Table 23.4 Some SCTP applications
23.61
Figure 23.27 Multiple-stream concept
23.62
Note
23.63
Figure 23.28 Multihoming concept
23.64
Note
23.65
Note
23.66
Note
23.67
Note
23.68
Note
23.69
Figure 23.29 Comparison between a TCP segment and an SCTP packet
23.70
Note
separate chunks.
23.71
Figure 23.30 Packet, data chunks, and streams
23.72
Note
Data chunks are identified by three items: TSN, SI, and SSN.
23.73
Note
data chunks;
necessary.
23.74
Figure 23.31 SCTP packet format
23.75
Note
23.76
Figure 23.32 General header
23.77
Table 23.5 Chunks
23.78
Note
23.79
Note
chunk.
23.80
Figure 23.33 Four-way handshaking
23.81
Note
consume TSNs;
23.82
Figure 23.34 Simple data transfer
23.83
Note
23.84
Figure 23.35 Association termination
23.85
Figure 23.36 Flow control, receiver site
23.86
Figure 23.37 Flow control, sender site
23.87
Figure 23.38 Flow control scenario
23.88
Figure 23.39 Error control, receiver site
23.89
Figure 23.40 Error control, sender site
23.90