x.x.x: Localhost communication (127.0.0.1 is the localhost). ➢ 192.168.x.x: Private
network. ➢ 169.254.x.x: retrieved from a DHCP(Dynamic Host Configuration.
Introduction to Computer and Program Design
Lesson 7
Networking and the Internet James C.C. Cheng Department of Computer Science National Chiao Tung University
Reference book l Computer Science: An Overview, 11ed u
J. Glenn Brookshear
u
Publish by Pearson
2
Network Classifications l Scope u u u
Local area network (LAN) è a room, a building Metropolitan area (MAN) è a local community Wide area network (WAN) è a greater distance
l Ownership u
Closed versus open
l Topology (configuration) u u
Bus (Ethernet, a LAN technique) Star (Wireless networks with central Access Point)
3
Topology (configuration) l Bus (Ethernet, a LAN technique) u
Hub
l Star (Wireless networks with central Access Point) u
Access Point, AP
4
Protocols l CSMA/CD, Carrier Sense Multiple Access with Collision Detection u
Used in Ethernet (BUS)
u
Silent bus provides right to introduce new message
u
Not compatible with star networks
l CSMA/CA, Carrier Sense Multiple Access with Collision Avoidance u
Used in WiFi (Star)
u
Hidden terminal problem
5
The hidden terminal problem
6
Connecting Networks l Repeater: a signal amplifier to extend a network l Hub: multiport repeater l Bridge: Connects two compatible networks l Switch: Connects several compatible networks
7
Connecting Networks l Router: u
Connects two incompatible networks resulting in a network of networks called an internet
u
Forwarding table or routing table
u
Gateway
8
Network Devices l Repeater l Wireless AP
l Hub l ipshare ≠ router
l Bridge
l router
l switch
9
Network Cable Computer ßà Device
l Category 5 cable
1
8
Computer ßà Computer
maximum length: 100 m
10
Inter-process Communication l Client-server u
One server, many clients
u
Server must execute continuously
u
Client initiates communication
l Peer-to-peer (P2P) u
Two processes communicating as equals
u
Peer processes can be shortlived
11
Distributed Systems l Systems with parts that run on different computers u
Infrastructure can be provided by standardized toolkits ¡ Example: Enterprise Java Beans from Oracle ¡ Example: .NET framework from Microsoft
l Cluster computing u
many independent computers work closely together to provide computation
u
Blade server system
Blade enclosure Blade server
12
Distributed Systems l Grid computing u
more loosely coupled than clusters
u
In general, the communication between grid nodes through network.
Grid nodes
13
Distributed Systems l Cloud computing u
huge pools of shared computers on the network
u
Cloud computing provides computation, software, data access, and storage services that do not require end-user knowledge of the physical location and configuration of the system that delivers the services
u
Application: ¡ Online game ¡ Online documents ¡ Online photo album
14
The Internet l An internet that spans the world u
Original goal was to develop for military purposes (U.S.)
l Internet Service Provider (ISP) u u
Tier-1: International ISP; EX: AT&T, HiNet Tier-2: Local ISP; EX: TFN台灣固網
l Access ISP: Provides connectivity to the Internet u u
Intranet: regional and private internet Traditional telephone (dial up connection) ¡ Modem, mdulator/demodulator
u
Cable connections
u
DSL, digital subscriber line ¡ ADSL: Asymmetric DSL
u
Wireless
15
Internet Addressing l IP address u u
pattern of 32 or 128 bits often represented in dotted decimal notation IPv4, 32 bits: ¡ ex: 140.113.243.210 (each part is a decimal number ) ¡ Some reserved IPs you have to know: Ø 127.x.x.x: Localhost communication (127.0.0.1 is the localhost) Ø 192.168.x.x: Private network Ø 169.254.x.x: retrieved from a DHCP(Dynamic Host Configuration Protocol) server Ø 255.255.255.255: broadcast
u
IPv6, 128 bits ¡ ex: 2001:0DB8:85A3:08D3:1319:8A2E:0370:7344 (each part is a hexadecimal number)
16
Internet Addressing l Mnemonic address: u
Domain names ¡ www.nctu.edu.tw ¡ JamesPC1
u
Top-Level Domains ¡ ¡ ¡ ¡ ¡
.edu.tw is a top-level domain .edu: educational institutions .gov: government institutions .org: non-profit organizations .com & .co: commercial
n n n n
.tw: Taiwan .cn: China .jp: Japan .uk:United Kingdom
l Domain name system (DNS) u u
Name servers DNS lookup
17
Internet Addressing l Internet Corporation for Assigned Names & Numbers (ICANN) u
Allocates IP addresses to ISPs who then assign those addresses within their regions.
u
Oversees the registration of domains and domain names.
18
Traditional Internet Applications l Electronic Mail (email) u
Domain mail server collects incoming mail and transmits outing mail
u
Email address: ¡ account_name@server_domain_name ¡ ex:
[email protected]
u
Mail server delivers collected incoming mail to clients via POP3 or IMAP ¡ SMTP, Simple Mail Transfer Protocol: for ASCII data ¡ MIME, Multipurpose Internet Mail Extensions: for non-ASCII data ¡ POP3, Post Office Protocol ver.3 Ø User can download mails from a mail server ¡ IMAP, Internet Mail Access Protocol Ø User can read/modify mails or related materials from different computer ¡ Webmail Ø User can read/modify mails through a web-browser 19
Traditional Internet Applications l File Transfer Protocol (FTP) u
FTP server: File provider
u
FTP client: Uploading/downloading files to/from a FTP server
l Telnet and Secure Shell(SSH) u
allow users to access another computers
u
Example: Bulletin Board System, BBS
20
More Recent Applications l Voice Over IP (VoIP) u
voice communication
u
Type 1:P2P model ¡ Example: Skype
u
Type 2: VoIP + traditional telephone ¡ analog telephone adapters
u
Type 3: Pure VoIP Phone device
21
More Recent Applications l Generations of wireless telephones u
1G, first generation ¡ traditional telephone system
u
2G, second generation ¡ text message
u
2.5G, GPRS (General Packet Radio Service) ¡ 56 kbps -115 kbps
u
3G, third generation ¡ higher data transfer rates (300k-2Mbps), ¡ allowing for mobile video calls and other bandwidth-intensive activities
u
3.5G ¡ higher data transfer speeds than 3G (1.8M - 14Mbps)
u
4G, fourth generation ¡ higher data transfer speeds than 3G (100M – 1Gbps) ¡ fully packet-switched ¡ using the IP protocol
22
More Recent Applications l Internet Radio u
N-unicast ¡ one sender sending messages to multiple receivers ¡ server to send individual messages to each of its clients.
u
Multicast ¡ a server transmits a message to multiple clients by means of a single address
l Internet TV (online TV) u
Internet Protocol television (IPTV)
u
video on demand (VOD)
23
WWW, World Wide Web l Sir Tim Berners-Lee, CERN, 1990 u
CERN: The European Organization for Nuclear Research
l Hyperlink u
a reference to data that the reader can directly follow, or that is followed automatically.
l Hypertext u
a text document that contained hyperlinks
l Web page u
A hypertext document on WWW
l Website u
A collection of closely related Web pages
24
WWW, World Wide Web l Web browser u
A software that provides the user interface that allows a user to browse web pages.
l Web server u
A software that contains hypertext documents to be accessed.
l HTTP, Hypertext Transfer Protocol u
Hypertext documents transferred between browsers and Web servers
l URL, Uniform Resource Locator u
a unique address of each web page
u
Format: ¡ Protocol://server_address/directory/…/filename ¡ EX: Ø http://www.nctu.edu.tw/in Ø dex.html 25
HTML, Hypertext Markup Language demonstration page
My Web Page
Click here for another page.
26
Extensible Markup Language (XML) l XML: A language for constructing markup languages similar to HTML u
A descendant of SGML, Standard Generalized Markup Language
u
Opens door to a World Wide Semantic Web
1526 計算機概論與程式設計 鄭昌杰 8040 體育-棒球 王建民
27
Client Side Versus Server Side l Client-side activities u
Examples: java applets, javascript, Macromedia Flash
l Server-side activities u
Common Gateway Interface (CGI)
u
Servlets
u
PHP
Client 1
request response
CGI ASP JSP
Client 2
Client 3 Web Server
28
Package-shipping
Prepares package for shipping
29
Internet Software Layers l l l l
Application: Constructs message with address Transport: Chops message into packets Network: Handles routing through the Internet Link: Handles actual transmission of packets
l Packets u
small segments of a message transmission packet 1
message
packet 2 packet n
reassembly
message 30
Following a message through the Internet
31
OSI model l Open System Interconnection (OSI)
TCP/IP protocal suite
Application
Transport Network
Link
32
TCP/IP Application Layer l TCP Port u
Determining which unit within the application layer should receive an incoming message
u
A port is associated with an IP address of the host, as well as the type of protocol used for communication. ¡ http://www.nctu.edu.tw:80 ¡ ftp://ca.nctu.edu.tw:80 ¡ ftp://140.113.100.99:12345
u
Port number : 0~65536 (User: 1024 to 49151) ¡ 20, 21: FTP ¡ 23: Telnet remote login service ¡ 25: SMTP ¡ 53: DNS ¡ 80: HTTP ¡ 110: Post Office Protocol (POP) ¡ 1863: MSN
33
TCP/IP Transport Layer l Transport Layer u
Transmission Control Protocol, TCP
u
User Datagram Protocol, UDP
34
Security l Attacks u u
Malware (viruses, worms, Trojan horses, spyware, phishing software) Denial of Service attack, DoS ¡ attempt to make a computer resource unavailable to its intended users
u
Spam ¡ abundance of unwanted messages ¡ junk emails
l Protection u u u u
Firewalls Spam filters Proxy Servers Antivirus software
l Network sniffer u u u u
Packet analyzer Detect network attacks Filter suspect content Monitor bandwidth utilization
35
TCP/IP Network Layer l IP, Internet Protocol u
forwarding packets
u
routing
u
hop count ¡ the number of routers through which data must pass between source and destination.
36
Encryption l SSL (Secure Sockets Layer) u
FTPS(FTP Secure)
u
HTTPS(HTTP Secure)
l Public-key Encryption u
Public key: Used to encrypt messages
u
Private key: Used to decrypt messages
l Certificates and Digital Signatures u
Public key: Used to decrypt signature
u
Private key: Used to encrypt signature
37
Public-key encryption
38
Certificates and Digital Signatures Document
Document
Hash Message digest
Signature +
Decrypt
Hash +
Private key
Public key
Message digest
Message digest
Encrypt Compare Signature
Signing
≠ Error!
= OK! Verification
39