28
The Transport Layer

The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Embed Size (px)

Citation preview

Page 1: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

The Transport Layer

Page 2: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

The Transport Service

• Services provided to the application layer by using the network layer service

• Transport header of a segment exchanged between two users is not read by routers and packet switches.

Page 3: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Transport Service

The nesting of TPDUs, packets, and frames.

Page 4: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Berkeley Sockets

The socket primitives for TCP.

Page 5: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Elements of Transport Protocols

• Addressing

• Connection Establishment

• Connection Release

• Flow and Congestion Control

• Buffering

• Multiplexing, Demultiplexing

Page 6: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

UDP and TCP

• User Datagram Protocol (UDP) provides only of multiplexing/ demultiplexing of data exchange between different applications. It is connectionless service.

• Transmission Control Protocol (TCP) provides a reliable service to the applications. It is connection oriented service.

Page 7: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

UDP and TCP Addressing

• Whenever a UDP socket is created, an available or a specified port number is assigned to it.

• The UDP socket is determined only by the destination port number. The source port number serves as a return address.

• The TCP server application has a “welcoming socket” for accepting connection requests. When a client socket is created, a port number is assigned to it and a connection is requested.

• TCP server socket is determined by the source IP address, source port number, destination IP address, destination port number.

Page 8: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

The TCP Service Model

Some assigned ports.

Port Protocol Use21 FTP File transfer23 Telnet Remote login25 SMTP E-mail69 TFTP Trivial File Transfer Protocol79 Finger Lookup info about a user80 HTTP World Wide Web

110 POP-3 Remote e-mail access119 NNTP USENET news

Page 9: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

UDP Segment Header

The UDP header.

Page 10: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Real-Time Transport Protocol (RTP)

(a) The position of RTP in the protocol stack. (b) Packet nesting.

Page 11: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

RTP Header

The RTP header.

4B pad Add Hdr

Sources # Coding Type

Page 12: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Transport Control Protocol (TCP)

• TCP Connection Establishment• TCP Connection Release• TCP Connection Management Modeling• TCP Transmission Policy• TCP Flow and Congestion Control• TCP Timer Management

Page 13: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

The TCP Segment Header

TCP Header.

Page 14: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

The TCP Segment Header

The pseudoheader included in the TCP checksum.

Page 15: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Connection Establishment

(a) TCP connection establishment in the normal case.(b) Call collision.

6-31

Page 16: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Connection Management Modeling

CLOSED

ESTABLISHEDFIN_WAIT_2

TIME_WAITSYN_SENT

FIN_WAIT_1

Client starts TCP

Send SYN

Receive SYN & ACKSend ACK

Send FIN

Receive ACK

Receive FIN,Send ACK

Wait 30s

Page 17: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Connection Management Modeling

CLOSED

SYN_RCVDCLOSE_WAIT

LAST_ACKLISTEN

ESTABLISHED

Server application creates LISTEN socket

Receive SYN Send SYN & ACK

Receive ACK

Receive FINSend ACK

Send FIN

Receive ACK

Page 18: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Mechanisms

• TCP is a combination of Go Back N and Selective Repeat protocols.

• Receiver sends ack with the sequence number of the last received byte. It is cumulative, meaning that it acks all previously received segments.

• Sender keeps only the info about the first unack-ed segment, and retransmits the previous segment when it the timer expires or when it receives 3 identical ACKs.

• Receiver has buffer and may receive segments out of order.

Page 19: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP ACK Generation

• When a segment arrives in order and all previous data are acked, receiver waits for 500ms and sends ACK.

• When a segment arrives in order and there is one segment waiting for ACK, the ACK is sent immediately.

• When a segment arrives out of order, immediately send ACK with the next expected sequence number.

• Arrival of segment that fills the gap. Immediately send ACK.

Page 20: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Flow Control

• Processor of the receiver often handles multiple applications and tasks, so the speed of handling of a specific application is variable and limited.

• Receiver sends the receive window with each ACK, that specifies the empty space in the receiver buffer.

• Sender makes sure that the difference between the last byte sent and the last byte acked is smaller than the receive window, so that the receive buffer is not overflowed.

Page 21: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Transmission Policy

Window management in TCP.

Page 22: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Congestion Control

• When a timeout period expires, sender retransmits a packet, and timer is triggered again but it is set to twice the previous value. When a new segment is generated, or when ACK is received, the timer is set to the estimated timeout period.

• Window size (w) is initially set to 0 and threshold size (t) is set to some large value.

• When w<t, w grows exponentially fast (incremented by one whenever it receives ACK)-slow-start phase.

• When w>t, w grows linearly (roughly by 1 once per RTT).• When triple ACK occcurs, the t=w/2, w=t.• If timeout happens, t=w/2, w=1.

Page 23: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Congestion Control

• Sender must ensure that:

Last byte sent – Last byte ACKed ≤

min{Congestion Window, Received Window}

Page 24: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Congestion Control

An example of the Internet congestion algorithm.

Page 25: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Timer Management

(a) Probability density of ACK arrival times in the data link layer.

(b) Probability density of ACK arrival times for TCP.

Page 26: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Timeout Calculation

• Timeout is

Timeout=2RTT

where RTT is a round-trip time:

RTT=αRTT+(1-α)M, α=7/8• Alternatively timeout is:

Timeout = RTT+4xD

where D is estimated variance:

D=αD+(1-α)|RTT-M|

Page 27: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

TCP Versions

• TCP Reno• TCP Vegas is modification of Reno• TCP Tahoe is older version

Page 28: The Transport Layer. The Transport Service Services provided to the application layer by using the network layer service Transport header of a segment

Wireless TCP and UDP

Splitting a TCP connection into two connections.