DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols
Download ReportTranscript DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols
DCN286 INTRODUCTION TO DATA COMMUNICATION TECHNOLOGY TCP/IP Transport and Application protocols TCP/IP model Data unit ISO/OSI Layer Description DoD Model Layer Data Application Network processes to applications Application Presentation Data representation and encryption Session Interhost communication Segment Transport End to end connection Transport Packet Network Logical address and best routing path Internetwork Frame Data Link Physical addressing Network Interface Bit Physical Binary transmission TCP and UDP The two important Transport layer protocols: They help to transfer data from one application process on one computer to the correct application process on another computer. TCP (Transmission Control Protocol) Connection-oriented protocol, more reliable and slower. UDP (User Datagram Protocol) Connection-less, faster, simpler and not reliable (no error checking). TCP and UDP comparison Features Flow control and windowing TCP UDP Yes No Connection-oriented Yes No Error recovery Yes No Segmentation and reassembly of data Yes No In-order delivery of data Yes No Identifying application using port numbers Yes Yes To use TCP or UDP (optional) Protocol TCP TCP TCP TCP TCP, UDP UDP TCP TCP UDP UDP Application FTP data FTP Control Telnet SMTP DNS TFTP HTTP (web) POP3 SNMP RIP Flow Control Receiver needs time to process data and inform sender how fast the data could be sent to it. Two methods to control flow: *Dynamic sliding windows **Withholding acknowledgments Dynamic Sliding Windows 1. Receiver advises window (size of data limit) 2. Sender keeps sending data until the limit. Stop and wait for ACK. 3. Receiver processed data and sent ACK and next window value to sender. 4. Sender starts sending data until reach the limit. Then, wait for ACK and next window value. Withholding Acknowledgments Another option of receiver is wait to send ACK. 1. Receiver informs sender the window size. 2. Sender keeps sending data until limit of window. 3. Receiver only sends out ACK after complete the processing 4. Sender receives ACK and window size and starts next round sending. Window The max value of data sender can send before an acknowledgment. TCP Three way handshake 1. First segment has a SYN flag but does not have the ACK flag set. (SYN=1 and ACK=0) 2. The second has both SYN and ACK set 3. The third and ongoing segment have only ACK TCP error recovery (reliability) TCP acknowledges the receipt of data by the Acknowledgment Number filed of the TCP header. It identifies the next byte expected to be received. NOT the last byte received. Sender 1000 1002 1003 Receiver Sender 1001 Receiver (because received 1000) Segmentation TCP received data from application protocols and break them into small pieces for transmission. TCP header is put in front of each chunk. Maximum Segment Size (MSS) : max length of TCP data filed. Ethernet frames allow 1500 data bytes in data field. TCP and IP header are 20 bytes each. 1460 is the MSS in Ethernet Reassembly and in-order delivery In-order delivery: Sent by sequence. Reassembly: according to the SEQ number. Receiver may temporary store segments into memory and wait for other segments for reassembly by sequence. TCP and UDP header TCP header 2 bits 2 4 4 4 6 6 2 2 2 3 1 Source port Dest. Port Seq Number Ack Number Offset Reserved Flags Window Size Chec k sum Urgent Options PAD UDP header 2 Source Port 2 Dest Port 2 Length 2 Checksum Port number Application may use multiple port numbers in the same time. A unique port number is needed for each TCP or UDP connection. Such port numbers are dynamic port number. A host can dynamic allocate 1024 (2^10) to 65,535 (2^16) port numbers Uses of port number Type of port Dynamic Range of port Purpose number value 49,152Allocated by client for each 65,535 new application process Well-known 0-1023 Registered 1024-49,151 For high privilege processes, used so that all clients know the correct port number Equivalent to Well-known port, but for nonprivileged application process. Well-known ports Port number 20 21 23 25 53 69 80 110 161 520 Protocol TCP TCP TCP TCP TCP, UDP UDP TCP TCP UDP UDP Application FTP data FTP Control Telnet SMTP DNS TFTP HTTP (web) POP3 SNMP RIP Application layer In DoD model, application layer, application protocols define the format of the data being transferred (such as binary or ASCII text); encryption and the rules for transferring data. In ISO/OSI model, application layer is only responsible for application interface. Encryption is in Presentation layer which is also responsible for data representation. Session layer is to combine message communication between hosts. DNS (Domain Name Service) Tranlate between Full Qualified Domain Name and IP address. Domain name is in human language such as www.cisco.com and IP address is in the numbering format. Top level domain could be in 3 categories: 1. Tradition: .com, .net, .edu, .gov, .mil, .org 2. Country code: ck, uk, jp, pl, ru, etc, etc. 3. New released: .info, .aero, .museum, .name, .coop, .biz, .pro. HTTP (Hypertext Transfer Protocol) Application layer protocol Distribute, collaborate and retrieve inter-linked resource from web pages Default port is 80 (*could use different port) Typical requests: Head: asks for the meta-information Get: requests a representation of the specified resource. Post: submit data to be processed Put: Uploads a representation of the specified resource. Delete: Deletes the specified resource. Trace: echoes back the received request Options: returns the HTTP methods that the server supports for specified URL HTTPS (Hypertext Transfer Protocol Secure) (Optional) HTTPS is a combination of the HTTP and a network security protocol HTTPS has also been known as "Hypertext Transfer Protocol over Secure Socket Layer", but now HTTPS may be secured by the Transport Layer Security (TLS) instead of Secure Sockets Layer (SSL) protocol. An https: URL may specify a TCP port. If it does not, the connection uses port 443 (unsecured HTTP typically uses port 80) HTML, DHTML and XML (Optional) HTML (HyperText Markup Language): the predominant markup language for Web pages. DHTML (Dynamic HyperText Markup Language): is a collection of technologies used together to create interactive and animated web sites by using a combination of a static markup language (such as HTML), a client-side scripting language (such as JavaScript), a presentation definition language (such as CSS), and the Document Object Model. XML (Extensible Markup Language): is a generalpurpose specification for creating custom markup languages. It can perfectly present shared structured data. Sample code of HTML (optional) Sample html code: <!DOCTYPE html> <html> <head> <title>Title bar display</title> </head> <body> <p>Hello This is my page!!</p> </body> </html> Web server (optional) The web server is to Host web pages Answer HTTP requests Logging clients visits Offer authentication if it is required Bandwidth throttling Could be running on Windows IIS or Unix/Linux system Web client and browser (optional) Web clients are using browser to display and interact with text, images, videos, music, games and other information typically located on a Web page at a Web site on the World Wide Web or a local area network. Typical browsers: Internet Explorer, Opera, Mozilla Firefox, Safari, Avant Browser Maxthon, AOL Explorer E-Mail protocols: SMTP, POP3 and IMAP SMTP (Simple Mail Transfer Protocol) is an Internet standard for electronic mail (e-mail) transmission across Internet Protocol (IP) networks. POP3 (Post Office Protocol version 3) is an application-layer Internet standard protocol used by local e-mail clients to retrieve e-mail from a remote server over a TCP/IP connection. Internet Message Access Protocol (commonly known as IMAP or IMAP4, and previously called Internet Mail Access Protocol, Interactive Mail Access Protocol and Interim Mail Access Protocol is an application layer Internet protocol operating on port 143 that allows a local client to access email on a remote server. Email access (optional) Web mail (hotmail, yahoo, gmail, and exchange web access) Outlook Outlook express Telnet Blackberry (BIS and BES) Many freeware: courier, Eudora, Foxmail, Opera Mail, Window Live Mail, etc, etc. telnet smtp.example.com 25 (optional) S: 220 smtp.example.com ESMTP Postfix C: HELO relay.example.org S: 250 Hello relay.example.org, I am glad to meet you C: MAIL FROM:<[email protected]> S: 250 Ok C: RCPT TO:<[email protected]> S: 250 Ok C: DATA S: 354 End data with <CR><LF>.<CR><LF> C: From: "Bob Example" <[email protected]> C: To: Alice Example <[email protected]> C: Date: Tue, 15 Jan 2008 16:02:43 -0500 C: Subject: Test message C: C: Hello Alice. C: This is a test message with 5 headers and 4 lines in the body. C: Your friend, C: Bob C: . S: 250 Ok: queued as 12345 C: QUIT S: 221 Bye {The server closes the connection} File transfer application protocols HTML can also be used to transfer files TFTP: is faster and using UDP port 69 FTP: support authentication and using TCP port 20 and 21 FTP (TFTP) server hosts the files and documents in a structured directory tree. Client uses various programs to get, upload files and documents. The programs could be SmartFTP, FileZilla, CuteFTP, WISE-FTP, etc, etc. Telnet Telnet is a network protocol used on the Internet or local area networks The term telnet also refers to software which implements the client part of the protocol. Telnet clients are available for virtually all computer platforms. (Start Run “cmd” telnet /?) The client-server protocol is using TCP port 23 by default. And it does not encrypt any data sent over the connection (including the password). Thus, all information can be captured by network sniffer. SSH (optional) Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. SSH was designed as a replacement for TELNET which is an insecure remote shells and transfer password in clear text format. SNMP (Simple Network Management Protocol) An SNMP-managed network consists of three key components: Managed devices (a computer or a network host such as router and switch) Agents (software running in the managed devices) Network-management station (central management work station in which application server is executed) It is possible to configure a Cisco router as a SNMP server What is the Network address of 172.16.132.70/20? Another Example of Network Address 172.16.4.35/27 Host Address Binary Host Address Binary Subnet Mask Binary Network Address Network Address 172. 16. 4. 35 10101100 00010000 00000100 00100011 11111111 11111111 11111111 11100000 10101100 00010000 00000100 0010000 172. 16. 4. 32 Private IP address Just to remember Certain blocks are reserves as private IP address used in company / organization internal networks. More computers could have “unique” IP address in IPV4. Class Range of IP address Range of Network number Default network mask Total number of networks 1 A 10.0.0.0 – 10.255.255.255 10.0.0.0 – 10.0.0.0 /8 (255.0.0.0) B 172.16.0.0 – 172.31.255.255 172.16.0.0 – 172.31.255.255 /12 (255.240.0.0) 16 C 192.168.0.0 – 192.168.0.0 – /16 (255.255.0.0) 256 192.168.255.255 192.168.255.255 Thus, it is possible for many companies / organizations using same network address internally. (For instance, 10.10.10.10 could be used for computer Tom in company Apple and by computer Jerry in company Boss) But, again, the potential duplicated addresses are used internally. Class B table # of bit borrowed Subnet Mask # of Usable Subnets # of available Hosts .11000000.00000000 255.255.192.0 4 16,382 .11100000.00000000 255.255.224.0 8 8,190 .11110000.00000000 255.255.240.0 16 4,094 .11111000.00000000 255.255.248.0 32 2046 .11111100.00000000 255.255.252.0 64 1022 .11111110.00000000 255.255.254.0 128 510 .11111111.00000000 255.255.255.0 256 254 .11111111.10000000 255.255.255.128 512 126 .11111111.11000000 255.255.255.192 1024 62 .11111111.11100000 255.255.255.224 2048 30 .11111111.11110000 255.255.255.240 4096 14 .11111111.11111000 255.255.255.248 8192 6 .11111111.11111100 255.255.255.252 16384 2