310 likes | 482 Views
Chapter 9. TCP/IP. TCP/IP . Protocol suite Controlling networking activities From Network layer to Application layer IP: Network layer protocol TCP, UDP, ICMP, IGMP: Session layer and Transport layer protocols HTTP, FTP: Application and Presentation layer protocols. TCP/IP .
E N D
Chapter 9 TCP/IP
TCP/IP • Protocol suite • Controlling networking activities • From Network layer to Application layer • IP: Network layer protocol • TCP, UDP, ICMP, IGMP: Session layer and Transport layer protocols • HTTP, FTP: Application and Presentation layer protocols
TCP/IP • TCP, UDP, ICMP, IGMP: Session layer and Transport layer protocols • Classified into: • Connection oriented protocols • Connectionless protocols
Communication Mode • Connection-oriented communication • Establishing a connection (a session) between two computers before transferring the information • More reliable than the connectionless • Connectionless communication • Not establishing a connection (a session) between two computers before transferring the information
TCP • Connection-oriented communication • Transferring multiple packets (information is broken into pieces) • Establishing a session (three way handshake): • A sends SYN (synchronize) packet to B • B replies by sending SYN and ACK (acknowledge) packet to A • A replies by sending ACK packet to B
TCP (cont.) • Data transfer: • B sends packet 1 to A • A replies by sending ACK packet to B • B sends packet 2 to A • A replies by sending ACK packet to B • … • If B does not receive ACK, B will resend the packet • Terminating a session (three way handshake): • B sends FIN (finished) packet to A • A replies by sending FIN and ACK packet to B • B replies by sending ACK packet to A
TCP • Used with a lot of TCP/IP applications • HTTP: Web server and Web client • FTP: FTP server and FTP client
UDP • Connectionless • Transferring multiple packets (information is broken into pieces) • Used with DHCP server and DHCP client
ICMP • Connectionless • Transferring a single packet (the information is transmitted as a whole, not broken into pieces) • Used with PING application and TRACEROUTE application
IGMP • Connectionless • Controlling IP multicasting (i.e., the transmission of a packet to all members of a multicast group)
Socket • Session: • Connection between two applications in two computers • The information about a session stored in a computer is called socket or endpoint • Socket is identified by using the port numbers of the two applications
Port Numbers • Identifying a certain TCP/IP application program • 16 bit or decimal value between 0 to 65,535 • 0 to 1023: Well-known port numbers • Identifying a certain TCP/IP server program • 80: generated by a Web client program for a Web server program (HTTP application program) • 443: generated by a secured Web client program for a secured Web server program (HTTPS application program) • 23: generated by a Telnet client program for a Telnet server program (Telnet application program)
Port Numbers • 1024-4915: Registered port numbers • Identifying less common TCP/IP applications • 49152-65535: Dynamic or private ports • Ephemeral port numbers: • Generated by a client • Attached to the packet sent to a server • To allow the response from the server to be forwarded back the client
Port Numbers • Open port or listening port: • A port that is prepared to respond to any packet destined for that port • Every server application has an open port
TCP/IP Applications • The World Wide Web (The WWW) • TCP/IP Applications • To exchange Web pages (written with HTML, XHTML) and other information (e.g., sound, image, video)
TCP/IP Applications • The World Wide Web (The WWW) • Consisting of: • Web servers • Sharing Web pages and other information • Running a Web server program, e.g., Apache, IIS • Web clients • Requesting and opening Web pages and other information • Running a Web client program, e.g., Internet Explorer, Firefox, Chrome • Connected to the Internet
TCP/IP Applications • The World Wide Web (The WWW) • HTTP • Port 80 • HTTPS • Port 443 • Using SSL to encrypt data before releasing it to the Internet • https://www.abc.com
TCP/IP Applications • Telnet • Connecting remotely to another computer (e.g., a server) via the command line (text-based) enabling you to control that computer as if you were sitting in from of it – terminal emulation/remote terminal • Port 23 • Data are not encrypted • Telnet server: a computer to be controlled • Telnet client: a computer you use to control the Telnet server
TCP/IP Applications • Secure SHell (SSH) • Similar to Telnet • Data are encrypted • Port 22
TCP/IP Applications • E-mail • Sending and receiving messages and attachments • Email client: • Sending outgoing messages to an email server, downloading incoming messages from an email server • Microsoft Outlook, Mozilla Thunderbird • Email server: • Receiving outgoing message from an email client, storing messages, uploading incoming messages to an email client • Sendmail, Microsoft Exchange Server
TCP/IP Applications • E-mail • SMTP: • Protocol to send outgoing message (from SMTP client in the email client to SMTP server in the email server; from SMTP server in one email server to SMTP server in another email server) • Port 25
TCP/IP Applications • SMTP:
TCP/IP Applications • E-mail • POP3: • Protocol to download incoming message (from SMTP server in the email server to POP3 server in the email server to POP3 client in the email client) • Port 110 • IMAP4: • Protocol to download incoming message (from SMTP server in the email server to IMAP4 server in the email server to IMAP4 client in the email client) • Port 143
TCP/IP Applications • POP/IMAP:
TCP/IP Applications • POP3 versus IMAP4 • POP3: • Downloading the email messages to your local computer and removing it from the server • Because your email messages are downloaded and removed from the server, you can only access it from one computer • IMAP4: • Downloading but not removing • As your email messages stay in the server, you can access them from multiple computers
TCP/IP Applications • FTP • Transferring file • FTP client: • Sending file to FTP server • Retrieving file from FTP server • FTP server: • Receiving file from FTP client • Storing file • Sending file to FTP client • Port 20 and 21
TCP/IP Applications • FTP • Active transfer • The original setting • The server sends the data by using port 20, not the ephemeral port number sent by client • Cannot be used in NAT-network • Passive transfer • The server sends the data by using the ephemeral port number sent by client • Used in NAT-network