Upload
vonhu
View
215
Download
0
Embed Size (px)
Citation preview
Motivation For Networking� Information access
� Interaction among cooperative application programs
� Resource sharing
CS422 -- PART 1 13 2003
Practical Results� E-mail
� File transfer/access
� Web browsing
� Remote login/execution
� IP Telephony
� The Internet
CS422 -- PART 1 14 2003
What A Network Includes� Transmission hardware
� Special-purpose hardware devices
– Interconnect transmission media
– Control transmission
– Run protocol software
� Protocol software
– Encodes and formats data
– Detects and corrects problems
CS422 -- PART 1 15 2003
What A Network Does� Provides communication that is
– Reliable
– Fair
– Efficient
– Secure
– From one application to another
CS422 -- PART 1 16 2003
What A Network Does(continued)
� Automatically detects and corrects
– Data corruption
– Data loss
– Duplication
– Out-of-order delivery
� Automatically finds optimal path from source to destination
CS422 -- PART 1 17 2003
Network Programming� Network allows arbitrary applications to communicate
� Programmer does not need to understand networktechnologies
� Network facilities accessed through an Application ProgramInterface
CS422 -- PART 1 18 2003
Basic Paradigm ForInternet Communication
� Establish contact
� Exchange data (bi-directional)
� Terminate contact
CS422 -- PART 1 19 2003
Establishing Contact� Performed by pair of applications
� One application starts and waits for contact (called server)
� Other application initiates contact (called client)
CS422 -- PART 1 20 2003
Identifying A Waiting Application� Conceptually two items specified
– Computer
– Application on that computer
� Terminology
– Computer identified by domain name
– Application identified by program name
CS422 -- PART 1 21 2003
Representations And Translations� Humans use names such as
– www.netbook.cs.purdue.edu (computer)
– ftp (application)
� Network protocols require binary values
� Library routines exist to translate from names to numbers
CS422 -- PART 1 22 2003
Motivation ForInternetworking
� LANs
– Low cost
– Limited distance
� WANs
– High cost
– Unlimited distance
CS422 -- PART 10 2 2003
Heterogeneity IsInevitable
No single networking technology best for all needs.
CS422 -- PART 10 3 2003
Universal Service� Fundamental concept in networking
� Pioneered by telephone system
� Arbitrary pair of computers can communicate
� Desirable
� Difficult in a heterogeneous world
CS422 -- PART 10 4 2003
Heterogeneity And Universal Service� Incompatibilities among networks
– Electrical properties
– Signaling and data encoding
– Packet formats
– Addresses
CS422 -- PART 10 5 2003
The Bottom Line
Although universal service is highly desirable,incompatibilities among network hardware and physicaladdressing prevent an organization from building a bridgednetwork that includes arbitrary technologies.
CS422 -- PART 10 6 2003
An Internetwork� Begin with heterogeneous network technologies
� Connect the physical networks
� Create software to make resulting system appearhomogeneous
� Called an internetwork or internet
CS422 -- PART 10 7 2003
Connecting Heterogeneous Networks� Computer system used
– Special-purpose
– Dedicated
– Works with LAN or WAN technologies
– Known as
* Internet router
* Internet gateway
CS422 -- PART 10 8 2003
Illustration Of An Internet Router� Cloud denotes arbitrary network technology
� One interface per network
CS422 -- PART 10 9 2003
Important Idea
A router can interconnect networks that use differenttechnologies, including different media and media accesstechniques, physical addressing schemes, or frame formats.
CS422 -- PART 10 10 2003
Internet Architecture� Multiple
– Networks
– Routers interconnecting networks
� Host computer connects to a network
� Single router has insufficient
– CPU power and memory
– I/O capability
CS422 -- PART 10 11 2003
Internetworking� Goal: communication system
– Seamless
– Uniform
– General-purpose
– Universal
– Hides heterogeneity from user
CS422 -- PART 10 12 2003
The Internet Concept
net 2
net 4
net 5
net 3
net 1
(a) The Goal
CS422 -- PART 10 13 2003
The Internet Concept
net 2
net 4
net 5
net 3
net 1
net 2
net 4
net 5
net 3
net 1
router
physical net
(a) The Goal
(b)
CS422 -- PART 10 13 2003
To Hide Heterogeneity� Create ‘‘virtual’’ network
� Invent
– Addressing scheme
– Naming scheme
� Implement with
– Protocol software
� Note: protocol software needed on both hosts and routers
CS422 -- PART 10 14 2003
Internet Protocols� Known as TCP/IP
� Many protocols comprise suite
� Designed to work together
� Divided into five conceptual layers
CS422 -- PART 10 15 2003
Layering Used With TCP/IP
Physical
Network Interface
Internet
Transport
Application
LAYER 1
LAYER 2
LAYER 3
LAYER 4
LAYER 5
� Note: TCP/IP layering model replaces the old ISO model
CS422 -- PART 10 16 2003
TCP/IP Layers� Layer 1: Physical
– Basic network hardware
� Layer 2: Network Interface
– MAC frame format
– MAC addressing
– Interface between computer and network (NIC)
� Layer 3: Internet
– Facilities to send packets across internet composed ofmultiple routers
CS422 -- PART 10 17 2003
TCP/IP Layers(continued)
� Layer 4: Transport
– Transport from an application on one computer toapplication on another
� Layer 5: Application
– Everything else
CS422 -- PART 10 18 2003
Electronic Mail� Originally
– Memo sent from one user to another
� Now
– Memo sent to one or more mailboxes
� Mailbox
– Destination point for messages
– Can be storage or program
– Given unique address
CS422 -- PART 15 85 2003
E-mail Address� Text string
� Specifies mail destination
� General form
mailbox @ computer
� computer
– Domain name of computer
– Actually type MX
� mailbox
– Destination on the computer
CS422 -- PART 15 86 2003
Use Of E-mail Address
Each electronic mailbox has a unique address, which isdivided into two parts: the first identifies a user’s mailbox, andthe second identifies a computer on which the mailbox resides.E-mail software on the sender’s computer uses the second partto select a destination; e-mail software on the recipient’scomputer uses the first part to select a particular mailbox.
CS422 -- PART 15 87 2003
Mail Message Format� Header
– Identifies sender, recipient(s), memo contents
– Lines of form
keyword : information
� Blank line
� Body
– Contains text of message
CS422 -- PART 15 88 2003
Example E-mail Header Fields
Keyword Meaning
From Sender’s addressTo Recipients’ addressesCc Addresses for carbon copiesDate Date on which message was sentSubject Topic of the messageReply-To Address to which reply should goX-Charset Character set used (usually ASCII)X-Mailer Mail software used to send the messageX-Sender Duplicate of sender’s addressX-Face Encoded image of the sender’s face
� Most header lines optional
CS422 -- PART 15 89 2003
Extending E-mail� Original e-mail
– Message restricted to ASCII text
� Users desire to send
– Image files
– Audio clips
– Compiled (binary) programs
� Solution
– Multi-purpose Internet Mail Extensions (MIME)
CS422 -- PART 15 90 2003
MIME� Allows transmission of
– Binary data
– Multimedia files (video/audio clips)
– Multiple types in single message
– Mixed formats
� Backward compatible
CS422 -- PART 15 91 2003
MIME Encoding� Sender
– Inserts additional header lines
– Encodes binary data in (printable) ASCII
� Sent like standard message
� Receiver
– Interprets header lines
– Extracts and decodes parts
� Separate standards for content and encoding
CS422 -- PART 15 92 2003
Example Of MIME� Header lines added
MIME-Version: 1.0
Content-Type: Multipart/Mixed; Boundary=xxxsep
� Specifies
– Using MIME Version 1.0
– Line xxxsep appears before each message part
CS422 -- PART 15 93 2003
Mail Transfer� Protocol is Simple Mail Transfer Protocol (SMTP)
� Runs over TCP
� Used between
– Mail transfer program on sender’s computer
– Mail server on recipient’s computer
� Specifies how
– Client interacts with server– Recipients specified– Message is transferred
CS422 -- PART 15 94 2003
Illustration Of Mail Transfer
Internet
user interface onsender’s computer
mail transfer programon sender’s computer
recipient’smailbox
server onrecipient’s computer
� Server
– Required to receive mail
– Places message in user’s mailbox
CS422 -- PART 15 95 2003
Terminology� Mail exploder
– Program
– Accepts incoming message
– Delivers to multiple recipients
� Mailing list
– Database
– Used by exploder
� Mail gateway
– Connects two mail systems
CS422 -- PART 15 96 2003
Illustration Of A Mailing List
List Contents
friends [email protected], [email protected], [email protected]@acollege.edu, [email protected],
customers [email protected], [email protected] [email protected], [email protected],
[email protected], [email protected]
� Separate permissions for
– Mailing to list
– Adding / deleting members
* Public – anyone can join
* Private – access restricted by owner
CS422 -- PART 15 97 2003
Illustration Of A Mail Gateway
database
Internet
e-mailgateway
sender’scomputer
recipient’scomputer
user interface
mail transferprogram
recipient’smailbox
mail server
exploder mail transferprogram
� Can connect two
– Heterogeneous systems
– Internet to non-Internet
CS422 -- PART 15 98 2003
Computers Without Mail Servers� Typically
– Small, personal computer
– Not continuously connected to Internet
� To receive e-mail, user must
– Establish mailbox on large computer
– Access mailbox as necessary
� Post Office Protocol (POP) used
CS422 -- PART 15 99 2003
Illustration Of POP
Internet
sendingcomputer
computer withmailbox
user’scomputer
mail transferprogram
recipient’smailbox
mail server POP server
POP client
� Current version named POP3
CS422 -- PART 15 100 2003
Remote Login� Provide interactive access to computer from remote site
� Standard protocol is TELNET
CS422 -- PART 15 114 2003
TELNET� Text-oriented interface
� User
– Invokes client
– Specifies remote computer
� Client
– Forms TCP connection to server
– Passes keystrokes over connection
– Displays output on screen
CS422 -- PART 15 115 2003
File Transfer� Complete file copy
� Major protocol is File Transfer Protocol (FTP)
– Uses TCP
– Supports binary or text transfers
– Large set of commands
– Until 1995 was major source of packets in Internet
CS422 -- PART 15 116 2003
FTP Paradigm� Command-line interface
� User
– Forms TCP connection to server (called controlconnection)
– Logs in
– Enters commands to list directories, transfer files
� Server
– Establishes new TCP connection for each transfer
CS422 -- PART 15 117 2003
Illustration Of TCP ConnectionsDuring An FTP File Transfer
FTPclient
FTPserver
Internet
control connection
data connection
� Two TCP connections used
CS422 -- PART 15 118 2003
World Wide Web� Major application protocol used on the Internet
� Simple interface
� Two concepts
– Point
– Click
CS422 -- PART 16 2 2003
Web Components� Browser
� Web server
� Hypermedia links
� Document representation
� Transfer protocol
CS422 -- PART 16 3 2003
Browser� Application program
� User’s interface to Web
� Becomes Web client to fetch information from Web server
� Displays information for user
CS422 -- PART 16 4 2003
Web Server� Running program
� Stores set of Web documents
� Responds to request from browser by sending copy ofdocument
CS422 -- PART 16 5 2003
Web Standards� HyperText Markup Language (HTML)
� Uniform Resource Locator (URL)
� HyperText Transfer Protocol (HTTP)
CS422 -- PART 16 6 2003
HyperText Markup Language (HTML)� ASCII representation
� Tags to give general layout guidelines
� Does not specify exact placement or format
� Allows document to contain
– Text
– Graphics
– Links to other documents
CS422 -- PART 16 7 2003
Uniform Resource Locator (URL)� Specifies document on the Web
� Encodes
– Protocol used to access document
– Domain name of server
– Protocol port number of server
– Path to document
CS422 -- PART 16 8 2003
General Form Of URL
protocol : / / domain_name : port / item_name
name of accessprotocol to use
domain name ofserver computer
protocol portnumber
path nameof item
� Only domain name required
� Defaults– Protocol is http– Port is 80– Path is index.html
CS422 -- PART 16 9 2003
Use Of Client-Server Paradigm� Web server
– Makes set of pages available
– Uses port 80
� Web client
– Called a browser
– Creates TCP connection to server
– Sends requests for items
� Primary protocol known as HyperText Transfer ProtocolHTTP)
CS422 -- PART 16 10 2003
Inside A Browser� Main controller
– Receives input from user
– Invokes client and interpreter
� Client
– One or more built into browser
– Uses network to fetch items
� Interpreter
– One or more built in
– Displays items
CS422 -- PART 16 11 2003
Illustration Of A Browser
controller
HTTPclient
optionalclient
network interface
HTMLinterpreter
optionalinterpreter
driver
input frommouse and
keyboard outputsent todisplay
communication with remote server
� Browser contains many components
CS422 -- PART 16 12 2003
Alternative Protocol Example� File transfer service
� Protocol is FTP
� Example URL
ftp://ftp.cs.purdue.edu/pub/comer/netbook/client.c
� Can be specified in anchor tag
CS422 -- PART 16 13 2003
Caching In Browsers� Cache for recently accessed
– HTML pages
– Images
� Item normally fetched from cache
� User can override
� HTTP can verify timestamp before fetching new copy
CS422 -- PART 16 14 2003
Types Of Web Pages� Static
– Stored in file
– Unchanging
� Dynamic
– Formed by server– Created on demand– Output from a program– Use Common Gateway Interface (CGI) technology
CS422 -- PART 16 15 2003
Types Of Web Pages(continued)
� Active
– Executed at client
– Consist of a computer program
– Can interact with user
– Use Java technology
CS422 -- PART 16 16 2003