Contents
LECTURE 8
• I. Process-to-Process Delivery
Transport layer protocols
• II. UDP (User Datagram Protocol) • III. TCP (Transmission Control Protocol) • IV. SCTP (Stream Control Transport Protocol)
Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP (Forouzan, Data Communications and Networking, 4th Edition) 2
1
23-1 PROCESS-TO-PROCESS DELIVERY
Figure 23.1 Types of data deliveries
The transport layer is responsible for process-toprocess delivery—the delivery of a packet, part of a message, from one process to another. Two processes communicate in a client/server relationship, as we will see later. Topics discussed in this section: Client/Server Paradigm Multiplexing and Demultiplexing Connectionless Versus Connection-Oriented Service Reliable Versus Unreliable Three Protocols
The transport layer is responsible for process-to-process delivery. 3
4
Transport layer concept
Process
• Network layer is responsible for source-todestination delivery of an individual packet • Transport layer ensures that the whole message arrives intact and in order
Internet Explorer
Internet Explorer
—Provide error control, flow control, and in-sequence delivery, on an end-to-end basis
MSN
E-mail
Messenger
• Operating system today supports both multiuser and multitasking environment • Can be in the form of • Client-server communication • Peer-to-peer communication 6
• Also ensure delivery from one process to another process —Process-to-process delivery —Process is identified by port number
• Real communication takes place between two processes or application programs 5
Transport Layer Address
Antivirus Software
Figure 23.4 IANA ranges
• Process can be identified by port number —Identify multiple processes running on the same destination host
• Usually has 16 bits, or 65536 available ports — Well-known ports (0-1023) are assigned and controlled by IANA (Internet Assigned Number Authority) — Registered ports (1024-49,151) are neither assigned nor controlled by IANA, but can be registered to avoid duplication — Dynamic ports (49,152-65,535) can be used by any process 7
• Well-known port is often used by server process to allow remote clients to connect to —Ex. Daytime server process always uses port 13
• Other ports are often randomly chosen by the client to identify various client processes running on the same host —Ex. Daytime client process randomly pick port 52,000 to identify itself
8
Figure 23.3 IP addresses versus port numbers
Figure 23.2 Port numbers
To
Form
Request Reply Form To
9
10
Figure 23.6 Multiplexing and demultiplexing
Figure 23.5 Socket address
• Combination of IP address and port number is called a socket address —IP header contains IP address —Transport layer header contains port number • Transport protocol accepts message from different processes — Differentiated by their assigned port number
11
• Transport protocol adds header (with port number) and passes packet to the network layer
12
Connectionless vs. Connection-oriented Services • Connectionless service —No connection establishment or connection release —Packets are not numbered —No acknowledgement —Example is UDP, User Datagram Protocol
• Connection-oriented service —Need to establish and release a connection —Examples are TCP and SCTP
13
Reliable vs. Unreliable
14
Figure 23.7 Error control
• Transport protocol can be made reliable by implementing flow and error control —Also result in a slower and more complex service —TCP and SCTP are connection-oriented and reliable
• UDP is connectionless and unreliable
• We need reliable services at both transport layer and data link layer 15
—Flow and error control at data link layer cannot guarantee that error will not occur at network layer
16
Figure 23.8 Position of UDP, TCP, and SCTP in TCP/IP suite
23-2 USER DATAGRAM PROTOCOL (UDP) The User Datagram Protocol (UDP) is called a connectionless, unreliable transport protocol. It does not add anything to the services of IP except to provide process-to-process communication instead of host-tohost communication. Topics discussed in this section: Well-Known Ports for UDP User Datagram Checksum UDP Operation Use of UDP 17
18
Table 23.1 Well-known ports used with UDP
Example 23.1 In UNIX, the well-known ports are stored in a file called /etc/services. Each line in this file gives the name of the server and the well-known port number. We can use the grep utility to extract the line corresponding to the desired application. The following shows the port for FTP. Note that FTP can use port 21 with either UDP or TCP.
19
20
Example 23.1 (continued)
Figure 23.9 User datagram format
SNMP uses two port numbers (161 and 162), each for a different purpose, as we will see in Chapter 28.
In Windows, the well-known ports are stored in a file called C:\WINDOWS\system32\drivers\etc\services.
• Length = Length of user datagram (UDP header + data) — Also available in IP header
UDP length = IP length – IP header’s length 21
UDP Checksum
22
Figure 23.10 Pseudo header for checksum calculation
• Include three sections: pseudo header, UDP header, and data from application layer • Checksum is used to detect error over the entire user datagram (header + data) —Checksum in IP header is only used to detect error in IP header
• Value of protocol field for UDP is 17 • UDP checksum usage is optional —All 1s is used if checksum is not calculated
23
24
Example 23.2
Figure 23.11 Checksum calculation of a simple UDP user datagram
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.
25
26
UDP Operation
Queue in UDP (1)
• Connectionless service
• UDP queues are associated with ports • Queue is available when process is running
— Each datagram is independent from one another — Datagram is not numbered — There is no connection establishment and termination — Cannot transport stream of data
—Queue is destroyed when process exists
• Outgoing queue
• Application will need to chop data stream into packet first
• Flow and Error Control — No flow control: Receiver may overflow with incoming messages — Checksum provides simple error detection • Packet is silently discarded if checksum is invalid • But there is no error correction • Sender will not know if a message has been lost or duplicated
—Source sends message by putting it into UDP queue associated with the source port number —UDP removes message one-by-one, adds UDP header, and delivers them to IP —Outgoing UDP queue can overflow • Operating system will ask the sending process to wait
• Encapsulation and Decapsulation 27
28
Queue in UDP (2)
Figure 23.12 Queues in UDP
• Upon message arrival, UDP looks for the incoming queue associated with the destination port number —If queue exists, UDP places the received datagram into the queue —If queue does not exist, UDP discards the received datagram and sends ICMP port unreachable message back to the sender —If incoming queue is overflow, UDP also discards the received datagram and sends ICMP port unreachable message back to the sender
• Reply is sent back to the source port number specified in the received UDP message 29
30
23-3 TCP
UDP Applications • Simple request-response communication
TCP is a connection-oriented protocol; it creates a virtual connection between two TCPs to send data. In addition, TCP uses flow and error control mechanisms at the transport level.
—Little concern on flow and error control
• Process with internal flow and error control mechanisms • Multicasting (one-to-many communication)
Topics discussed in this section:
—Multicasting is only supported by UDP
TCP Services TCP Features Segment A TCP Connection Flow Control Error Control
• Management process such as SNMP • Routing protocol such as Routing Information Protocol (RIP) 31
32
Table 23.2 Well-known ports used by TCP
Services Offered by TCP • Process-to-process communication • Stream delivery service —TCP is a stream-oriented protocol —Neither IP nor UDP recognizes any relationship between the datagrams Receiving Sending
• Full-Duplex communication —Data flows in both directions at the same time
• Connection-oriented with setup and tear-down • Reliable service via acknowledgement mechanism 33
Figure 23.13 Stream delivery
• TCP allows sending process to deliver data as a stream of bytes and allow receiving process to obtain data as a stream of bytes • Two processes are connected by an imaginary 35 tube
34
Figure 23.14 Sending and receiving buffers
36
Sending and Receiving Buffers
Figure 23.15 TCP segments
• Two circular buffers of 20 bytes each • White section contains empty chamber • On the transmitting side —Grey area holds bytes that have been sent but not yet acknowledged • After bytes in grey chambers are acknowledged, chambers can be recycle and available for use for new data
—Pink area contains bytes to be sent
• On the receiving side —Pink area contains received bytes that can be read by the receiving process
5 bytes
3 bytes
37
38
TCP Segment
TCP Numbering System
• Even if TCP transport stream of data, the underlying IP layer needs to send data in packets
• Enable the previously mentioned services • TCP relies on sequence number and acknowledgement number • TCP numbers all data bytes that are transmitted in a connection
—Not a stream of bytes
• TCP groups a number of bytes together into a packet called segment
—Numbering is independent in each direction —Randomly choose number between 0 and 232-1 for the first bytes —If random number is 1057 and a total of 6000 bytes need to be sent, the bytes are numbered from 1057 to 7056
—Also add header to each segment and —Deliver the segment to IP layer for transmission
• Segment may be received out-of-order, lost, or corrupted —TCP resent segment as necessary 39
40
TCP Sequence Number (1)
Example 23.3 Suppose a TCP connection is transferring a file of 5000 bytes. The first byte is numbered 10,001. What are the sequence numbers for each segment if data are sent in five segments, each carrying 1000 bytes?
The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number. • Sequence number for each segment is the number of the first byte carried in that segment The value in the sequence number field of a segment defines the number of the first data byte contained in that segment.
Solution The following shows the sequence number for each segment:
41
TCP Sequence Number for Control Segment
42
TCP Acknowledgement Number
• If a segment contains control information, one sequence number is consumed
• Acknowledgement (ACK) number confirms the bytes it has received • ACK number defines the number of the next byte that it expects to receive • ACK number is cumulative
—As though 1 imaginary byte is carried —Necessary to enable acknowledgement —Connection establishment, termination, or abortion
• If a segment contains no data, the sequence number field has no meaning
—ACK number = 5643 means that it has received all bytes from the beginning up to 5642
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. 43
44
TCP Services
Figure 23.16 TCP segment format
• Flow control —Receiver can control the amount of data that are to be sent by the sender
• Error control —Error in data segment is detected by checksum —Retransmission of error segment is used to provide reliable service
• Congestion control —Amount of data that can be transmitted also depends on level of congestion in the network 45
46
Figure 23.17 Control field
TCP Header (1) • Basic header is 20 bytes, with up to 40 additional bytes for TCP options • Source and destination port addresses serve the same purpose as those in UDP header • Sequence number indicates the number assigned to the first byte of data contained in this TCP segment
Table 23.3 Description of flags in the control field
—Initial sequence number is generated randomly
• Acknowledgement number indicates the byte number that this node is expecting to receive —ACK and data can be piggybacked together 47
48
TCP Header (2)
TCP Connection
• Header length defines the length of TCP header in a unit of 4-bytes
• TCP is connection-oriented • TCP uses the service of IP (connectionless) but additionally
— 4 bits allow up to 60 bytes (15 x 4) bytes for header
• Window size indicates the number of bytes which this host is willing to accept
—Retransmit a lost or corrupted segment —Hold any out-of-order segment until the missing segment arrives
—Beginning with the one indicated in the acknowledgment field
• Consists of three phases
• Checksum also follows the same procedure as UDP checksum
—Connection establishment —Data transfer —Connection termination
—Pseudoheader is also used, with protocol value = 6
• Urgent pointer defines the last urgent byte —Store a number that must be added to sequence no. 49
TCP Connection Establishment (1) •
50
Figure 23.18 Connection establishment using three-way handshaking
Each party must initialize communication and get approval from the other party before transferring any data — Called three-way handshaking
• Typically initiated from client to server 1. Server makes itself ready to accept connection by entering a “passive open” state 2. Client send SYN segment for synchronization of sequence number •
SYN segment consumes one imaginary byte A SYN segment cannot carry data, but it consumes one sequence number.
51
52
TCP Connection Establishment (2)
SYN Flooding Attack
3. Server sends a dual purpose segment
•
• • •
ACK to acknowledge the previous SYN segment Its own SYN for communication in the other direction (server to client) Also consumes one imaginary byte
— Pretending that each one arrives from a different client by faking source IP address
•
A SYN + ACK segment cannot carry data, but does consume one sequence number.
•
Same sequence number as the original SYN segment
An ACK segment, if carrying no data, consumes no sequence number.
•
•
Belong to a type of security attack known as denial-of-service attack One solution is to postpone resource allocation until the entire connection is set up
53
54
Figure 23.19
TCP Data Transfer • •
Server allocates necessary resource that will never get used — Table, memory, timer, port, handle
4. Client send ACK segment to acknowledge the previous SYN+ACK segment •
Attacker sends a large number of SYN segments to a server
Data transfer
Data transfer is bi-directional Acknowledgement can be piggybacked with the data Push flag (PSH) tell the receiver to deliver data to application layer as soon as they are received — Useful for interactive application
•
If push flag is off, receiving TCP can choose when to pass this data to its server application process — For example, receiving TCP can wait for a full buffer before passing data to its application layer — Flexibility in TCP operation leads to protocol efficiency 55
56
TCP Data Transfer: Urgent Data
TCP Connection Termination
•
• Called three-way handshaking 1. Client sends FIN segment with FIN flag set to the server
Sending application may want a piece of data to be delivered out-of-order by the receiver — For example, an abort command (control-C)
•
— May or may not include last chunk of data
Urgent data must be at the beginning of the segment
2. Server sends a dual-purpose segment, FIN+ACK — ACK to confirm the receipt of FIN segment from client — FIN to announce the closing of connection in the other direction — Can also contain the last segment of data from server
— Urgent pointer points to the end of urgent data and the start of normal data — Normal data can be at the end of the same segment
•
Receiving TCP process will extract urgent data and deliver them out-of-order to its application layer
3. Client sends ACK segment to confirm the receipt of FIN+ACK from the server — Acknowledgement number is advanced by 1 — Cannot carry any data
57
58
TCP Connection Termination: Half-close
Figure 23.20 Connection termination using three-way handshaking
• The FIN segment consumes one sequence number if it does not carry data. The FIN + ACK segment consumes one sequence number if it does not carry data. 59
Closing the connection in one direction at a time — Stop sending data but expect to continue receiving data
•
Useful when server needs all data before begin processing — Sorting application or HTTP request
•
Server accept half-close status by sending the ACK segment — Instead of FIN+ACK in three-way handshake
•
Data can still flow in one direction, server to client — Client can only send ACK to server, but not any additional data •
• •
All transmissions from client uses the same sequence number
After server sent all processed data back, it can send FIN segment to client Handshake is completed with the last ACK segment from client 60
Figure 23.21
TCP Flow Control
Half-close
•
Called sliding window protocol — Based on Go-Back-N protocol because it does not use NACK — Based on Selective Repeat because the receiver holds out-of-order segment until the missing one arrives
•
Bytes inside the window are the bytes that can be in transit — Can be sent without worrying about acknowledgement
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 sliding windows are byte-oriented. 61
62
Example 23.4
Figure 23.22 Sliding window
What is the value of the receiver window (rwnd) for host A if the receiver, host B, has a buffer size of 5000 bytes and 1000 bytes of received and unprocessed data?
•
rwnd = Receiver window — Value advertised by the opposite end in a segment containing acknowledgement — Reflects the number of bytes that the receiver can accept before its buffer overflow and data are discarded
•
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.
cwnd = Congestion window — Will be discussed in the next Chapter
63
64
Example 23.6
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.
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 acknowledgment. Bytes 209 and above cannot be sent.
65
66
Note
Figure 23.23 Example 23.6
Some points about TCP sliding windows: ҩ The size of the window is the lesser of rwnd and cwnd. ҩ The source does not have to send a full window’s worth of data. ҩ The window can be opened or closed by the receiver, but should not be shrunk. ҩ The destination can send an acknowledgment at any time as long as it does not result in a shrinking window. ҩ The receiver can temporarily shut down the window; the sender, however, can always send a segment of 1 byte after the window is shut down. 67
68
TCP Error Detection and Correction Tools
TCP Error Control •
Application relies on TCP to deliver the entire stream of data — — — —
•
• •
TCP error control includes mechanism to detect — — — —
•
In order Without error Without loss Without duplication
1. Checksum 2. Acknowledgement Confirm receipt of data segment Control segments that carry no data but consume a sequence number are also acknowledged
ACK segments do not consume sequence numbers and are not acknowledged.
Corrupted segment Lost segment Out-of-order segment Duplicated segment
3. Retransmission Time-out •
TCP error control includes mechanism to correct error after they are detected
•
Corrupted, lost, or delayed segment is retransmitted after time-out Also retransmitted after three duplicated ACKs
69
70
Figure 23.24
TCP Retransmission •
Retransmission after Retransmission Time-Out (RTO)
Normal operation
ACK may be delayed by 500 ms to wait for any additional segments
— TCP maintains one RTO timer for all unacknowledged segments — When the timer matures, the earliest outstanding segment is retransmitted — RTO is dynamically calculated from Round-Trip Time (RTT) •
•
RTT = Time needed for a segment to reach a destination and for an ACK to be received
Retransmission after three duplicated ACK segments — Allow immediate retransmission before RTO — Also called fast retransmission
In modern implementations, a retransmission occurs if the retransmission timer expires or three duplicate ACK segments have arrived. No retransmission timer is set for an ACK segment.71
72
TCP In-sequence Delivery
TCP Operation with Lost Segment
•
Segment may arrive out-of-order if the previous segment is
•
— Delayed — Lost or discarded
•
•
Lost and corrupted segments are treated the same way by the receiver Receiver stores data in its buffer — But leaves a gap to indicate that there is no continuity in the data — Also immediately send ACK to the sender with the next byte that it expects — Store bytes 801 to 900 but never delivers them to application until the gap is filled
Out-of-order segment is hold by TCP until the missing segment arrives — Out-of-order segments are not delivered to the application layer
Data may arrive out of order and be temporarily stored by the receiving TCP, but TCP guarantees that no outof-order segment is delivered to the process.
•
Third ACK changes according to the updated status The receiver TCP delivers only ordered data to the process.
73
74
TCP Fast Retransmission
Figure 23.25 Lost segment
• •
Fourth, Fifth, and Sixth segments trigger acknowledgement message Sender receives four ACK with the same value — Ack = 301 (referring to the third segment) — Four ACKs = Three duplicates
•
Segment 3 is immediately retransmitted — Before RTO expires — All four ACKs say that the third segment is missing
•
Only one segment (the third one) is retransmitted even though four segments are not acknowledged — Receiver knows that the other three segments (4-6) arrive safely because . . .
75
76
Figure 23.26 Fast retransmission
TCP Acknowledgement Number • Acknowledgement (ACK) number confirms the bytes it has received • ACK number defines the number of the next byte that it expects to receive • ACK number is cumulative —ACK number = 5643 means that it has received all bytes from the beginning up to 5642
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. 77
IV. Stream Control Transmission Protocol (SCTP)
UDP, TCP, and SCTP
SCTP is a new reliable, message-oriented transport layer protocol. SCTP, however, is mostly designed for Internet applications that have recently been introduced. It combines the best features of UDP and TCP. These new applications need a more sophisticated service than TCP can provide.
•
UDP is a message-oriented protocol — Message boundary is preserved — Messages are independent from one another — Unreliable
•
TCP is a byte-oriented protocol — Message boundary is not preserved — Provide reliable service, congestion control, and flow control
•
Topics discussed in this section: SCTP Services and Features Packet Format An SCTP Association Flow Control and Error Control
78
SCTP is a reliable message-oriented protocol — Message boundary is preserved — Provide reliable service, in-order delivery, congestion control, and flow control
79
80
Table 23.4 Some SCTP applications
Figure 23.27 Multiple-stream concept
•
Each connection can have multiple streams — If one is blocked, others streams can still deliver data
81
An association in SCTP can involve multiple streams.
82
SCTP Services
Figure 23.28 Multihoming concept
• • • • • •
— SCTP connection is called association
Each end can have multiple IP addresses — When one path fails, another interface can be used without interruption — But only one can be active at any given time SCTP association allows multiple IP addresses for each end.
Process-to-process communication Multiple streams Multi-homing Full-duplex communication Connection-oriented service
83
•
Reliable service
84
SCTP Identification Numbers
SCTP Packet and Data Chunk
•
•
Transmission Sequence Number (TSN) — Identify unit of data (data chunk) — Similar role as TCP sequence number
•
Stream Identifier (SI) — Identify each stream in an association
•
Stream Sequence Number (SSN)
Data are carried as data chunk — Each data chunk always carries TSN, SI, and SSN
• • •
— Maintain in-order delivery for each stream
Control information is carried as control chunk Several control and data chunks can be packed together in a packet SCTP packet plays the same role as TCP segment
In SCTP, a data chunk is numbered using a TSN.
TCP has segments; SCTP has packets.
To distinguish between different streams, SCTP uses an SI. To distinguish between different data chunks belonging to the same stream, SCTP uses SSNs. 85
Figure 23.29 Comparison between a TCP segment and an SCTP packet
86
SCTP Packet Headers •
Each end point can have multiple IP addresses — Need verification tag to identify a unique end point •
•
That can have multiple IP addresses
Each data chunk carries TSN, SI, and SSN — Carry user data
• •
What is the difference between TCP and SCTP?
In SCTP, control information and data information are carried in separate chunks. 87
Control chunk does not use TSN, SI, or SSN — Control and maintain association
88
SCTP Example Packets Transmission •
Figure 23.30 Packet, data chunks, and streams
If we want to send 11 messages in 3 streams — 4 messages in the first stream — 3 messages in the second stream — 4 messages in the third stream
•
Assuming that — Each message fits into 1 data chunk — Messages in the first stream are delivered first, then those in the second and third streams respectively
• •
Data chunk is identified by three items: TSN, SI, and SSN TSN is a cumulative number identifying the association — Cumulative in all streams — Use for flow and error control
89
SCTP Acknowledgement •
• •
SI defines the stream SSN defines the chunk order within a stream
90
Figure 23.31 SCTP packet format
Acknowledgement number are chunk-oriented — Referring to TSN
•
Control chunk is acknowledged by another corresponding control chunk — Some control chunks need no acknowledgement In SCTP, acknowledgment numbers are used to acknowledge only data chunks; control chunks are acknowledged by other control chunks if necessary.
In an SCTP packet, control chunks come before data chunks. 91
92
Table 23.5 Chunks
Figure 23.32 General header
•
Verification tag is a number that matches packet to an association — Prevent packets from previous association from interfering — Also serves as an identifier for the association
A connection in SCTP is called an association to emphasize multihoming capability. 93
Figure 23.33 Four-way handshaking
94
SCTP Cookie • •
SCTP Association Establishment
Prevent SYNC flood attack in TCP Postpone resource allocation until the reception of the third packet — IP address of the sender is verified in the 3rd packet — Cookie is used to save information until this step
•
Cookie is generated with two sets of information — Information from the sender — Unique signature (or digest) of the first packet •
• No other chunk is allowed in a packet carrying an INIT or INIT ACK chunk
A COOKIE ECHO or a COOKIE ACK chunk can carry data chunks.
95
Usually base on secret key that only the creator will know
If the same cookie is received in the third packet, IP address of the requester would already been verified 96
SCTP Data Transfer •
Figure 23.34 Simple data transfer
SCTP recognize and maintain message boundary — Unlike TCP — Each message is treated as one unit and inserted into one or more DATA chunk • •
In SCTP, only DATA chunks consume TSNs; DATA chunks are the only chunks that are acknowledged.
Depending if fragmentation is required (message size exceeds path MTU) Each chunk has its own TSN
— Unlike UDP, relationship between DATA chunk is also maintained
•
Acknowledgement is based on the last in-order TSN received
The acknowledgment in SCTP defines the cumulative TSN, the TSN of the last data chunk received in order.
— And not the next expected segment as in TCP — Selective ACK (SACK) is only transmitted once 97
98
SCTP Flow Control
Figure 23.35 Association termination
• •
Still bases on byte-oriented window like TCP Receiver maintains three variables — cumTSN holds the last TSN received •
To be used in SACK transmission to the sender
— winSize holds available buffer size •
To be announced to the sender
— lastACK hold the last cumulative acknowledgement transmitted •
•
•
To decide if a new SACK should be sent
Sender maintains three variables — curTSN refers to the next chunk to be sent — Rwnd holds the last announced receiver winSize value — inTransit refers to bytes sent but not yet acknowledged
SCTP does not allow a half-close situation 99
100
Figure 23.36 Flow control, receiver site
Figure 23.37 Flow control, sender site
• • • • •
Assuming that one chunk = 100 bytes Data received -> update winSize & cumTSN Data delivered to process -> update winSize SACK sent -> update lastACK and announce cumTSN & winSize
New chunk pointed to by curTSN can be sent if that chunk is not greater than rwnd – inTransit — curTSN and inTransit values are updated after transmission
•
inTransit and rwnd values are updated after SACK is received
101
Figure 23.38 Flow control scenario
102
Figure 23.39 Error control, receiver site
•
Duplicate messages are discarded — But such information is tracked and reported to sender
•
An array of variables keep track of out-of-order block — The beginning and end of each out-of-order block
103
•
Receiver state will be reported in SACK chunk
104
Figure 23.40 Error control, sender site
•
Need two queues, sending and retransmission — Retransmission queue is transmitted before regular queue
•
Retransmission timer is started after each packet transmission
105