View
214
Download
1
Tags:
Embed Size (px)
Citation preview
Introduction 1-2
Chapter 1Introduction
Computer Networking: A Top Down Approach Featuring the Internet, 3rd edition. Jim Kurose, Keith RossAddison-Wesley, July 2004.
A note on the use of these ppt slides:We’re making these slides freely available to all (faculty, students, readers). They’re in PowerPoint form so you can add, modify, and delete slides (including this one) and slide content to suit your needs. They obviously represent a lot of work on our part. In return for use, we only ask the following: If you use these slides (e.g., in a class) in substantially unaltered form, that you mention their source (after all, we’d like people to use our book!) If you post any slides in substantially unaltered form on a www site, that you note that they are adapted from (or perhaps identical to) our slides, and note our copyright of this material.
Thanks and enjoy! JFK/KWR
All material copyright 1996-2004J.F Kurose and K.W. Ross, All Rights Reserved
Introduction 1-3
Protocol “Layers”Networks are
complex! many “pieces”:
hosts routers links of various
media applications protocols hardware,
software
Questions: Is there any hope of
organizing structure of network?
Or at least our discussion of networks?
Introduction 1-4
Organization of air travel: a layered view
Layers: each layer implements a service via its own internal-layer actions relying on services provided by layer below
ticket (purchase)
baggage (check)
gates (load)
runway takeoff
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway landing
airplane routing
airplane routing
Introduction 1-5
Distributed implementation of layer functionality
ticket (purchase)
baggage (check)
gates (load)
runway takeoff
airplane routing
ticket (complain)
baggage (claim)
gates (unload)
runway landing
airplane routing
airplane routing
Dep
art
ing
air
port
arr
ivin
g
air
port
intermediate air traffic sites
airplane routing airplane routing
Introduction 1-6
Why layering?
Dealing with complex systems: explicit structure allows identification,
relationship of complex system’s pieces layered reference model for discussion
modularization eases maintenance, updating of system change of implementation of layer’s service
transparent to rest of system e.g., change in gate procedure doesn’t
affect rest of system
Introduction 1-7
Internet protocol stack application: supporting network
applications FTP, SMTP
transport: process-process data transfer
network: routing of datagrams from source host to destination host IP, routing protocols
link: data transfer between neighboring network elements PPP, Ethernet
physical: bits “on the wire”
application
transport
network
link
physical
5
4
3
2
1
Introduction 1-8
Layering: logical communication
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
networklink
physical
Each layer: distributed “entities”
implement layer functions at each node
entities perform actions, exchange messages with peers
Introduction 1-9
Layering: logical communication
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
networklink
physical
data
data
E.g.: transport take data from
app add
addressing, reliability check info to form “datagram”
send datagram to peer
wait for peer to ack receipt
data
transport
transport
ack
Introduction 1-10
Layering: physical communication
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
networklink
physical
data
data
Introduction 1-11
Protocol layering and data
Each layer takes data from above adds header information to create new Protocol Data
Unit (PDU) – may also break into smaller segments passes new data unit to layer below
applicationtransportnetwork
linkphysical
applicationtransportnetwork
linkphysical
source destination
M
M
M
M
Ht
HtHn
HtHnHl
M
M
M
M
Ht
HtHn
HtHnHl
message
segment
datagram
frame
Introduction 1-12
Chapter 1: Summary
Covered a “ton” of material! Internet overview what’s a protocol? network edge, core,
access network packet-switching versus
circuit-switching Internet/ISP structure performance: loss, delay layering and service
models
You now have: context, overview,
“feel” of networking more depth, detail
to follow!
2: Application Layer 14
Processes communicating across network
process sends/receives messages to/from its socket
socket analogous to door sending process shoves
message out door sending process assumes
transport infrastructure on other side of door will deliver message to socket at receiving process
process
TCP withbuffers,variables
socket
host orserver
process
TCP withbuffers,variables
socket
host orserver
Internet
controlledby OS
controlled byapp developer
2: Application Layer 15
Addressing processes: For a process to receive
messages, it must have an identifier
Every host has a unique 32-bit IP address
Q: Does the IP address of the host on which the process runs suffice for identifying the process?
Answer: No, many processes can be running on same host
Identifier includes both the IP address and port numbers associated with the process on the host.
Example port numbers: HTTP server: 80 Mail server: 25
2: Application Layer 16
What transport service does an app need?Data loss some apps (e.g., audio)
can tolerate some loss other apps (e.g., file
transfer, telnet) require 100% reliable data transfer
Timing some apps (e.g.,
Internet telephony, interactive games) require low delay to be “effective”
Bandwidth some apps (e.g.,
multimedia) require minimum amount of bandwidth to be “effective”
other apps (“elastic apps”) make use of whatever bandwidth they get
2: Application Layer 17
Internet transport protocols services
TCP service: connection-oriented: setup
required between client and server processes
reliable transport between sending and receiving process
flow control: sender won’t overwhelm receiver
congestion control: throttle sender when network overloaded
does not provide: timing, minimum bandwidth guarantees
UDP service: unreliable data transfer
between sending and receiving process
does not provide: connection setup, reliability, flow control, congestion control, timing, or bandwidth guarantee
No setup required.
2: Application Layer 18
Web and HTTP
First some jargon Web page consists of objects Object can be HTML file, JPEG image, Java
applet, audio file,… Web page consists of base HTML-file which
includes several referenced objects Each object is addressable by a URL Example URL:
www.someschool.edu/someDept/pic.gif
host name path name
2: Application Layer 19
HTTP overview
HTTP: HyperText Transfer Protocol
Web’s application layer protocol
client/server model client: browser that
requests, receives, “displays” Web objects
server: Web server sends objects in response to requests
HTTP 1.0: RFC 1945 HTTP 1.1: RFC 2068
*NetCraft's Web Server Survey
PC runningExplorer
Server running
Apache Webserver*
Mac runningNavigator
HTTP request
HTTP request
HTTP response
HTTP response
2: Application Layer 20
HTTP overview (continued)
Uses TCP: client initiates TCP
connection (creates socket) to server, port 80
server accepts TCP connection from client
HTTP messages (application-layer protocol messages) exchanged between browser (HTTP client) and Web server (HTTP server)
TCP connection closed
HTTP is “stateless” server maintains no
information about past client requests
Protocols that maintain “state” are complex!
past history (state) must be maintained
if server/client crashes, their views of “state” may be inconsistent, must be reconciled
aside
2: Application Layer 21
HTTP connections
Nonpersistent HTTP At most one object is
sent over a TCP connection.
HTTP/1.0 uses nonpersistent HTTP
Persistent HTTP Multiple objects can
be sent over single TCP connection between client and server.
HTTP/1.1 uses persistent connections in default mode
2: Application Layer 22
Nonpersistent HTTPSuppose user enters URL www.someSchool.edu/someDepartment/home.index
1a. HTTP client initiates TCP connection to HTTP server (process) at www.someSchool.edu on port 80
2. HTTP client sends HTTP request message (containing URL) into TCP connection socket. Message indicates that client wants object someDepartment/home.index
1b. HTTP server at host www.someSchool.edu waiting for TCP connection at port 80. “accepts” connection, notifying client
3. HTTP server receives request message, forms response message containing requested object, and sends message into its socket
time
(contains text, references to 10
jpeg images)
2: Application Layer 23
Nonpersistent HTTP (cont.)
5. HTTP client receives response message containing html file, displays html. Parsing html file, finds 10 referenced jpeg objects
6. Steps 1-5 repeated for each of 10 jpeg objects
4. HTTP server closes TCP connection.
time
2: Application Layer 24
Response time modeling
Definition of Round Trip Time (RTT): time to send a small packet to travel from client to server and back.
Response time: one RTT to initiate TCP
connection one RTT for HTTP request
and first few bytes of HTTP response to return
file transmission timetotal = 2RTT+transmit time
time to transmit file
initiate TCPconnection
RTT
requestfile
RTT
filereceived
time time
2: Application Layer 25
Persistent HTTP
Nonpersistent HTTP issues: requires 2 RTTs per object browsers often open
parallel TCP connections to fetch referenced objects
server must maintain a separate connection for each object
Persistent HTTP server leaves connection
open after sending response
subsequent HTTP messages between same client/server are sent over connection
Persistent without pipelining:
client issues new request only when previous response has been received
one RTT for each referenced object
Persistent with pipelining: default in HTTP/1.1 client sends requests as
soon as it encounters a referenced object
as little as one RTT for all the referenced objects
2: Application Layer 26
HTTP request message
two types of HTTP messages: request, response
HTTP request message: ASCII (human-readable format)
GET /somedir/page.html HTTP/1.1Host: www.someschool.edu User-agent: Mozilla/4.0Connection: close Accept-language:fr
(extra carriage return, line feed)
request line(GET, POST,
HEAD commands)
header lines
Carriage return, line feed
indicates end of message
2: Application Layer 28
Uploading form input
Post method: Web page often
includes form input Input is uploaded to
server in entity body
URL method: Uses GET method Input is uploaded in
URL field of request line:
www.somesite.com/animalsearch?monkeys&banana
2: Application Layer 29
Method types
HTTP/1.0 GET POST HEAD
asks server to leave requested object out of response
HTTP/1.1 GET, POST, HEAD PUT
uploads file in entity body to path specified in URL field
DELETE deletes file specified
in the URL field
2: Application Layer 30
HTTP response message
HTTP/1.1 200 OK Connection: closeDate: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1998 …... Content-Length: 6821 Content-Type: text/html data data data data data ...
status line(protocol
status codestatus phrase)
header lines
data, e.g., requested
HTML file
2: Application Layer 31
HTTP response status codes
200 OK request succeeded, requested object later in this
message
301 Moved Permanently requested object moved, new location specified later
in this message (Location:)
400 Bad Request request message not understood by server
404 Not Found requested document not found on this server
505 HTTP Version Not Supported
In first line in server->client response message.A few sample codes:
2: Application Layer 32
Trying out HTTP (client side) for yourself
1. Telnet to your favorite Web server:Opens TCP connection to port 80(default HTTP server port) at www.rose-hulman.edu.Anything typed in sent to port 80 at www.rose-hulman.edu
telnet www.google.com 80
2. Type in a GET HTTP request:
GET /index.html HTTP/1.1 By typing this in (hit carriagereturn twice), you sendthis minimal (but complete) GET request to HTTP server
3. Look at response message sent by HTTP server!