290 likes | 346 Views
application transport network data link physical. application transport network data link physical. application transport network data link physical. The Transport Layer.
E N D
application transport network data link physical application transport network data link physical application transport network data link physical The Transport Layer This critical layer provides communications services directly to distributed processes running on different hosts.
data application transport network link physical network link physical application transport network link physical data application transport network link physical application transport network link physical TCP/IP Concepts – Data Flow
TCP control connection port 21 user agent TCP data connection port 20 mail server user agent FTP client FTP server SMTP File transfer mail server user agent SMTP http request PC running Explorer SMTP http response user agent mail server user agent http request Server running Apache Web Server http response user agent Email Mac running Navigator Web browsing TCP Applications
The transport level addressing • Network Service Access Point (NSAP): it is between the network and transport levels • Transport Service Access Point (Transport address, TSAP): it is between the transport and the application layers • Port Number = Application Selection Address (ASA)
Port • An abstraction, which is used by the transport protocols to take the difference among each addressee in a given host • The TCP/IP protocol identify the port with a small integer • The port equivalent to the Transport Selector (TSEL) in the transport layer of the OSI model
providelogical communication between application processes running on different hosts transport protocols run in end systems transport vs. network layer services: network layer: data transfer between end systems (hosts) transport layer: data transfer between processes Transport layer relies on and enhances network layer services application transport network data link physical application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical logical end-end transport Transport services and protocols
The source and destination port in the client-server communication
Recall: segment - unit of data exchanged between transport layer entities* aka TPDU: transport protocol data unit M M M M application transport network application transport network application transport network H n Multiplexing/demultiplexing Demultiplexing: delivering received segments to correct app layer processes receiver P3 P4 application-layer data segment header P1 P2 segment H t M segment *Note: Sometimes called a datagram for UDP.
multiplexing/demultiplexing: based on sender, receiver port numbers, IP addresses source, dest port #s in each segment recall: well-known port numbers for specific applications Multiplexing: Multiplexing/demultiplexing gathering data from multiple app processes, enveloping data with header (later used for demultiplexing) 32 bits source port # dest. port # other header fields application data (message) TCP/UDP segment format
Source IP: C Dest IP: B source port: x dest. port: 80 Source IP: C Dest IP: B source port: y dest. port: 80 Source IP: A Dest IP: B source port: x dest. port: 80 source port:23 dest. port: x source port: x dest. port: 23 Multiplexing/demultiplexing: examples Web client host C server B host A port use: simple telnet app Web server B Web client host A port use: Web server
The Most Frequently Used Internet Transport Protocols • Transmission Control Protocol (TCP) • User Datagram Protocol (UDP)
point-to-point: one sender, one receiver reliable, in-order byte steam: no “message boundaries” pipelined: TCP congestion and flow control set window size GBN “hybrid” send & receive buffers TCP: OverviewRFCs: 793, 1122, 1323, 2018, 2581 • full duplex data: • bi-directional data flow in same connection • MSS: maximum segment size • connection-oriented: • handshaking (exchange of control msgs) init’s sender, receiver state before data exchange • flow controlled: • sender will not overwhelm receiver
Transmission Control Protocol(TCP) • Connection-oriented • End-to-endreliability • Reliability: positive acknowledging • It is intended for use asa highly reliable host-to-host protocol between hosts in • packet-switched computer communication networks, and • ininterconnected systems of such networks • Flow control with sliding window • protocol-adaptation to: • round-trip time (RTT) or • available transmission velocity Protocol Layering:
ApplicationLevel Telnet FTP Voice ... ... TCP RTP ... ... Host Level GatewayLevel Internet Protocol & ICMP NetworkLevel Local Network Protocol Relation to other Protocols
User Datagram Protocol (UDP) • The UDP gives the transport mechanism with the possible smallest overhead • Connection-less • It carry out multiplexing/demultiplexing and error check, only • The delivery is not reliable • The delivery is not ordered
TCP/IP STACK PHYSICAL NETWORK Relation With Other Protocols Application Layer (SMTP, FTP, HTTP, etc) Transport Layer (TCP, UDP) Internet Layer (IP, ICMP, ARP) Network Interface Layer (Ethernet, X25, SLIP, PPP)
“best effort” service, UDP segments may be: lost delivered out of order to app connectionless: no handshaking between UDP sender, receiver each UDP segment handled independently of others Why is there a UDP? no connection establishment (which can add delay) simple: no connection state at sender, receiver small segment header no congestion control: UDP can blast away and send data as fast as desired UDP: User Datagram Protocol [RFC 768]
32 bits source port # dest port # Length, in bytes of UDP segment, including header checksum length Application data (message) UDP segment format UDP: more • often used for streaming multimedia apps • loss tolerant • rate sensitive • other UDP uses: • DNS • SNMP • reliable transfer over UDP: add reliability at application layer • application-specific error recover!
UDP-based Error Check • If sum of the whole 16-bit words of the received UDP datagram equals to FFFFh, the datagram is probably error free • Calculation of the control sum: • E.g. let the next 16-bit words: 0110111001110110 0010101010101010 0001111000101011 • Their sum: 1011011101001011 • (1st complement: all 0 are exchanged to 1 and vice versa) • So we get the control sum: 0100100010110100 • At the receiver side the sum of the whole 16-bit word plus the control sum (possible carry bit is eliminated): 1111111111111111=FFFFh • This error check is not very safe
Features of the Application of UDP • Small header overhead • Non-controlled sending speed • No connection establishing • No connection state • Lack of error control • Lack of congestion protection • Message carried by UDP restricted to 512 bytes, not counting the IP or UDP headers • Longer message are truncated
TCP service: connection-oriented: setup required between client, server reliable transport between sending and receiving process flow control: sender won’t overwhelm receiver congestion control: throttle sender when network overloaded does not provide: timing, minimum bandwidth guarantees UDP service: unreliable data transfer between sending and receiving process does not provide: connection setup, reliability, flow control, congestion control, timing, or bandwidth guarantee Q:Why is there a UDP? Services provided by Internet transport protocols