1 / 47

Room 817, Ho Sin Hang Engineering Building Email: pcwong@ie.cuhk.hk

Information Engineering in Society Chapter #2 : The Internet and TCP/IP Prof. P.C. Wong Department of Information Engineering The Chinese University of Hong Kong 2003. Room 817, Ho Sin Hang Engineering Building Email: pcwong@ie.cuhk.edu.hk URL: http://learning.hkedcity.net/ieg1001/.

adara-pugh
Télécharger la présentation

Room 817, Ho Sin Hang Engineering Building Email: pcwong@ie.cuhk.hk

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Information Engineering in Society Chapter #2 : The Internet and TCP/IP Prof. P.C. Wong Department of Information EngineeringThe Chinese University of Hong Kong2003 Room 817, Ho Sin Hang Engineering Building Email: pcwong@ie.cuhk.edu.hk URL: http://learning.hkedcity.net/ieg1001/

  2. What do you need to know? • Internet – a network of networks. • Protocol – data format, procedures for communications. • Internet hosts have domain names and IP addresses. • IP address – 4 byte represented by (n.n.n.n) • Information is carried by IP packets up to 64 Kbytes each. • IP packets are routed independently to the destination (packet switching) based on the IP address on the packet. • There are two common transport protocols – TCP and UDP. • TCP – connection oriented. • UDP – connectionless (datagram) • Applications (e.g., FTP) are run on top of TCP or UDP. Application data is put into TCP segments or UDP datagrams. • TCP and UDP data is put into IP packets for delivery.

  3. Outline • What is Internet? • How is Internet connected? • How to send data on the Internet? • How are Internet applications supported?

  4. What is Internet? Net 2 Servers Net 1 Net 3 Email Inter-Net – An interconnected network of networks

  5. Net 2 Net 1 Net 3 World-wide-web (www) An Overlay Network of Linked Web Documents http://www.ie.cuhk.edu.hk

  6. Internet Domains .COM – commercial .NET - network .GOV – government .EDU – education .ORG - organisation .MIL - military .BIZ - business .INFO - information .hk - hong kong .cn - china .tw – taiwan What about go.to? Top domains http://www.networksolutions.com Hong Kong domains http://www.hkdnr.net.hk www.hkcampus.net www.hkedcity.net

  7. Internet – the largest Wide Area Network Internet: A worldwide network of networks • 1. Initiated by Defense Advanced Research Projects Agency • ARPANET, later developed into the NSFnet • Connecting [Jul 2002] 162,128,493 hosts all over the world • The number still doubles every two year. Each host has a unique IP address. • 3. The protocol suite - TCP/IP (1973-4) • 4. Basic services - EMAIL, FTP, TELNET (1970) • 5. Popular applications - Web (1990), Video Streaming via RTSP(1998), Video Conferencing via H.323, and Voice over IP.

  8. “Cool” internet appliances IP picture frame http://www.ceiva.com/ Web-enabled toaster+weather forecaster World’s smallest web server http://www-ccs.cs.umass.edu/~shri/iPic.html

  9. Million of Hosts 800 717 700 600 500 300 million 400 319 300 200 151 100 39 0 1995 1998 2000 2005 Internet Connectivity Source: Computer Industry Almanac Inc

  10. millions of connected computing devices: hosts, end-systems PCs workstations, servers PDAs phones, toasters running network apps communication links fiber, copper, radio, satellite transmission rate = bandwidth routers: forward packets (chunks of data) router workstation server mobile local ISP regional ISP company network What’s the Internet: “nuts and bolts” view

  11. protocolscontrol sending, receiving of msgs e.g., TCP, IP, HTTP, FTP, PPP Internet: “network of networks” loosely hierarchical public Internet versus private intranet Internet standards RFC: Request for comments IETF: Internet Engineering Task Force What’s the Internet: “nuts and bolts” view router workstation server mobile local ISP regional ISP company network

  12. human protocols: “what’s the time?” “I have a question” introductions … specific msgs sent … specific actions taken when msgs received, or other events network protocols: machines rather than humans all communication activity in Internet governed by protocols What’s a protocol? Protocols define format, order of msgs sent and received among network entities, and actions taken on msg transmission, receipt

  13. a human protocol and a computer network protocol: TCP connection response Get http://www.awl.com/kurose-ross Got the time? 2:00 <file> time What’s a protocol? Hi TCP connection req Hi

  14. What do we do with the Internet? File Transfer Web Browsing Instant Messaging E-mail Servers

  15. Many more applications! • Peer-to-peer applications • Napster, Gnutella, Kazaa file exchange • Searching for ExtraTerrestrial Intelligence (SETI) • Audio & video streaming • Network games • On-line purchasing • Text messaging in PDAs, cell phones (SMS) • Voice-over-Internet • Online databases • eServices, eLearning, Telemedicine, etc.

  16. Who defines the Internet? http://www.ietf.org • Internet Engineering Task Force (IETF) • Develops and reviews specifications intended as Internet standards. • Role of Standards • Allows interoperability • Allows smaller companies to enter large markets • Results in increase rate of innovation and evolution of technology and standards • Request for Comment (RFC) • A formal Internet document concerning an Internet issue • State: maturity level of an RFC • Status: requirement level of an RFC

  17. Standardization Process

  18. How to connect to the Internet?

  19. Internet Connectivity • 撥號上網 (Dial-up Access) • 專線上網 (Leased Line Access) • 寬頻上網 (Broadband Access) Net 2 Net 1 ISP router ADSL Modem Cable Modem Ethernet Connection

  20. Media and Cabling – How to connect to a network? • Cable– allows you to connect devices • Connector– standard interfacefor making connections. Note: We need different cables & connectorsfor different links.

  21. What if the distance is too long? <100m Repeater Hub – multiple port repeater Signal regeneration uplink <100m <100m <100m <100m The signal is regenerated on all segments

  22. Switches and Hub Number of ports: 8/16/24/… Nature: Hub or Switch (access/core) Speed: 10/100/1Gbps Interfaces: Fiber/Copper Backplane bus: stackability Uplink: connecting to core switch Management: SNMP and web Others: redundant supply control console …

  23. Transmission with a LAN • Ethernet Transmissions • The address of a node as defined by its LAN. • The address in included in an Ethernet frame of data. • Ethernet uses a six-byte physical address which is imprinted on the network interface card (NIC)

  24. How can IP packet be sent on a local area network? Data is divided into frames. • 64-1518 bytes • Src address: 6 bytes • Dst address: 6 bytes

  25. How to send data on the Internet?

  26. Internet Addresses and Domains Ethernet addressing cannot be used across networks. magnet3.sth.hk 137.150.96.48 137.150.96.252 IGS2.STH.HK magnet2.pwh.hk 137.154.96.251 137.154.96.250 AGS.PWH.HK 137.148.96.47 137.148.96.252 adnet1 137.152.96.254 adnetpc0 T-1 137.152.96.253 IGS1.IE.CUHK.HK 137.189.96.252 137.189.96.131 137.189.96.37

  27. IP Addressing The Internet (IP) addressing. Each address is represented by4 bytes, denoting (1) Network address (2) Host address 202.45.183.1 11001010 00101101 10110111 00000001 Network-ID Host-ID Host address=0  the network, Host address=1s  broadcast.

  28. Internet Addresses Class 7 bits 24 bits (16777214) A netid hostid 0 14 bits 16 bits (65534) B netid hostid 1 0 21 bits 8 bits (254) hostid netid C 1 1 0 D 1 1 1 0 Multicast address E 1 1 1 1 Reserved for future use 0 CUHK : 137.189.X.X (dotted decimal notation) -> a Class B network 1st Octet netid hostid A 1 - 126 p q.r.s B 128 - 192 p.q r.s C 192 - 223 p.q.r s

  29. Subnet Addressing IP Address: 202.45.183.127 11001010 11001010 11001010 01111111 Subnet Mask: 255.255.255.240 11111111 11111111 11111111 11110000 Result subnet ID: 202.45.183.112 11001010 11001010 11001010 01110000 Subnet range 202.45.183.112-127 0000 – net ID, 1111 - broadcast

  30. Data is divided into small packets (IP packets) Switching Each packet is examined by a switch/router and forwarded to an output link. Routing The packet is targeted to the destination based on a certain routing path. Packet delivery on the Internet - Switching and Routing

  31. IP Packet Format 8 0 16 31 TOTAL LENGTH VERS HLEN SERVICE TYPE FRAGMENT OFFSET IDENTIFICATION FLAGS Packet Header HEADER CHECKSUM PROTOCOL TIME TO LIVE SOURCE IP ADDRESS DESTINATION IP ADDRESS IP OPTIONS (IF ANY) PADDING DATA Packet Data ... VERS: version HLEN: header length (32-bit words) TOTAL LENGTH: packet size (octets)

  32. How are IP packets routed in a network? magnet3.sth.hk Issues 1. Direct delivery vs. indirect delivery 2. Gateway selection 3. Routing table 4. Default routes 5. Host-Specific routes 137.150.96.48 (1) 137.150.96.252 magnet2.pwh.hk IGS2.STH.HK 137.154.96.251 (2) 137.154.96.250 AGS.PWH.HK 137.148.96.47 137.148.96.252 137.152.96.254 (3) adnetpc0 T-1 IP address with net_id routing 137.152.0.0 directly 137.154.0.0 directly 137.148.0.0 directly 137.150.0.0 137.154.96.250 137.189.0.0 137.152.96.254 137.152.96.253 IGS1.IE.CUHK.HK (4) 137.189.96.252 137.189.97.37 The Routing table for AGS.PWH.HK

  33. How are Internet applications supported?

  34. TCP and UDP? • TCP/IP : (Transmission Control Protocol/Internet Protocol) • It is a set of protocols developed and used in the ARPANET, supported by • the Defense Advanced Projects Research Agency (DARPA). • It supports two major services • a. Connectionless packet delivery service (UDP) • b. Reliable Stream Transport service (TCP) • It features • a. Network technology independence • b. Universal interconnection • c. End-to-end acknowledgments • d. Application protocol standards • Its major applications • a. e-mail (SMTP) • b. file transfer (FTP) • remote login (TELNET) • web (HTTP) router or gateway physical network

  35. TCP/IP Protocols and Applications FTP, TELNET, MAIL, Other Applications Application Application Application ports ICMP UDP TCP TCP - Transmission Control Protocol UDP - User Packet Protocol ICMP - Internet Control Message Protocol IP - Internet Protocol ARP - Address Resolution Protocol RARP - Reverse ARP SLIP - Serial Line Interface Protocol PPP - Point-to-point Protocol IP ARP, RARP Ethernet, FDDI, ATM, etc. PPP, SLIP

  36. Relationship of layers and addresses in TCP/IP Identify an Internet application Identify a Internet host Identify a LAN station

  37. TCP Port numbers Decimal Keyword Description Reserved TCP multiplexer Remote job entry Echo Discard Active users Daytime File transfer protocol-data File transfer protocol Terminal connection Simple mail transfer protocol Time Host name server Domain name server Finger Web server X.400 Mail Service X.400 Mail Sending Authentication Service UUCP Path Service USENET news transfer protocol NETBIOS session service -- TCPMUX RJE ECHO DISCARD USERS DAYTIME FTP-DATA FTP TELNET SMTP TIME NAMESERVER DOMAIN FINGER HTTP X400 X400SND AUTH UUCP-PATH NNTP NETBIOS-SSN 0 1 5 7 9 11 13 20 21 23 25 37 42 53 79 80 103 104 113 117 119 139

  38. TELNET client TELNET Client TELNET Server 208 21 1048 9 204 7 23 How can a server support multiple clients? TCP assigns some well-known ports for communications - server port defines the application. - client port defines the client. magnet1 137.189.96.31 iestp10 137.189.96.210 binding: 23-204 Solution: Connection is identified by a pair of end-points E.g., (137.189.96.31, 23) and (137.189.96,210, 204)

  39. Protocol Layering Header Transport data Packet Header Packet Data Area Frame Data Area Frame Header Application Transport Internet Interface Application Transport Internet Interface User Kernal datagram or transport segment Internet Interface packet H/W frame Physical network 1 Gateway G Physical network 1

  40. Internet Connection via TCP

  41. FTP: File Transfer Protocol Commands 3 or 4 bytes NVT ASCII w/wo arguments Replies 3-digit numbers, optional messages ASCII user at a terminal user interface user protocol interpreter 21 server protocol interpreter control connection user data transfer function 20 file system server data transfer function file system data connection Server Client

  42. FTP commands (NVT ASCII) Name Meaning ABOR LIST filelist PASS password PORT n1,n2,n3,...,n6 QUIT RETR filename STOR filename SYST TYPE type USER username abort previous FTP command and any data transfer list files or directory password on server client IP address (n1..n4) and port (n5x256+n6) logoff from server retrieve (get) a file store (put) a file server returns system type specify file type:A (for ascii) I (for image) username on server

  43. FTP commands and replies /data/staff/pcwong> ftp -d magnet1 Connected to magnet1. 220 magnet1 FTP server (SunOS 4.1) ready. Name (magnet1:pcwong): pcwong ---> USER pcwong 331 Password required for pcwong. Password: ---> PASS rachel41 230 User pcwong logged in. ftp> dir cantoni.1 ---> PORT 137,189,96,21,11,33 200 PORT command successful. ---> LIST cantoni.1 150 ASCII data connection for /bin/ls (137.189.96.21,2849) (0 bytes). -rw-r--r-- 1 pcwong staff 1953 Nov 10 18:16 cantoni.1 226 ASCII Transfer complete. remote: cantoni.1 65 bytes received in 0.11 seconds (0.56 Kbytes/s) ftp> get cantoni.1 ---> PORT 137,189,96,21,11,34 200 PORT command successful. ---> RETR cantoni.1 150 ASCII data connection for cantoni.1 (137.189.96.21,2850) (1953 bytes). 226 ASCII Transfer complete. local: cantoni.1 remote: cantoni.1 2009 bytes received in 0.051 seconds (39 Kbytes/s)

  44. How do protocols work together? Internet • User clicks on http://www.singtao.com/ • Ethereal network analyzer captures all frames observed by its Ethernet NIC • Sequence of frames and contents of frame can be examined in detail down to individual bytes http://www.ethereal.com/

  45. Top Pane shows frame/packet sequence Middle Pane shows encapsulation for a given frame Bottom Pane shows hex & text

  46. What do you need to know? • Internet – a network of networks. • Protocol – data format, procedures for communications. • Internet hosts have domain names and IP addresses. • IP address – 4 byte represented by (n.n.n.n) • Information is carried by IP packets up to 64 Kbytes each. • IP packets are routed independently to the destination (packet switching) based on the IP address on the packet. • There are two common transport protocols – TCP and UDP. • TCP – connection oriented. • UDP – connectionless (datagram) • Applications (e.g., FTP) are run on top of TCP or UDP. Application data is put into TCP segments or UDP datagrams. • TCP and UDP data is put into IP packets for delivery.

  47. Thank You

More Related