Matakuliah Tahun Versi : H0174/Jaringan Komputer : 2006 : 1/0 Pertemuan 23 Layer Transport 1 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • Menjelaskan fungsi Transport Layer 2 Outline Materi • TCP • UDP 3 Transport layer duties 4 Addressing • TCP uses the concept of source and destination port numbers which uniquely identify a particular communicating process on a host. • Port numbers • Well known port numbers (defined by IANA) • Server applications run by privileged users to communicate on these ports (0 – 1023) Registered ports (1024 - 49151) Administratively assigned to some specific applications. Private ports/Ephemereal (49152 - 65535) application associated with them. Used by applications that are ephemeral in nature 5 Well-Known Port Addresses • • • • • Port 80 – HTTP (web server) Port 25 – SMTP (mail server) Port 23 – Telnet Port 22 – SSH Port 110 – POP3 6 IP Addresses vs Port Numbers 7 Application Addressing • Target user specified by User identification called socket in TCP/IP • Consist of usually IP address (host), port • Port represents a particular transport service (TS) user – Transport entity identification • Generally only one per host • If more than one, then usually one of each type – Specify transport protocol (TCP, UDP) – Host address • An attached network device • In an internet, a global internet address 8 Socket address 9 Multiplexing • Multiple users employ same transport protocol • User identified by port number or service access point (SAP) • May also multiplex with respect to network services used 10 Transport Layer Protocol • Transmission Control Protocol – Connection oriented – RFC 793 • User Datagram Protocol (UDP) – Connectionless – RFC 768 11 Types of data deliveries The transport layer is responsible for processto-process delivery 12 TCP segment format 13 TCP Services • Reliable communication between pairs of processes • Across variety of reliable and unreliable networks and internets • Two labeling facilities – Data stream push • TCP user can require transmission of all data up to push flag • Receiver will deliver in same manner • Avoids waiting for full buffers – Urgent data signal • Indicates urgent data is upcoming in stream • User decides how to handle it 14 TCP Mechanisms • Connection establishment – Three way handshake – Between pairs of ports – One port can connect to multiple destinations 15 Connection Establishment 16 TCP Mechanisms • The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with a randomly generated number • The value of the sequence number field in a segment defines the number of the first data byte contained in that segment • 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. • Data transfer – Logical stream of octets, Octets numbered modulo 223 – Flow control by credit allocation of number of octets – Data buffered at transmitter and receiver 17 UDP • UDP is a connectionless, unreliable protocol that has no flow and error control • It uses port numbers to multiplex data from the application layer (e.g. network management) • Delivery and duplication control not guaranteed • Reduced overhead • UDP is a convenient transport-layer protocol for applications that provide flow and error control. It is also used by multimedia applications 18 User datagram format The calculation of checksum and its inclusion in the user datagram are optional 19 Matakuliah Tahun Versi : H0174/Jaringan Komputer : 2006 : 1/0 Pertemuan 24 Layer Application 20 Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • Menjelaskan peran Application Layer 21 Outline Materi • SMTP • HTTP 22 Electronic Mail • Most heavily used application on any network • Simple Mail Transfer Protocol (SMTP) – TCP/IP – Delivery of simple text messages • Multi-purpose Internet Mail Extension (MIME) – Delivery of other types of data – Voice, images, video clips 23 SMTP • RFC 821 • Not concerned with format of messages or data – Covered in RFC 822 (see later) • SMTP uses info written on envelope of mail – Message header • Does not look at contents – Message body • Except: – Standardize message character set to 7 bit ASCII – Add log info to start of message • Shows path taken 24 Basic Operation • Mail created by user agent program (mail client) – Message consists of: • Header containing recipient’s address and other info • Body containing user data • Messages queued and sent as input to SMTP sender program – Typically a server process (daemon on UNIX) 25 SMTP Sender • Takes message from queue • Transmits to proper destination host – Via SMTP transaction – Over one or more TCP connections to port 25 • Host may have multiple senders active • Host should be able to create receivers on demand • When delivery complete, sender deletes destination from list for that message • When all destinations processed, message is deleted 26 SMTP Receiver • Accepts arriving message • Places in user mailbox or copies to outgoing queue for forwarding • Receiver must: – Verify local mail destinations – Deal with errors • Transmission • Lack of disk space • Sender responsible for message until receiver confirm complete transfer – Indicates mail has arrived at host, not user 27 SMTP Mail Flow 28 Text Messages RFC 882 • Message viewed as having envelope and contents • Envelope contains information required to transmit and deliver message • Message is sequence of lines of text – Uses general memo framework – Header usually keyword followed by colon followed by arguments 29 MIME • Multipurpose Internet Mail Extension (MIME) Extension to RFC822 • SMTP can not transmit executables • Can not transmit text including international characters (e.g. â, å, ä, è, é, ê, ë) – Need 8 bit ASCII • Servers may reject mail over certain size • Translation between ASCII and EBCDIC not standard • SMTP gateways to X.400 can not handle none text data in X.400 messages • Some SMTP implementations do not adhere to standard – CRLF, truncate or wrap long lines, removal of white space, etc. 30 Overview of MIME • Five new message header fields – MIME version – Content type – Content transfer encoding – Content Id – Content Description • Number of content formats defines • Transfer encoding defined 31 HTTP • Hypertext Transfer Protocol • Underlying protocol of the World Wide Web • Not a protocol for transferring hypertext – For transmitting information with efficiency necessary for hypertext jumps • Can transfer plain text, hypertext, audio, images, and Internet accessible information 32 HTTP Overview • Transaction oriented client/server protocol • Usually between Web browser (clinet) and Web server • Uses TCP connections • Stateless – Each transaction treated independently – Each new TCP connection for each transaction – Terminate connection when transaction complete 33 Headers HTTP uses the services of TCP on well-known port 80 34 Retrieve Image 35 Distributed services 36 Browser architecture 37 Categories of Web documents 38 Static document 39 Dynamic document 40 Active document 41