Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 6 Transport Layer

Similar presentations


Presentation on theme: "Chapter 6 Transport Layer"— Presentation transcript:

1 Chapter 6 Transport Layer

2 Transport Service Services provided to the upper layers Goal
Provide efficient, reliable, and cost-effective services to its users (application/session layer processes) Transport entity Hardware/software within transport layer to do the work

3 The network, transport, and application layers
Logical Relationship The network, transport, and application layers

4 Transport vs. Network Layer
Network layer: logical communication between hosts Transport layer: logical communication between processes relies on, enhances, network layer services University analogy: 7 students sending letters to 7 students processes = students app messages = letters in envelopes hosts = universities transport protocol = post office of universities network-layer protocol = postal service

5 State Diagram

6 Transport Service Primitives
The primitives for a simple transport service

7 The socket primitives for TCP
Berkeley Sockets The socket primitives for TCP

8 Transport Service Primitives
TPDU Transport protocol data unit Message transmitted between transport entities Nesting of TPDUs, packets, and frames.

9 Transport Service Primitives
Client-server example Client process Server process CONNECT LISTEN ACCEPT SEND RECEIVE RECEIVE SEND : : DISCONNECT DISCONNECT

10 Elements of Transport Protocols
Addressing Connection Request Connection Release Flow control and buffering Multiplexing

11 Addressing Which remote application process to connect to
Transport address Which process can listen for connection TSAP Transport service access point Internet: Port Usually multiple TSAP supported by transport entity NSAP Network service access point Internet: IP address One or more NSAP (e.g., host w/ more than one connections, router, etc.)

12 Addressing

13 Connection Establishment
Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Normal operation.

14 Connection Establishment
Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Old duplicate CONNECTION REQUEST appearing out of nowhere.

15 Connection Establishment
Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes CONNECTION REQUEST. Duplicate CONNECTION REQUEST and duplicate ACK

16 Abrupt disconnection with loss of data
Connection Release Abrupt disconnection with loss of data

17 Releasing a Connection
Three-way handshake + timers Fails when all DRs from source lost  Half-open connection Solution: If no TPDUs have arrived for a certain amount of time disconnect (DR –Disconnection Request) Timer needed Dummy TPDU might be needed to keep a connection alive

18 Connection Release Four protocol scenarios for releasing a connection. (a) Normal case of three-way handshake

19 Connection Release Four protocol scenarios for releasing a connection. (b) Final ACK lost.

20 Four protocol scenarios for releasing a connection. (c) Response lost
Connection Release Four protocol scenarios for releasing a connection. (c) Response lost

21 Connection Release Four protocol scenarios for releasing a connection. (d) Response lost and subsequent DRs lost.

22 Buffering

23 Similar to data link layer Sliding window protocols Difference
Flow Control Flow control Similar to data link layer Sliding window protocols Difference Host: numerous connections Router: a few lines

24 (a) Upward Multiplexing. (b) Downward multiplexing.

25 Multiplexing if only one network address is available on a host, all transport connections on that machine have to use it. This is called upward multiplexing. If a user needs more bandwidth than one virtual circuit can provide, a way out is to open multiple network connections and distribute the traffic among them on a round-robin basis. This is called downward multiplexing.

26 The Internet Transport Protocols: UDP
Introduction to UDP Remote Procedure Call Real-Time Transport

27 UDP (User Datagram Protocol)
Provides a way to send IP datagrams without establishing a connection A UDP segment has 8-byte header followed by data UDP length includes header and data UDP checksum includes the same format pseudoheader as in TCP

28 Steps in making a remote procedure call. The stubs are shaded.

29 Remote Procedure Call When a process on machine 1 calls a procedure on machine 2, the calling process on 1 is suspended and execution of the called procedure takes place on 2. Information can be transported from the caller to the callee in the parameters and can come back in the procedure result. No message passing is visible to the programmer. This technique is known as RPC (Remote Procedure Call). To call a remote procedure, the client program must be bound with a small library procedure, called the client stub, that represents the server procedure in the client's address space. Similarly, the server is bound with a procedure called the server stub.

30 Remote Procedure Call Step 1 is the client calling the client stub. This call is a local procedure call, with the parameters pushed onto the stack in the normal way. Step 2 is the client stub packing the parameters into a message and making a system call to send the message. (packing the parameters is called marshaling). Step 3 is the kernel sending the message from the client machine to the server machine. Step 4 is the kernel passing the incoming packet to the server stub. Finally, Step 5 is the server stub calling the server procedure with the un-marshaled parameters. The reply traces the same path in the other direction.

31 Real Time Transport Protocol (RTP)
Used to transport multimedia streams Can multiplex different streams such as the audio and video into a single UDP socket Each packet is given a unique increasing number No flow control, no error control, no acks,no retransmission mechanism Contains a payload type field to specify encoding that allows changing quality of the multimedia data when available bandwidth drops Contains timestamps that are used to synchronize streams. However, these timestamps are used to compute the relative time from the start rather than absolute time Has a sister protocol, Real Time Control Protocol (RTCP) that carries delay, jitter, bandwidth and congestion information for feedback purposes

32 Real-Time Transport(RTP)
(a) The position of RTP in the protocol stack. (b) Packet nesting.

33 RTP Header

34 RTP Header Ver-2 P-Indicates padding
X-indicates Extension Header present CC-Contributing Sources (0-15) M-Marker bit indicate start of audio/video Payload Type-Audio/Video Sequence number Time Stamp Synchronization Source Identifier Contributing Source Identifier

35 The Internet Transport Protocols: TCP
Introduction to TCP The TCP service model The TCP protocol The TCP segment header TCP connection establishment TCP connection release TCP connection management modeling TCP sliding window TCP timer management TCP congestion control

36 TCP Basic Functionality
Provides reliable end-to-end byte stream over an unreliable internetwork Transport entity A piece of software that is either A user process or Part of kernel Accepts user data streams from local processes Breaks them into pieces not exceeding 64K bytes Send each piece as an IP datagram At the receiver, it reconstructs original byte streams

37 The TCP Service Model The sender and receiver create end points called sockets Each socket has IP address Port number (16 bit and local) A socket may be used for multiple connections at the same time Some port numbers are reserved FTP: 21 Telnet: 23

38 The TCP Service Model Some assigned ports. Port Protocol Use 21 FTP
File transfer 23 Telnet Remote login 25 SMTP 69 TFTP Trivial File Transfer Protocol 79 Finger Lookup info about a user 80 HTTP World Wide Web 110 POP-3 Remote access 119 NNTP USENET news

39 The TCP Service Model (a) Four 512-byte segments sent as separate IP datagrams. (b) The 2048 bytes of data delivered to the application in a single READ CALL. A TCP connection is a byte stream, not a message stream Message boundaries are not preserved end to end

40 The TCP Protocol Every byte on a TCP connection has its own 32-bit sequence number to be used for acks and sliding window sequencing Window mechanism has its own 32-bit header Data is exchanged in form of segments A segment consists of a 20-byte header and zero or more bytes A segment must fit into a IP payload (65635 bytes) or Maximum Transfer Unit, MTU of the underlying network (further segmentation is a major problem) Sliding window acks next expected sequence number

41 The TCP Segment Header TCP header length in 32 bit words, URG-urgent,
ACK- ack number is valid, PSH-push, RST-reset connection, SYN-used to establish connection, FIN-used to release connection

42 The TCP Segment Header (2)
The pseudoheader (part of the IP header) included in the TCP checksum.

43 TCP Options Some TCP options are:
Maximum segment size (MSS): Specified what is the payload the sender is able to receive. (Default MSS = 536 bytes, i.e., Segment size = MSS + 20). SMSS/RMSS is Sender/Receiver MSS. Window scale: The window size field allows for upto 2^16 bytes of data. But this might be inefficient for high bw x delay situations. This options TCP indicate a scaling factor. Negative acknowledgement: Lets receiver user NAKs to get realize selective repeat rather than the normal go-back-N TCP behaviour.

44 TCP Connection Establishment
6-31 (a) TCP connection establishment in the normal case. (b) Call collision.

45 TCP Connection Release
Each side releases the connection independently. If A send a FIN to B and B ACKs that FIN. It only means no data will flow from A to B. Data can still flow from B to A indefinitely. In all 4 messages are required to completely release the connection. A FIN and ACK for each side. However, the second FIN and the first ACK can be combined for 3 messages.

46 TCP Connection Management Modeling

47 TCP Connection Management Finite state machine
The heavy solid line is the normal path for a client. The heavy dashed line is the normal path for a server. The light lines are unusual events. Each transition is labeled by the event causing it and the action resulting from it, separated by a slash.

48 TCP Transmission Policy
Sliding Window management in TCP.

49 TCP Transmission Policy
Sender TCP is not required to send data as soon as it arrives from the application. Sender TCP might buffer to create larger segments (up to receiver window size) Receiver TCP is not required to send ACK as soon as receives a segment. Receiver might delay ACK for up to 500 msecs hoping to piggyback ACK on data from receiver to sender. Such ACKS are called delayed ACKs

50 Silly window syndrome

51 Nagle's algorithm If application data comes in byte by byte, send first byte only. Then buffer all application data till until ACK for first byte comes in. If network is slow and application is fast, the second segment will contain a lot of data. Send second segment and buffer all data till ACK for second segment comes in. This way the algorithm prevents sending several one byte segments back to back.

52 TCP Congestion Control
(a) A fast network feeding a low capacity receiver. (b) A slow network feeding a high-capacity receiver.

53 TCP congestion control
In essence TCP deals with two potential problems separately: Problem Solution Receiver capacity Receiver window (rwnd) Network capacity Congestion window (cwnd) Each window reflect the number of bytes the sender may transmit. The sender sends the minimum of these two sizes. This size is the effective window. Effective window is the minimum of what the sender thinks is all right to send (congestion window) and what the receiver this is ok to send (receiver window). We assume that both rwnd and cwnd are measured in bytes.

54 TCP Timer Management Of the several timers TCP maintains the most important is the ReTransmission timer RTO, (also called timeout) . After each segment is sent, TCP starts a retransmission timer, if ACK arrives before timer expires, cancel timer. If timer expires first, consider segment lost. How long should RTO be ? Typically some small multiple of RTT(Round Trip Time). So how to measure RTT ? Measure time between segment sent and ACK receiver. Unfortunately, in the Internet RTT is not constant.


Download ppt "Chapter 6 Transport Layer"

Similar presentations


Ads by Google