week2 lec3-bscs1

34
Chapter 1:Introduction Computer Networking: A Top Down Approach , 4 th edition. Jim Kurose, Keith Ross Computer Networks

Upload: syedhaiderraza

Post on 18-Dec-2014

61 views

Category:

Education


1 download

DESCRIPTION

Computer Networks

TRANSCRIPT

Page 1: Week2 lec3-bscs1

Chapter 1:Introduction Computer

Networking: A Top Down Approach ,

4th edition. Jim Kurose, Keith Ross

Computer Networks

Page 2: Week2 lec3-bscs1

Today’s Lecture

Throughput Packet Loss and Delay Chapter 2

HTTP

Page 3: Week2 lec3-bscs1

Internet Protocol Stack Application: Provides user interfaces

and support for services such as e-mail, file transfer etc. FTP, HTTP

Transport: Transports application-layer messages between application end points. Segmentation and reassembly TCP, UDP

Network: Routing of Datagrams from source to destination IP, routing protocols

Link: Move a packet from one node (host or router) to the next node in the route. Ethernet, WiFi

Physical: Move the individual bits with in frames from one node to next

Application

Transport

Network

Link

Physical

Page 4: Week2 lec3-bscs1

OSI Reference Model In 1970 International Organization for

Standardization proposed a seven layered model called Open Systems Interconnection (OSI) model.

Presentation Layer: Provide services such as data encryption, compression.

Session Layer: Synchronization points (checkpointing) and recovery of data exchange.

Internet stack “missing” these layers! these services, if needed, must be

implemented in the application by the application developer.

Page 5: Week2 lec3-bscs1

source

application

transportnetwork

linkphysical

segment

datagram

destination

application

transportnetwork

linkphysical

router

switch

Encapsulationmessage

HtHn M

Ht

HtHnHl M

HtHn M

Ht M

M

networklink

physical

linkphysical

HtHnHl M

HtHn M HtHn M

HtHnHl M

M

Ht M

Hn

frame

Page 6: Week2 lec3-bscs1

Throughput The rate (bits/sec) at which bits are transferred

between sender/receiver Difference between Bandwidth and Throughput?

ISPs sell bandwidth In computer networks, the throughput is less

than the bandwidth for several reasons • The channel may be shared by other users• Packet loss due to congestion• Packet loss due to bit errors• Noise in the channel• Transmission rates of the link over which

the data flows.

Page 7: Week2 lec3-bscs1

Throughput

Rs < Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

Rs > Rc What is average end-end throughput?

Rs bits/sec Rc bits/sec

Throughput is min {Rs,Rc} Transmission Rate of the bottleneck link

Page 8: Week2 lec3-bscs1

Throughput

10 connections share bottleneck link R

Rs

Rs

Rs

Rc

Rc

Rc

R

10 clients/servers pairs, Common link R traversed

by all 10. Rate of the link R is very

large then the throughput is min {Rs , Rc}

Rs=2Mbps, Rc=1Mbps,

R=5Mbps Common link divides

transmission rate equally among the 10 downloads

500kbps to each download

Shared Link R is now the bottleneck.

Page 9: Week2 lec3-bscs1

How do loss and delay occur?

packets queue in router buffers packets queue, wait for turn queue (aka buffer) has finite capacity packet arriving to full queue dropped (aka lost) lost packet may be retransmitted

A

B

packet being transmitted (delay)

packets queueing (delay)

free (available) buffers: arriving packets dropped (loss) if no free buffers

Page 10: Week2 lec3-bscs1

Four sources of packet delay 1. Processing Delay:

Time required to examine packet header and determine output link

check bit errors High Speed Routers

Microseconds or less

A

B

propagation

transmission

processing queueing

2. Queuing Delay: Time waiting at output

link for transmission depends on

congestion level of router

If queue empty no delay

Microseconds to milliseconds

Page 11: Week2 lec3-bscs1

Delay in packet-switched networks3. Transmission Delay: R=link bandwidth

(bps) L=packet length

(bits) time to push all of

packets bits into the link = L/R

Microseconds to milliseconds

4. Propagation Delay: Time to propagate from

the beginning of the link to the other router (node)

propagation delay = d/s

d = length of physical link

s = propagation speed in medium (~3x108 m/sec)

A

B

propagation

transmission

nodalprocessing queueing

Page 12: Week2 lec3-bscs1

Nodal delay

dproc = processing delay typically a few microsecs or less

dqueue = queuing delay depends on congestion

dtrans = transmission delay = L/R

dprop = propagation delay microsecs or msecs

End to End Delay?

proptransqueueprocnodal ddddd

Page 13: Week2 lec3-bscs1

Queuing Delay

R=Transmission Rate (bps) L=packet length(bits) a=average packet arrival

rate(packets/sec)Traffic Intensity = (Average rate at which bits arrive at the queue) =La

Transmission Rate R La/R ~ 0: average queuing delay small

La/R -> 1: delays become large (queue begins to get larger) La/R > 1: average rate at which bits arrive at the queue

exceeds the rate at which the bits can be transmitted from the queue.

More “work” arriving than can be serviced Packet Loss will occur

When is Queuing Delay large and when it is insignificant?

Rate at which traffic arrives at the queue

Transmission rate of the link Nature of the arriving traffic

Page 14: Week2 lec3-bscs1

Queuing DelayConsider the case La/R≤1Nature of arriving traffic impacts queuing delay in

such a case

(Find about Queuing Theory?)

In reality the arrival process to a queue is random and arrivals do not follow any pattern.

Page 15: Week2 lec3-bscs1

Chapter 2Application Layer

Computer Networking: A Top Down Approach, 4th edition. Jim Kurose, Keith RossAddison-Wesley, July 2007.

Page 16: Week2 lec3-bscs1

Chapter 2: Application layer

2.1 Principles of network applications

2.2 Web and HTTP2.3 FTP 2.4 Electronic Mail

SMTP, POP3, IMAP2.5 DNS2.6 P2P applications

Page 17: Week2 lec3-bscs1

Chapter 2: Application LayerOur goals: Conceptual,

implementation aspects of network application protocols client-server

paradigm peer-to-peer

paradigm

Learn about protocols by examining popular application-level protocols HTTP FTP SMTP / POP3 / IMAP DNS

Programming Network Applications Socket programming (in

lab)

Page 18: Week2 lec3-bscs1

Some Network Applications

E-mail Web Instant messaging Remote login P2P file sharing Multi-user network games Streaming stored video clips Voice over IP Real-time video conferencing Many more interesting

applications

Page 19: Week2 lec3-bscs1

Creating a Network Application

write programs that run on (different) end systems communicate over network e.g., web server software

communicates with browser software

No need to write software for network-core devices Network-core devices do not

run user applications Function at lower layers Basic design is to confine

application software to the end systems

Facilitate rapid network application development and deployment

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

applicationtransportnetworkdata linkphysical

Page 20: Week2 lec3-bscs1

Application ArchitecturesApplication Architecture is

Designed by the application developer

Dictates how the application is structured over various end systems

Two architectures used in modern day Network Applications:Client-Server ArchitecturePeer-to-Peer (P2P) Architecture

Page 21: Week2 lec3-bscs1

Client-Server ArchitectureServer: Always-on host permanent well defined IP

address A single server is incapable of

keeping up with all the requests of the clients.

A cluster of hosts referred as server farm is often used.

Clients: Communicate with server May have dynamic IP

addresses Do not communicate directly

with each other Client/Server architecture is

infrastructure intensive Require service providers to

install and maintain servers.

Client/Server

Page 22: Week2 lec3-bscs1

P2P Architecture Direct communication

between pairs of intermittently connected hosts called peers

Peers are not owned by any service provider

P2P Peers communicate

without passing through any dedicated server

e.g. Bit Torrent, eMule, Skype Security issues

Highly Distributive Cost Effective Detailed study later on in

the chapter

peer-peer

Page 23: Week2 lec3-bscs1

Addressing processes

To receive messages, process must have identifier

host device has unique 32-bit IP address

Q: does IP address of host on which process runs suffice for identifying the process?

A: No, many processes can be running on same host

To identify the receiving process two pieces of information need to be specified:

IP address of the host Port number

Identifier that specifies the receiving process in the destination host

Popular applications have been assigned a specific port number.

Example port numbers: HTTP server: 80 Mail server: 25

www.iana.org (well known port numbers for all protocols)

More in chapter 3

Page 24: Week2 lec3-bscs1

Hyper Text Transfer Protocol (HTTP) HTTP defined in RFC 1945 and RFC 2616 HTTP implemented on both client and server

sides HTTP defines

structure of messages exchanged between client and server.

How the client and server exchange the messages

Web browsers implement the client side of HTTP

Web Servers implement the server side of HTTP Host web objects each addressable by a URL

Web page consists of objects Object can be HTML file, JPEG image, audio file …

Web pages consist of base HTML file and several referenced objects

Each object is addressable by a URL

Page 25: Week2 lec3-bscs1

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

PC runningExplorer

Server running

Apache Webserver

Linux runningFirefox

HTTP request

HTTP request

HTTP response

HTTP response

Page 26: Week2 lec3-bscs1

HTTP overview (continued)Uses TCP: Client initiates TCP connection 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)

Advantage of Layered architecture HTTP does not worry about lost data or how

TCP recovers from lossHTTP is “stateless”

Server maintains no information about past client requests

Page 27: Week2 lec3-bscs1

HTTP connections

Nonpersistent HTTP At most one object is sent over a TCP

connection.

Persistent HTTP Multiple objects can be sent over single TCP

connection between client and server.

Page 28: Week2 lec3-bscs1

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 to the client

time

(contains text, references to 10

jpeg images)

Page 29: Week2 lec3-bscs1

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-4 repeated for each of 10 jpeg objects

4. HTTP server closes TCP connection.

time

When the user requests the webpage 11 TCP connections are generated

Page 30: Week2 lec3-bscs1

Non-Persistent HTTP: Response timeDefinition of RTT: time for

a packet to travel from client to server and back.

Response time: one RTT to initiate TCP

connection one RTT for HTTP

request response

total = 2RTT+transmit time

time to transmit file

initiate TCPconnection

RTT

requestfile

RTT

filereceived

time time

Page 31: Week2 lec3-bscs1

Persistent HTTP

Nonpersistent HTTP

Requires 2 RTTs per object

Maintain TCP buffers in both client and server

Burden on the Web Server

High overhead

Persistent HTTP Server leaves TCP

connection open after sending response

Subsequent HTTP messages between same client/server sent over open connection

Default mode is Persistent with pipelining

Page 32: Week2 lec3-bscs1

HTTP Request MessageTwo types of HTTP messages:

Request, ResponseHTTP request message:

Human-readable format

A typical HTTP request message

GET /somedir/page.html HTTP/1.1Host: www.someschool.edu User-agent: Mozilla/4.0Connection: close Accept-language:fr

(Blank Line) Body

Page 33: Week2 lec3-bscs1

HTTP Request Message

• Request Line First Line of HTTP request message The request line has three fields Method field can take on several values

GET,POST, PUT, DELETE etcMajority of HTTP request messages use GET

URL field HTTP version field

• Header Lines– Host: Host on which the object resides– User-agent: Identifies the client program e.g.

Mozilla/4.0– Connection: Shows whether the connection should be

closed or not– Accept-language: Shows the language the client

prefers

Page 34: Week2 lec3-bscs1

HTTP Request Message

• Body is empty with GET method • Used with the POST method

– Web page often includes form input– Input is sent to server in body

PUT method:• To upload objects to

web serverDELETE method• Allows a user or an

application to delete an object on web server

Find out about OPTIONS, TRACE, HEAD?