Presentation is loading. Please wait.

Presentation is loading. Please wait.

ES 101-02. Module 4 Transport Layer Protocols. Last Lecture(s) Routing and IP Addressing Domain Name System.

Similar presentations


Presentation on theme: "ES 101-02. Module 4 Transport Layer Protocols. Last Lecture(s) Routing and IP Addressing Domain Name System."— Presentation transcript:

1 ES 101-02. Module 4 Transport Layer Protocols

2 Last Lecture(s) Routing and IP Addressing Domain Name System

3 This Lecture Transport Layer Services User Datagram Protocol (UDP) Transmission Control Protocol (TCP)

4 Transport Layer Operation The transport layer interfaces to applications One application may have multiple simultaneous interfaces to remote clients for a given application –Web servers, ftp servers, etc. The converse is also true, ie. the server may support multiple applications to one or more clients The application provides the transport layer with “Protocol Data Units” or PDUs These PDUs are then segmented and encapsulated in a transport layer “segment” The transport layer segment is then encapsulated in IP, and on, and on…

5 Transport Layer Applications In order to understand the operation of the transport layer, Layer 4, we must first examine the requirements of this layer, and then go through some common scenarios for the TCP/IP protocol stack –The foundation for the operation of the Internet

6 TCP/IP Architecture HTTP UDP TCP Note: We have covered IP previously.

7 Transport Layer Services Type of Service Indicators Quality of Service Indicators Data Transfer Application Programing Interface (API) Connection Management Delivery Prioritization Status Reporting Security Multiplexing and demultiplexing

8 Transport Layer Services (cont’d) The performance of the transport layer must be discussed with respect to the underlying network layer –IP in the case of the Internet Two types of transport layer services are available: –Reliable, sequencing Transmission Control Protocol (TCP) –Unreliable, ie. no sequencing mechanism User Datagram Protocol (UDP)

9 Packet Switching Review Recall that the IP layer launches packets into the network, and “hopes for the best” This means that packets can arrive at the destination out of sequence, or get lost –Late packets that are OK upon arrival –Packets that get destroyed in transit due to “collisions” How can this happen? –Different routes –Packet “destruction” Note: In the TCP/IP world, packets are referred to as “datagrams”

10 Out of Order Datagram

11 Lost Datagram

12 Corruption of Packets by Routers

13 Consequences of Out-of-Sequence Transmission

14 Techniques for Reliability Connection-oriented transmission of packets Error Control –Error detection, ie. are packets damaged? Accomplished via Cyclic Redundancy Checking Header corruption Payload corruption –Error recovery NACK the bad or missing packets Retransmit the packet again This requires packet sequence numbers

15 Connection-Oriented Transmission A “session” is established between the client and server before data transmission is initiated –Connection Establishment During data transmission, packets are monitored for errors –This requires packet sequence numbers If data is lost, retransmission is requested At the conclusion of the session, the connection is closed –“Log off”

16 Error Control and Recovery Error control refers to the detection of errors in either the header, the payload, or both This is accomplished by a Cyclic Redundancy Check (CRC) algorithm –The CRC is calculated upon transmission and appended to the packet –The CRC is then re-calculated upon receipt of the packet If the CRC calculation does not match that which was appended upon transmission, the packet is assumed to be damaged, and is not processed further Re-transmission of the damaged packet is then requested

17 Requirements for Transmission over an Unreliable Network As stated previously, additional requirements are placed on the transport protocol if the underlying network is unreliable, and reliable transmission of data is required –Ordered Delivery –Retransmission Strategy –Duplicate Detection –Flow Control Results from congestion –Connection Establishment and Termination –Crash Recovery Layer 4 protocols may not implement all of these features

18 This Lecture Transport Layer Services User Datagram Protocol (UDP) Transmission Control Protocol (TCP)

19 User Datagram Protocol (UDP) Before we discuss TCP which is a connection-oriented, reliable, sequencing protocol, we will discuss UDP –Connectionless There is no connection establishment or termination –Error detection Header only, to prevent misrouted packets UDP is very efficient, and is widely used for applications that do not require reliability, but do require multiplexing –Identification of each communication link UDP is essentially IP with sockets But first, we must understand sockets…

20 UDP Application Example The Simple Network Management Protocol (SNMP) utilizes UDP SNMP consists of two parts: –Management station –Management Information Base (MIB) in all networked devices The devices send a “health” message to the management station at 10 second intervals Device health is displayed graphically to a network administrator in the Network Operations Center (NOC) If a device shows that it has failed, the NOC operator takes a corrective action Do we care if an update is lost or misordered?

21 UDP Overview Documented in RFC 768 Communication occurs via “ports” and “sockets” Unreliable delivery, ie. operates over IP –Connectionless service –Lost datagrams are possible –Out of sequence datagrams are possible Very efficient protocol –No connection establishment or closure –“Fire and forget” protocol

22 UDP Ports UDP essentially adds a port addressing capability to IP Each packet is tagged with unique source and destination identifiers known as a “ports” The combination of a port number and a device IP address is unique –This combination is known as a “socket” Different applications use different port values UDP Client/Server operation –Server listens passively –Client “knows” port numbers, and initiates (requests) information transfer –Server responds to client request

23 UDP Header

24 Multiplexing UDP accomplishes multiplexing/demultiplexing by keeping track of sockets at each end of the link Each connection is therefore uniquely identified This technique supports many concurrent connections –Interleaving of PDUs, ie. multiplexing

25 Multiplexing of Concurrent Applications

26 UDP Process Identification

27 Well Known UDP Ports

28 Socket Schematic

29 Checksum 16-bit “ones complement” –Includes information from the IP header, UDP header, data, and padding octets Must end up with an even number of octets A “pseudo-header” is pre-pended to the UDP header to calculate the checksum only for the UDP header –Avoids misrouting to the wrong process This information protects against misrouted datagrams –Header/address corruption

30 UDP Header

31 This Lecture Transport Layer Services User Datagram Protocol (UDP) Transmission Control Protocol (TCP)

32 Transmission Control Protocol Overview Documented in RFC 793 Why is TCP necessary? –UDP adds little reliability to the IP connectionless service TCP provides additional reliability over UDP –Error free –Assured delivery –In sequence packets, or segments –No duplication of segments So, what services does TCP provide?

33 TCP Services Multiplexing Connection-oriented –Connection establishment –Crash recovery –Connection termination Reliable –Sequence numbers provided –Mechanisms for error detection/recovery at the byte level Flow Control

34 Multiplexing TCP accomplishes multiplexing/demultiplexing by keeping track of ports and sockets at each end of the link This process is identical to the technique for UDP with the exception that many concurrent data “streams” must be supported

35 TCP Header

36 TCP Connections

37 TCP Connections (cont’d)

38 Well Known TCP Ports

39 Connection Establishment TCP clients must have a reliable way to “connect” to servers –This is done using a three-way handshake The server passively “listens” on a well known port A connection request is made when the client issues a “SYN” packet to the appropriate port number The server “connects” and then assigns a different port number for the session –There can be up to 2 16 concurrent sessions –This port is “open” until session termination, after which it can be reassigned

40 Connection Establishment (cont’d) TCP utilizes a three-way handshake To initiate a connection, the originator sets the SYN and Sequence Number (SN) fields in the TCP header –SN is set to the initial number of the first octet in the segment, SN = X The destination then responds with a TCP message (header) with the SYN and ACK bits set, SN = Y, and the Acknowledgement Number (AN) set equal to AN = X + 1 –This acknowledges the first SYN packet, and acknowledges that the next octet to be received is X+1

41 Connection Establishment (cont’d) The originator then responds with a message with the acknowledgement number set: –AN = Y + 1 –This is the last packet in the three way handshake –The connection is then established

42 Passive/Active Connection Request Three Way Handshake

43 Data Transfer After connection establishment, TCP transfers application data by packaging it in a TCP “segment”, or data packet Sequence numbers are indirectly provided for every octet (byte) in the segment When packets arrive at the destination, they are reassembled in the correct order –Missing and duplicate information is detected and corrected Sequence numbers are independent of each “flow”

44 TCP Header

45 Data Byte Numbering

46 Acknowledgement

47 Error Recovery

48 Data Sequence Numbers The TCP technique of providing sequence numbers that represent each octet in the segment allows detection of missed octets, assuming the CRC check is OK –Number of octets in a TCP message can be 2 32 –Each TCP header contains the sequence number of the first octet in the segment This sequence number cannot be repeated during the lifetime of the session transmission –Recall that each session can have different sequence numbers, since this is a connection-oriented approach 2 16 concurrent sessions

49 Checksum - TCP Operates in the same fashion as UDP –Header Only –Avoids misrouting to the wrong process However, when used in conjunction with the payload octet sequence numbering and error recovery, reliability of transmission is assured

50 Checksum – TCP

51 Flow Control Flow control is accomplished by using a credit allocation scheme The credit is equal to the number of octets in the “send window” –This is the total number of octets that can be outstanding (unacknowledged) before requiring an acknowledgement The credit allocation approach allows the destination device to adjust the origin transmission window –This essentially controls the “flow” in bytes/second that the sender can launch into the network Why is flow control necessary?

52 Buffer Overflows If a router or switch on the network receives more information than it can process per unit of time, it buffers the information until it can get to it If the network gets congested, the offered load is greater than the routers can buffer When this happens, the routers overwrite their buffers, causing the loss of data (packets) So, it is necessary for devices attached to the network to be able to “slow down” the transmission process

53 Flow Control Schematic

54 Crash Recovery Sometimes, the a device “stalls” or fails –This could be either the server, client, or the network When this happens, the other “party” to the conversation does not know what is going on –The receiver may be waiting forever to get the next chunk of information There must therefore be a mechanism to force the transmitter to respond –Are you still there? How is this done?

55 Push and Reset Flags This is accomplished via the Push and RST flags in the TCP header The push and reset flags are used to allow the originator to force data accumulated in the buffer to be sent –Allows use as an “end of block” flag If a segment is misrouted, the receiver sends a TCP header back with the RST flag set –Example: Delayed or duplicate SYNs

56 TCP Header SN AN ACKSYN

57 Closing the Connection When all data has been transmitted, it is necessary to close the connection Otherwise, all of the ports would eventually be used up –No further sessions could be established

58 Closing the Connection

59 Next Lecture(s) HTTP and URLs HTML Overview HTML Editors


Download ppt "ES 101-02. Module 4 Transport Layer Protocols. Last Lecture(s) Routing and IP Addressing Domain Name System."

Similar presentations


Ads by Google