Chapter 2 Networking and Internet 國立聯合大學 電子工程學系 蕭裕弘 Chapter Goals 說明資料通訊的基本觀念與電腦網路的主 要特性與用途 說明電腦網路的主要種類與特性 介紹三種常見的電腦網路圖形結構 介紹常見的通訊傳輸介質與其特性 介紹通訊協定的重要性與常見的網路通訊 協定 介紹網際網路的組成與相關觀念 介紹網際網路的連線方式 介紹數種常見的網際網路服務 說明網際網路所帶來的問題 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 2 / 55 1. Introduction Today computer is available in many offices and homes and therefore there is a need to share data and programs among various computers with the advancement of data communication facilities. The communication between computers has increased and thus it has extended the power of computer beyond the computer room. Now a user sitting at one place can communicate computers of any remote sites through communication channel. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 3 / 55 Data Communication We all are acquainted with some sorts of communication in our day to day life. For communication of information and messages we use telephone and postal communication systems. Similarly data and information from one computer system can be transmitted to other systems across geographical areas. Thus data transmission is the movement of information using some standard methods. These methods include electrical signals carried along a conductor, optical signals along an optical fibers and electromagnetic areas. The modern form of communication like e-mail and WWW is possible only because of computer networking. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 4 / 55 Basic Elements of a Communication System The following are the basic requirements for working of a communication system. A sender (source) which creates the message to be transmitted. A medium that carries the message. A receiver (sink) which receives the message. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 5 / 55 Communications Protocols You may be wondering how do the computers send and receive data across communication links. The answer is data communication software. The data communication software instructs computer systems and devices as to how exactly data is to be transferred from one place to another. The procedure of data transformation in the form of software is commonly called protocol. A communications protocol or network protocol is the specification of a set of rules for a particular type of communication. How are you? 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 你好嗎? Chapter 2: Page 6 / 55 Data Transmission Modes There are three ways for transmitting data from one point to another: Simplex Half-duplex Full-duplex 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 7 / 55 2. Computer Network Definition: A computer network is a system for communication among two or more computers. A computer network is an interconnection of various computer systems located at different places. In computer network two or more computers are linked together with a medium and data communication devices for the purpose of communicating data and sharing resources. The computer that provides resources to other computers on a network is known as server. In the network the individual computers, which access shared network resources, are known as workstations or nodes. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 8 / 55 Types of Computer Network Computer networks may be categorized with respect to range: Personal area network (PAN) Wireless Local area network (LAN) Wireless PAN LAN Metropolitan area network (MAN) Wide area network (WAN) 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 9 / 55 Personal Area Network A personal area network (PAN) is a computer network used for communication among computer devices (including telephones and personal digital assistants) close to one person. The reach of a PAN is typically a few meters. PANs can be used for communication among the personal devices themselves (intrapersonal communication), or for connecting to a higher level network and the Internet (an uplink). Personal area networks may be wired with computer buses such as USB and Firewire. Wireless PANs can also be made possible with network technologies such as IrDA and Bluetooth. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 10 / 55 Local Area Network A local area network or LAN is a computer network covering a local area, such as an office or a home. Standardization efforts by the IEEE have resulted in the IEEE 802 series of standards. The most common wiring technology for a LAN is Ethernet (IEEE 802.3). Ethernet: 10 Mbps Fast Ethernet: 100 Mbps (bits per second) Gigabit Ethernet: 1 Gbps 10 Gigabit Ethernet: 10 Gbps Data transfer rate: the speed with which data is moved from one place on a network to another. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 11 / 55 Metropolitan Area Network Metropolitan area networks or MANs are large computer networks usually spanning a campus or a city. For instance a university or college may have a MAN that joins together many of their local area networks (LANs) situated around site of a fraction of a square kilometer. Then from their MAN they could have several wide area network (WAN) links to other universities or the Internet. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 12 / 55 Wide Area Network A wide area network or WAN is a computer network covering a wide geographical area. The best example of a WAN is the Internet. WANs are used to connect local area networks together, so that users and computers in one location can communicate with users and computers in other locations. TANet: Taiwan Academy Network 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 13 / 55 3. Network Topologies A network may be represented as a collection of nodes, some of which are connected by links. A given node may have links to many others (see diagrams below). Network topology is determined only by the configuration of connections between nodes. Distances between nodes, physical interconnections, transmission rates, and/or signal types are not a matter of network topology, although they may be affected by it in an actual physical network. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 ? Chapter 2: Page 14 / 55 Network Topologies – Star Networks In a Star network all the client computers are connected to a central server or hub. Information between computers travels first to the Hub, which then passes it on to the other computers on the network. This is one of the most popular forms of network used in workgroup and departmental networks. The advantages of a star topology are: The failure of a single computer or cable doesn't bring down the entire network. The centralized networking equipment can reduce costs in the long run by making network management much easier. Disadvantages include: Failure of the central hub causes the whole network failure. It is slightly more expensive than using bus topology. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 15 / 55 Network Topologies – Bus Networks A bus network is a network architecture in which a set of clients are connected via a shared communications line, called a bus. Advantages of the bus are: This is the cheapest type of network to connect The Bus is easy to use and understand It is easy to extend a network by adding cable with a repeater that boosts the signal and allows it to travel a longer distance. Disadvantages include: A bus topology becomes slower as network traffic increases and more computers are added to the network. A single break in the cabling or a loose connector can bring down the whole network. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 16 / 55 Network Topologies – Ring Networks Ring networks are similar to bus networks with the exception that the network is joined back to itself, so does not need a terminating computer. In this configuration, information is exchanged via a ”token” which passes around the ring until the requesting computer(s) have received the data. The advantages are: One computer cannot monopolize the network. It continue to function after capacity is exceeded but the speed will be slow. Disadvantages are: Failure of one computer can affect the whole network. It is difficult to troubleshoot. Adding and removing computers disrupts the network. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 17 / 55 Network Topologies – Hybrid Networks 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 18 / 55 4. Transmission Media Transmission media are the media through which information usually moves from one network device to another. There are several types of transmission media which are commonly used with LANs. In some cases, a network will utilize only one type of transmission media , other networks will use a variety of transmission media types. The type of transmission media chosen for a network is related to the network's topology, protocol, and size. Understanding the characteristics of different types of cable and how they relate to other aspects of a network is necessary for the development of a successful network. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 19 / 55 Wired Transmission Media – UTP Twisted pair cabling comes in two varieties: shielded and unshielded. Unshielded twisted pair (UTP) is the most popular and is generally the best option for school networks. The cable has four pairs of wires inside the jacket. Each pair is twisted with a different number of twists per inch to help eliminate interference from adjacent pairs and other electrical devices. The tighter the twisting, the higher the supported transmission rate and the greater the cost per foot. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 20 / 55 Wired Transmission Media – Coaxial Cable Although coaxial cabling is difficult to install, it is highly resistant to signal interference. In addition, it can support greater cable lengths between network devices than twisted pair cable. The two types of coaxial cabling are thick coaxial and thin coaxial. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 21 / 55 Wired Transmission Media – Fiber-Optic Fiber optic cabling consists of a center glass core surrounded by several layers of protective materials. It transmits light rather than electronic signals eliminating the problem of electrical interference. This makes it ideal for certain environments that contain a large amount of electrical interference. It has also made it the standard for connecting networks between buildings, due to its immunity to the effects of moisture and lighting. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 22 / 55 Wireless Transmission Media Wireless LANs use high frequency radio signals, infrared light beams, or lasers to communicate between the workstations and the file server or hubs. Each workstation and file server on a wireless network has some sort of transceiver/antenna to send and receive the data. Information is relayed between transceivers as if they were physically connected. Advantages: For longer distance, wireless communications can also take place through cellular telephone technology, microwave transmission, or by satellite. Wireless networks are great for allowing laptop computers or remote computers to connect to the LAN. Wireless networks are also beneficial in older buildings where it may be difficult or impossible to install cables. Disadvantages: They provide poor security. They are susceptible to interference from lights and electronic devices. They are also slower than LANs using cabling. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 23 / 55 Examples of Wireless Transmission Media Radio technology Cellular Microwave and Satellite Infrared 公眾交換 電話網路 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 24 / 55 5. Communication Protocols Definitions: In networking, a communication protocol or network protocol is the specification of a set of rules for a particular type of communication. A communication protocol is a collection of rules and procedures for establishing, maintaining, and terminating transmissions between devices. Protocols specify How devices physically connect to a network How data is packaged for transmission How receiving devices acknowledge signals from sender devices How errors are handles ... 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 25 / 55 Ethernet Ethernet has become the most widespread LAN technology in use during the 1990s to the present. CS A scheme known as carrier sense multiple access with collision detection (CSMA/CD) governs the way the computers share the communication media. MA CD 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 26 / 55 常見的乙太網路佈線方式 – 有線 集線器 (Hub) UTP UTP 網路卡 UTP 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 27 / 55 常見的乙太網路佈線方式 – 無線 集線器 (Hub) USB 無線網卡 UTP Access Point 802.11b – 11 Mbps 802.11g – 54 Mbps 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 28 / 55 電子系館區域網路系統 校園網路 Switching Hub DHCP Server Switching Hub Switching Hub Switching Hub Teacher’s PCs PCs in Lab. PCs in Lab. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 29 / 55 6. Internet The Internet is the publicly available internationally interconnected system of computers (plus the information and services they provide to their users) that uses the TCP/IP suite of packet switching communications protocols. The Internet is composed of many interconnected computer networks. Each network may link tens, hundreds, or even thousands of computers, enabling them to share information with one another and to share computational resources such as powerful supercomputers and databases of information. The Internet has made it possible for people all over the world to communicate with one another effectively and inexpensively. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 30 / 55 Packet Switching Packet switching is a communications paradigm in which packets are individually routed between nodes, with no previously established communication path. A packet is a block of user data together with necessary address and administration information attached, to allow the network to deliver the data to the correct destination. One data connection will usually carry a stream of packets of data that will not necessarily be all routed the same way over the physical network. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 31 / 55 Internet Connections A router consists of a computer networking device that determines the next network point to which to forward a data packet toward its destination, a process known as routing. R R R R R R R R LAN R MAN 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 R LAN R : Router Chapter 2: Page 32 / 55 Internet Protocol Suite Application layer FTP SMTP HTTP IRC … Transport layer TCP UDP SCTP ICMP … Network layer IP IPv6 ARP DHCP … Ethernet Token Ring FDDI 802.11 Wi-Fi … Data link layer 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 33 / 55 Internet Protocol (IP) The Internet Protocol (IP) is a data-oriented protocol used by source and destination hosts for communicating data across a packet-switched internetwork. Data in an IP internetwork are sent in blocks referred to as packets or datagrams (the terms are basically synonymous in IP). In particular, in IP no setup is needed before a host tries to send packets to a host it has previously not communicated with. The Internet Protocol provides an unreliable datagram service, i.e., it makes almost no guarantees about the packet. The packet may arrive damaged, it may be out of order (compared to other packets sent between the same hosts), it may be duplicated, or it may be dropped entirely. If the application needs reliability, this is added by the transport layer. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 34 / 55 Transmission Control Protocol (TCP) Transmission Control Protocol (TCP) is a connection-oriented, reliable delivery byte-stream transport layer protocol. TCP connections contain three phases: connection establishment data transfer connection termination 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 35 / 55 IP Addressing An IP Address is a unique number, akin to a mail address, used by machines (usually computers) to refer to each other when sending information through the Internet. In IPv4, the current standard protocol for the Internet, IP addresses consist of 32 bits. IPv4 addresses are commonly expressed as a dotted quad, four octets (8 bits) separated by periods. 203.64.185.201 32 bits Network (7 bits) Class A 0 Class B 10 Class C 110 Class D 1110 Local Address (24 bits) Network (14 bits) Local Address (16 bits) Network (21 bits) Local (8 bits) Multicast Address (28 bits) 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 36 / 55 Domain Name System The Domain Name System (DNS) is the method by which Internet addresses in mnemonic form such as www.dee.nuu.edu.tw are converted into the equivalent numeric IP edu address such as 203.64.185.201. . com net org tw edu com net nctu ntu … To the user and application process this translation is a service provided either by the local host or from a remote host via the Internet. nuu org The DNS server (or resolver) may communicate with other Internet DNS servers if it cannot translate the address itself. dee mis www (203.64.185.201) 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 DNS Tree Chapter 2: Page 37 / 55 7. Internet Access Common methods of home access include: Dial-up Broadband A form of internet access in which the client uses a modem to dial the ISP's node. The typical broadband connection to date, whether cable or xDSL, is configured by the ISP to run at bit rates from 350-500 kbit/s. The full rate connection for a typical cable plant might be as high as 10 Mbit/s and with ADSL it might be 2 to 6 Mbit/s. Satellite Satellite Internet services are used in locations where terrestrial Internet is not available and in locations which move frequently. Internet Service Provider: a company that provides other companies or individuals with access to the Internet. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 38 / 55 Internet Access: Dial-Up MODEM: Modulator-DEModulator MODEM 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 39 / 55 Internet Access: Broadband - ADSL ADSL: Asymmetric Digital Subscriber Line ADSL MODEM 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 40 / 55 Internet Access: Broadband – Cable 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 41 / 55 Internet Access: Satellite 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 42 / 55 8. Some Popular Internet Services E-mail The World Wide Web (WWW) TELNET FTP Instant messaging Usenet newsgroups … IRC 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 43 / 55 E-mail E-mail, or email, is short for "electronic mail" and is a method of composing, sending, and receiving messages over electronic communication systems. Most e-mail systems today use the Internet, and email is one of the most popular uses of the Internet. An e-mail address identifies a location to which email can be delivered. A modern Internet e-mail address is a string of the form: Username @ Email server’s DNS yhshiau @ nuu.edu.tw 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 44 / 55 E-mail System Internet To: y@ms_b From: x@ms_a ......... Mail Server for x Mail Server for y SMTP SMTP Computer for x POP3 SMTP: Simple Mail Transfer Protocol POP3: Post Office Protocol version 3 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Computer for y Chapter 2: Page 45 / 55 WWW The World Wide Web (the "Web" or "WWW" for short) is a hypertext system that operates over the Internet. Hypertext is browsed using a program called a web browser which retrieves pieces of information (called "documents" or "web pages") from web servers (or "web sites") and displays them on your screen. You can then follow hyperlinks on each page to other documents or even send information back to the server to interact with it. 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 46 / 55 Three Standards for WWW The Uniform Resource Locator (URL) specifies how each page of information is given a unique "address" at which it can be found. HyperText Transfer Protocol (HTTP) specifies how the browser and server send the information to each other. HyperText Markup Language (HTML) a method of encoding the information so it can be displayed on a variety of devices. URL HTTP 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 HTML Chapter 2: Page 47 / 55 Uniform Resource Locator A Uniform Resource Locator, URL, or web address, is a standardized address for some resource, such as a document or image, on the Internet. The URL combines into one simple address the four basic items of information necessary to find a document anywhere on the Internet: The protocol to use to communicate with that machine The machine or domain name to go to An open network port on the target machine connected to some service The path or file name on that machine A typical simple URL can look like: http://203.64.185.201:80/~yhshiau/index.html 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 48 / 55 Uniform Resource Identifier (URI) URI is an Internet protocol element. A URI is a short string of characters that conform to a certain syntax. The string indicates a name or address that can be used to refer to an abstract or physical resource. Example URI: http://203.64.185.208/~yhshiau mailto:yhshiau@nuu.edu.tw telnet://melvyl.ucop.edu/ ftp://ftp.is.co.za/rfc/rfc1808.txt 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 49 / 55 HyperText Transfer Protocol HTTP is the primary method used to communicate information on the World Wide Web. HTTP is a request/response protocol between clients and servers. The browser sends a URL. Request Response The server sends back a web page. Client HTTP 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Web server Chapter 2: Page 50 / 55 HyperText Markup Language HyperText Markup Language (HTML) is a markup language designed for creating web pages, that is, information presented on the World Wide Web. <HTML> <HEAD> <TITLE>蕭裕弘的網頁</TITLE> </HEAD> <BODY> <font size=7>蕭裕弘的網頁</font> </BODY> </HTML> 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 51 / 55 Functions of Browsers open desired HTML documents follow links to other Web documents follow links to other Internet information systems such as gopher and ftp open local documents save retrieved documents print the current document maintain a history of visited URLs move back and forward between URLs visited in the current session trigger programs on the server side and review the results view the source (the HTML) of the current document keep a note of URLs required for future reference search for a term in the current document handle forms view images (GIF, JPEG, PNG formats) inline follow links from imagemaps maintain a store (cache) of visited pages for re-use where appropriate 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 52 / 55 常見的網頁設計程式語言 HTML C/C++ Perl PHP Java JavaScript Linux Apache MySQL PHP 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 53 / 55 常見的網際網路應用 Co-operation The practice of people or greater entities working in common with commonly agreed-upon goals and possibly methods, instead of working separately in competition. Electronic commerce Electronic commerce or e-commerce consists of the buying, selling, marketing, and servicing of products or services over computer networks. On-line publishing Internet publishing, web publishing, electronic publishing ...... 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 54 / 55 網際網路的法律與道德問題 There is public concern about the Internet stemming from some of the controversial material it contains. Copyright infringement 版權侵犯的問題 Pornography 色情的問題 Identity theft 個人資料的盜取 Hate speech 仇恨的語言與製造問題 Social problem 社會問題 ...... 國立聯合大學電子工程學系 – 計算機概論 – 蕭裕弘 Chapter 2: Page 55 / 55