multimedie- och kommunikationssystem föreläsning 11 kapitel 12: transportprotokoll....
TRANSCRIPT
Multimedie- och kommunikationssystem
Föreläsning 11
Kapitel 12: Transportprotokoll. Flödesstyrning och trafikstocknings
hantering. Sliding window.
Virtual Connection at the Transport Layer
TCP, UDP
IP
Application
Physical
IP
Physical
IP
Physical
Router RouterHost Host
TCP, UDP
IP
Application
Physical
Protocol stack in the host
Protocol stack in the host
Protocol stack in the router
Figure 22.5 Socket address
A socket is a data flow between two processes that is identified by its socket address pair, i.e. a unique combination of:- Transport protocol (UDP or TCP).- Source IP address and port number.- Destination IP address and port number.
Client-Server Paradigm
Used most often in Internet process-to-process communication, for example, email, web, file transfer, etc.
The client process initiates the communication.
The server process waits for the client to initiate communication, and responds by sending the information required. Example: Web server, email server, ftp server, etc.
A firewall often stops external clients from accessing internal servers, except certain web
Opposite: Peer-to-peer communication, where a program can act both as client (taking initiative) and server (responding to other).
User Datagram Protocol (UDP)
UDP is a connectionless, unreliable protocol that has no flow and error control.
No connection management. It solely provides a mechanism multiplexing data from
the application layer and demultiplexing at the receiver end by means of port numbers.
Use predominantly by protocols that do no require the strict service guarantees offered by TCP (e.g. real-time multimedia protocols).
It is also used for applications that provide flow and error control (e.g. LAN-services such as shared disk access)
Additional intelligence built at the application layer if needed.
Figure 12.20 (a) UDP header fields
The calculation of checksum and its inclusion in the user datagram are optional.
Table 22.1 Table 22.1 Well-known ports used by UDPWell-known ports used by UDP
Port Protocol Description
7 Echo Echoes a received datagram back to the 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
53 Nameserver Domain Name Service
67 Bootps Server port to download bootstrap information
68 Bootpc Client port to download bootstrap information
69 TFTP Trivial File Transfer Protocol
111 RPC Remote Procedure Call
123 NTP Network Time Protocol
161 SNMP Simple Network Management Protocol
162 SNMP Simple Network Management Protocol (trap)
Transmission Control protocol (TCP)
Provides a connection-oriented end-to-end (user-to-user) reliable byte stream service in both directions (full duplex)
Divides a byte stream into a sequence of segments and sends them to the destination via IP
Uses the destination port, source port to identify the application to which the segment is sent (multiplexing the sessions)
Uses sliding window like scheme for flow control and congestion control
Table 22.2 Table 22.2 Well-known ports used by TCPWell-known ports used by TCPPort Protocol Description
7 Echo Echoes a received datagram back to the 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)
21 FTP, Control File Transfer Protocol (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
111 RPC Remote Procedure Call
TCP Sliding Window
segment 1
100 bytes of data numbered from 1 to 100
100 bytes of data numbered from 101 to
200, ack 801
acknowledge 801segment 2
acknowledge 901segment 3
acknowledge 201segment 2
acknowledge 101segment 1
100 bytes of data numbered from 701 to
800, ack 101
100 bytes of data numbered from 801 to
900, ack 201
The bytes of data being transferred in each connection are numbered by TCP. 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::
Example 1Example 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?
SolutionSolution
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)
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::
Connection Management
Two way handshake protocol is not enough because of potential delays in either A’s request or B’s responce, as shown below. Possibility of confusion exists.
time time
t1A sends a connection request
t2
t5
t4
t3
A sends connection request again
B receives connection request B establishes a connection and sends an acknowledgement
A B
A receives the acknowledgement and establishes a connection
A and B exchange data and eventually disconnect
B receives connection request B establishes a connection and sends an acknowledgement
Three-way Handshake Protocol for Connection Establishment
time time
t1
A sends a connection request with seq. no. x
t2
t5
t4
t3
A sends connection request again with seq. no. y
B sends acknowledgement y+1 and seq. no. z
A B
A receives the acknowledgement y+1 and sends acknowledgement z+1
B sends acknowledgement x+1 and seq. no. w
A does not send an acknowledgement and no connection is established
t6
The connection is established
Connection Establishment and Termination
3-way handshake used for connection establishment
Randomly chosen sequence number is conveyed to the other end
Similar FIN, FIN+ACK exchange used for connection termination
SYN
SYN+ACK
ACK
DATA
Server does passive open
Accept connection requestSend acceptance
Start connection
Active openSend connectionrequest
The three-way handshake TCP segments are labeled with SYN. The length of data in the first two is 0
Figure 22.16 Three-step connection establishment
1) Request.2) Acknowledgement of the request.3) Acknowledgement of the acknowledgement.
Window Management in TCP
• Sliding window scheme is used with variable window○ The window can change depending on the traffic in the network
(TCP provides congestion control)
• The size of the window is expressed in bytes instead of packets
• The window size depends on the receiver’s capabilites and the congestion in the network
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.
NoteNote::
If the cause of the lost segment is congestion, retransmission of the
segment does not remove the cause—it aggravates it.
NoteNote::
23.6 Techniques to Improve QoS23.6 Techniques to Improve QoS
Scheduling
Traffic Shaping
Resource Reservation
Admission Control
A leaky bucket algorithm shapes bursty traffic into fixed-rate traffic by averaging the data rate. It may drop
the packets if the bucket is full.
NoteNote::
Figure 12.21 Real-time transport protocol (RTP) (a) usage
A protocol for real-time traffic; used in conjunction with UDP.
Figure 12.22 Real-time transport control protocol (RTCP) usage.
A companion protocol to RTP with messages that control the flow and quality of data and allow the recipient to send feedback to the source or sources.
Figure 9.28 QoS support mechanisms: (a) RSVP principles;
RSVP = Resource Reservation Protocol.A signalling protocol to help IP create a flow and improve QoS.Reserves resources in each router, for unicasting and multicasting traffic flows with guaranteed QoS.
DiffServ architecture.
DiffServ = Differentiated servicesA class-based QoS model.Flows are aggregated into service classes.The IP header Type-of-service fieldis replaced by a DiffServ field.
CR = core routerI/ER = ingress/egress routerMF = multifieldBA = behavior aggregatePHB = per-hop behavior
Service classes
CBR = Constant Bit RateVBR = Variable Bit RateABR = Available Bit RateUBR = Unspecified Bit Rate (best-effort)