Presentation is loading. Please wait.

Presentation is loading. Please wait.

C. Williamson Wireless 2003 Tutorial1 Wireless Internet: Protocols and Performance Carey Williamson iCORE Professor Department of Computer Science University.

Similar presentations


Presentation on theme: "C. Williamson Wireless 2003 Tutorial1 Wireless Internet: Protocols and Performance Carey Williamson iCORE Professor Department of Computer Science University."— Presentation transcript:

1 C. Williamson Wireless 2003 Tutorial1 Wireless Internet: Protocols and Performance Carey Williamson iCORE Professor Department of Computer Science University of Calgary

2 C. Williamson Wireless 2003 Tutorial2 Tutorial Outline r 1. Introduction/Motivation (10 min) r 2. Networking Terminology (10 min) r 3. IEEE 802.11b WLANs (30 min) r 4. TCP (20 min) r 5. HTTP (15 min) r 6. Wireless TCP Performance: Part 1 (15 min) r 7. Wireless TCP Performance: Part 2 (15 min) r 8. Wireless Web Performance (30 min) r 9. Summary, Questions, Discussion (10 min) ---- Coffee Break Here ---- (10:30-10:45am)

3 C. Williamson Wireless 2003 Tutorial3 1. Wireless Internet: Introduction

4 C. Williamson Wireless 2003 Tutorial4 What Is Wireless Networking? r The use of infra-red (IR) or radio frequency (RF) signals to share information and resources between devices r A hot computer industry buzzword: m Lots of advertising by companies and media m Wireless Broadband, 3G wireless, 4G, WAP, iMode, Bluetooth, WiFi r Mobile Internet, Pervasive Computing, Nomadic Computing, M-commerce m Ubiquitous; Global; Revolutionary

5 C. Williamson Wireless 2003 Tutorial5 Two Popular 2.4 GHz Standards: r IEEE 802.11 m Fast (11b) m High Power m Long range m Single-purpose m Ethernet replacement m Easily Available Apple Airport, iBook, G4 Cisco Aironet 350 r Bluetooth m Slow m Low Power m Short range m Flexible m Cable replacement m “Vapourware” (?)

6 C. Williamson Wireless 2003 Tutorial6 IEEE 802.11 Organization Tree:

7 C. Williamson Wireless 2003 Tutorial7 Pros and Cons of 802.11: r Pro: m High bandwidth (up to 11 Mbps) m Two modes of operation: infrastructure vs. ad hoc r Con: m Incompatibility between old and new cards m Signal blocked by reinforced concrete or tinted glass m High channel BER can degrade performance (lots!) m No standard for hand-off between base stations m Some channel numbers overlap spectrum m High power consumption in laptops

8 C. Williamson Wireless 2003 Tutorial8 Bluetooth r Think USB, not Ethernet r Cable replacement technology r Created by Ericsson r PAN - Personal Area Network m 1-2 Mbps connections m 1600 hops per second FHSS m Includes synchronous, asynchronous, voice connections m Piconet routing r Small, low-power, short-range, cheap, versatile radios r Used as Internet connection, phone, or headset r Master/slave configuration and scheduling

9 C. Williamson Wireless 2003 Tutorial9 Security r Wireless sniffers, “war driving” r IEEE 802.11: m ESSID – Extended Services Set ID m WEP – Wired Equivalent Privacy (useless) m NAT - Network Address Translation (firewall) r Bluetooth Security m FHSS, with rapid hop sequence m Short range m Encrypted transmissions (optional)

10 C. Williamson Wireless 2003 Tutorial10 Guerrilla.net r An underground alternative to the wired Internet r A grassroots movement established in 1996 m 802.11 Wireless LAN cards m Roof mounted antennae m Free software (FreeBSD) r Multi-hop routing, Internet connectivity r About $500 per node (and dropping) r Other networks popping up in SF, Seattle, London

11 C. Williamson Wireless 2003 Tutorial11 Future of Wireless r Higher data rates r Better security r Wider selection of products r Lower prices r Zero configuration networking r More end-user focus r Better software r Less visible r More popular

12 C. Williamson Wireless 2003 Tutorial12 2. Background: Networking Terminology

13 C. Williamson Wireless 2003 Tutorial13 Wireless Internet Technologies r Mobile devices (e.g., notebooks, laptops, PDAs, cell phones, wearable computers) r Wireless network access m Bluetooth (1 Mbps, up to 3 meters) m IEEE 802.11b (11 Mbps, up to 100 meters) m IEEE 802.11a (55 Mbps, up to 20 meters) r Operating modes: m Infrastructure mode (access point) m Ad hoc mode r Wireless Web, WiFi “hot spots”

14 C. Williamson Wireless 2003 Tutorial14 Internet Protocol Stack r Application: supporting network applications and end-user services m FTP, SMTP, HTTP, DNS, NTP r Transport: end to end data transfer m TCP, UDP r Network: routing of datagrams from source to destination m IPv4, IPv6, BGP, RIP, routing protocols r Data Link: hop by hop frames, channel access, flow/error control m PPP, Ethernet, IEEE 802.11b r Physical: raw transmission of bits Application Transport Network Data Link Physical 001101011...

15 C. Williamson Wireless 2003 Tutorial15 Internet Protocol Stack r Application: m e.g., Hyper-Text Transfer Protocol (HTTP) r Transport: m Transmission Control Protocol (TCP) m User Datagram Protocol (UDP) r Network: m Internet Protocol (IP, IPv4, IPv6) r Data Link: m e.g., IEEE 802.3 Ethernet, IEEE 802.11b r Physical: m Device specific, network specific Application Transport Network Data Link Physical 001101011...

16 C. Williamson Wireless 2003 Tutorial16 Multi-Hop Wireless Ad Hoc Networks r Routing protocols used to improve wireless connections r Infrastructure-free, dynamic r True Peer-to-Peer routing r Fault tolerant r Examples: AODV, DSDV, TORA, DSR,...

17 C. Williamson Wireless 2003 Tutorial17 Example: r Multi-hop “ad hoc” networking Carey Kelly

18 C. Williamson Wireless 2003 Tutorial18 3. IEEE 802.11b Wireless LANs

19 C. Williamson Wireless 2003 Tutorial19 The Basics r In several respects, the IEEE 802.11b wireless LAN (WLAN) standard is similar to that for IEEE 802.3 (Ethernet) LANs r Similarities: m LAN; limited geographic coverage; multiple stations; shared transmission medium; CSMA- based Medium Access Control protocol; 48-bit MAC addresses; comparable data rates (11 Mbps vs 10 Mbps)

20 C. Williamson Wireless 2003 Tutorial20 The Basics (Cont’d) r But there are also distinct differences: m wireless (air interface) versus wired (coax) m wireless propagation environment (multipath) m higher error rate due to interference, etc. m successful frames are ACKed by receiver m mobile stations; “hidden node” problem; potential asymmetries m CSMA/CA versus CSMA/CD m multiple data transmission rates (1, 2, 5.5, 11)

21 C. Williamson Wireless 2003 Tutorial21 Some Features r Infrastructure mode vs “ad hoc” mode r Access Point (AP) sends “beacon frames” m Mobiles choose AP based on signal strength r Multiple channel access protocols supported m CSMA/CA (DCF); PCF; RTS/CTS r MAC-layer can provide error control, retransmission, rate adaptation, etc. r Direct Sequence Spread Spectrum (DSSS) m signal spread across 14 22-MHz channels

22 C. Williamson Wireless 2003 Tutorial22 Where Does Wireless RF Live? ISM Band: Industrial, Scientific, Medical 902-928 MHz 2400-2483.5 MHz 5725-5850 MHz 802.11/802.11b 802.11a Bluetooth Cordless Phones Home RF Baby Monitors Microwave Ovens Old Wireless

23 C. Williamson Wireless 2003 Tutorial23 Where does 802.11 live in the OSI? Telnet, FTP, Email, Web, etc. IP, ICMP, IPX TCP, UDP Logical Link Control - 802.2 (Interface to the upper layer protocols) MAC 802.3, 802.5, 802.11 Physical Layer Convergence Protocol LAN: 10BaseT, 10Base2, 10BaseFL WLAN: FHSS, DSSS, IR Application Presentation Session Transport Network Data Link Physical Wireless lives at Layers 1 & 2 only!

24 C. Williamson Wireless 2003 Tutorial24 Wireless Cells 11 Mbps bandwidth “shared” by all devices in the Cell! Access Point coverage area is called a “Cell” Range per Access Point is 100m Access Point Channel 6 ESSID: NAI In Canada/US, there are eleven 802.11 channels Only channels 1, 6 and 11 are non-overlapping Each Access Point coverage area is called a “Cell” Computers can roam between cells

25 C. Williamson Wireless 2003 Tutorial25 Wireless Cells Computers can roam between cells 1 6 11 1 1

26 C. Williamson Wireless 2003 Tutorial26 CSMA-CA + Acknowledgement Carrier Sense Multiple Access with Collision Avoidance Device wanting to transmit senses the medium (Air) If medium is busy - defers If medium is free for certain period (DIFS) - transmits frame How CSMA-CA works: Latency can increase if “air” is very busy! Device has hard time finding “open air” to send frame! * DIFS - Distributed Inter-Frame Space (approx 128 µs)

27 C. Williamson Wireless 2003 Tutorial27 CSMA-CA + Acknowledgement Carrier Sense Multiple Access with Collision Avoidance * SIFS - Short Inter-Frame Space (approx 28 µs) Every frame is ack’ed - except broadcast and multicast! “Air” is free for DIFS time period Receive ACK back that frame was received intact! send frame source destination others DIFS SIFS All other devices must defer while “air” is busy data ack NAV: defer access

28 C. Williamson Wireless 2003 Tutorial28 MAC-Layer Retransmission r If no ACK received “right away”, then the sender retransmits the frame again at the MAC layer m indicates frame (or ACK) was lost/corrupted m very short timeout (e.g., 1 msec) m exponential backoff (doubling) if repeated loss r Typically recovers before TCP would notice r Max retransmission limit (e.g., 8) r May do MAC-layer rate adaptation or frame fragmentation if channel error rate is high

29 C. Williamson Wireless 2003 Tutorial29 Other MAC Protocols Supported r Point Coordination Function (PCF) m AP polls stations in turn to see if frames to send m useful for real-time traffic r Request-To-Send/Clear-To-Send (RTS/CTS) m reservation-based approach (ask permission) m useful for very large frames m useful for solving the “hidden node” problem m request asks for clearance (permission) to send m request also indicates time required for transmit

30 C. Williamson Wireless 2003 Tutorial30 Frame Formats r Two frame formats available: m long preamble m short preamble r Configuration option for NIC and AP r Variable-size frames (max 2312 data bytes) r 16-bit Cyclic Redundancy Code (CRC) for error checking of frames

31 C. Williamson Wireless 2003 Tutorial31 Long Preamble Long Preamble = 144 bits Interoperable with older 802.11 devices Entire Preamble and 48 bit PLCP Header sent at 1 Mbps 128 bit Preamble (Long) 16 bit Start Frame Delimiter Signal Speed 1,2,5.5, 11 Mbps Service (unused) Length of Payload 16 bit CRC Payload 0-2312 bytes Transmitted at 1 Mbps Transmitted at X Mbps

32 C. Williamson Wireless 2003 Tutorial32 Short Preamble Short Preamble = 72 bits Preamble transmitted at 1 Mbps PLCP Header transmitted at 2 Mbps more efficient than long preamble 56 bit Preamble Payload 0-2312 bytes Transmitted at 1 Mbps 16 bit Start Frame Delimiter Signal Speed 1,2,5.5, 11 Mbps Service (unused) Length of Payload 16 bit CRC Transmitted at 2 Mbps Transmitted at X Mbps

33 C. Williamson Wireless 2003 Tutorial33 Even More Features r Power Management m mobile nodes can “sleep” to save power m AP will buffer frames until client requests them m AP can use virtual bitmap field in beacons to indicate which stations have data waiting r Security m Wired Equivalent Privacy (WEP) m not secure at all!

34 C. Williamson Wireless 2003 Tutorial34 Summary r IEEE 802.11b (WiFi) is a wireless LAN technology that is rapidly growing in popularity r Convenient, inexpensive, easy to use r Growing number of “hot spots” everywhere m airports, hotels, bookstores, Starbucks, etc r Estimates: 70% of WLANs are insecure!

35 C. Williamson Wireless 2003 Tutorial35 4. TCP 101: Transmission Control Protocol

36 C. Williamson Wireless 2003 Tutorial36 Tutorial: TCP 101 r The Transmission Control Protocol (TCP) is the protocol that sends your data reliably r Used for email, Web, ftp, telnet, p2p,… r Makes sure that data is received correctly: right data, right order, exactly once r Detects and recovers from any problems that occur at the IP network layer r Mechanisms for reliable data transfer: sequence numbers, acknowledgements, timers, retransmissions, flow control...

37 C. Williamson Wireless 2003 Tutorial37 TCP 101 (Cont’d) r TCP is a connection-oriented protocol SYN SYN/ACK ACK GET URL YOUR DATA HERE FIN FIN/ACK ACK Web ClientWeb Server

38 C. Williamson Wireless 2003 Tutorial38 TCP 101 (Cont’d) r TCP slow-start and congestion avoidance ACK

39 C. Williamson Wireless 2003 Tutorial39 TCP 101 (Cont’d) r TCP slow-start and congestion avoidance ACK

40 C. Williamson Wireless 2003 Tutorial40 TCP 101 (Cont’d) r TCP slow-start and congestion avoidance ACK

41 C. Williamson Wireless 2003 Tutorial41 TCP 101 (Cont’d) r This (exponential growth) “slow start” process continues until either: m packet loss: after a brief recovery phase, you enter a (linear growth) “congestion avoidance” phase based on slow-start threshold found m limit reached: slow-start threshold, or maximum advertised receive window size m all done: terminate connection and go home

42 C. Williamson Wireless 2003 Tutorial42 Tutorial: TCP 201 r There is a beautiful way to plot and visualize the dynamics of TCP behaviour r Called a “TCP Sequence Number Plot” r Plot packet events (data and acks) as points in 2-D space, with time on the horizontal axis, and sequence number on the vertical axis r Example: Consider a 14-packet transfer

43 C. Williamson Wireless 2003 Tutorial43 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +

44 C. Williamson Wireless 2003 Tutorial44 So What? r What can it tell you? r Everything!!!

45 C. Williamson Wireless 2003 Tutorial45 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + RTT

46 C. Williamson Wireless 2003 Tutorial46 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + TCP Seg. Size

47 C. Williamson Wireless 2003 Tutorial47 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + TCP Connection Duration

48 C. Williamson Wireless 2003 Tutorial48 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Num Bytes Sent

49 C. Williamson Wireless 2003 Tutorial49 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Avg Throughput (Bytes/Sec) Bytes Sec

50 C. Williamson Wireless 2003 Tutorial50 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Access Network Bandwidth (Bytes/Sec)

51 C. Williamson Wireless 2003 Tutorial51 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + Sender’s Flow Control Window Size

52 C. Williamson Wireless 2003 Tutorial52 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + + TCP Slow Start

53 C. Williamson Wireless 2003 Tutorial53 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + Delayed ACK

54 C. Williamson Wireless 2003 Tutorial54 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X + + + + + + + ++ + + Packet Loss Duplicate ACK

55 C. Williamson Wireless 2003 Tutorial55 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X + + + + + + + + + + X + Retransmit Cumulative ACK +

56 C. Williamson Wireless 2003 Tutorial56 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X + + + + + + + + + + X + RTO +

57 C. Williamson Wireless 2003 Tutorial57 TCP 201 (Cont’d) r What happens when a packet loss occurs? r Quiz Time... m Consider a 14-packet Web document m For simplicity, consider only a single packet loss

58 C. Williamson Wireless 2003 Tutorial58 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +

59 C. Williamson Wireless 2003 Tutorial59 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + + + + ?

60 C. Williamson Wireless 2003 Tutorial60 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + + + + X +

61 C. Williamson Wireless 2003 Tutorial61 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +

62 C. Williamson Wireless 2003 Tutorial62 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + + + ?

63 C. Williamson Wireless 2003 Tutorial63 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + ++ + + +

64 C. Williamson Wireless 2003 Tutorial64 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +

65 C. Williamson Wireless 2003 Tutorial65 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + + + ?

66 C. Williamson Wireless 2003 Tutorial66 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X + + + + + + + ++++ + X +

67 C. Williamson Wireless 2003 Tutorial67 Time SeqNum X + Key: X Data Packet + Ack Packet X X X X X X X X X X X X X + + + + + + + + + + + + +

68 C. Williamson Wireless 2003 Tutorial68 Time SeqNum X + Key: X Data Packet + Ack Packet X + ?

69 C. Williamson Wireless 2003 Tutorial69 Time SeqNum X + Key: X Data Packet + Ack Packet X X X + + + X X X + + + X + X + X +

70 C. Williamson Wireless 2003 Tutorial70 TCP 201 (Cont’d) r Main observation: m “Not all packet losses are created equal” r Losses early in the transfer have a huge adverse impact on the transfer latency r Losses near the end of the transfer always cost at least a retransmit timeout r Losses in the middle may or may not hurt, depending on congestion window size at the time of the loss

71 C. Williamson Wireless 2003 Tutorial71 Congratulations! r You are now a TCP expert!

72 C. Williamson Wireless 2003 Tutorial72 5. HTTP: HyperText Transfer Protocol

73 C. Williamson Wireless 2003 Tutorial73 Introduction to HTTP r HTTP: HyperText Transfer Protocol m Communication protocol between clients and servers m Application layer protocol for WWW r Client/Server model: m Client: browser that requests, receives, displays object m Server: receives requests and responds to them r Protocol consists of various operations m Few for HTTP 1.0 (RFC 1945, 1996) m Many more in HTTP 1.1 (RFC 2616, 1999) Laptop w/ Netscape Server w/ Apache Desktop w/ Explorer http request http response

74 C. Williamson Wireless 2003 Tutorial74 Request Generation r User clicks on something r Uniform Resource Locator (URL): m http://www.cnn.com m http://www.cpsc.ucalgary.ca m https://www.paymybills.com m ftp://ftp.kernel.org r Different URL schemes map to different services r Hostname is converted from a name to a 32-bit IP address (DNS lookup, if needed) r Connection is established to server (TCP)

75 C. Williamson Wireless 2003 Tutorial75 What Happens Next? r Client downloads HTML document m Sometimes called “container page” m Typically in text format (ASCII) m Contains instructions for rendering (e.g., background color, frames) m Links to other pages r Many have embedded objects: m Images: GIF, JPG (logos, banner ads) m Usually automatically retrieved I.e., without user involvement can control sometimes (e.g. browser options, junkbusters) <meta name=“Author” content=“Erich Nahum”> Linux Web Server Performance Hi There! Here’s lots of cool linux stuff! Click here for more! sample html file

76 C. Williamson Wireless 2003 Tutorial76 Web Server Role r Respond to client requests, typically a browser m Can be a proxy, which aggregates client requests (e.g., AOL) m Could be search engine spider or robot (e.g., Keynote) r May have work to do on client’s behalf: m Is the client’s cached copy still good? m Is client authorized to get this document? r Hundreds or thousands of simultaneous clients r Hard to predict how many will show up on some day (e.g., “flash crowds”, diurnal cycle, global presence) r Many requests are in progress concurrently

77 C. Williamson Wireless 2003 Tutorial77 HTTP Request Format GET /images/penguin.gif HTTP/1.0 User-Agent: Mozilla/0.9.4 (Linux 2.2.19) Host: www.kernel.org Accept: text/html, image/gif, image/jpeg Accept-Encoding: gzip Accept-Language: en Accept-Charset: iso-8859-1,*,utf-8 Cookie: B=xh203jfsf; Y=3sdkfjej Messages are in ASCII (human-readable) Carriage-return and line-feed indicate end of headers Headers may communicate private information (browser, OS, cookie information, etc.)

78 C. Williamson Wireless 2003 Tutorial78 Request Types Called Methods: r GET: retrieve a file (95% of requests) r HEAD: just get meta-data (e.g., mod time) r POST: submitting a form to a server r PUT: store enclosed document as URI r DELETE: removed named resource r LINK/UNLINK: in 1.0, gone in 1.1 r TRACE: http “echo” for debugging (added in 1.1) r CONNECT: used by proxies for tunneling (1.1) r OPTIONS: request for server/proxy options (1.1)

79 C. Williamson Wireless 2003 Tutorial79 Response Format HTTP/1.0 200 OK Server: Tux 2.0 Content-Type: image/gif Content-Length: 43 Last-Modified: Fri, 15 Apr 1994 02:36:21 GMT Expires: Wed, 20 Feb 2002 18:54:46 GMT Date: Mon, 12 Nov 2001 14:29:48 GMT Cache-Control: no-cache Pragma: no-cache Connection: close Set-Cookie: PA=wefj2we0-jfjf Similar format to requests (i.e., ASCII)

80 C. Williamson Wireless 2003 Tutorial80 Response Types r 1XX: Informational (def’d in 1.0, used in 1.1) 100 Continue, 101 Switching Protocols r 2XX: Success 200 OK, 206 Partial Content r 3XX: Redirection 301 Moved Permanently, 304 Not Modified r 4XX: Client error 400 Bad Request, 403 Forbidden, 404 Not Found r 5XX: Server error 500 Internal Server Error, 503 Service Unavailable, 505 HTTP Version Not Supported

81 C. Williamson Wireless 2003 Tutorial81 Outline of an HTTP Transaction r This section describes the basics of servicing an HTTP GET request from user space r Assume a single process running in user space, similar to Apache 1.3 r We’ll mention relevant socket operations along the way initialize; forever do { get request; process; send response; log request; } server in a nutshell

82 C. Williamson Wireless 2003 Tutorial82 Readying a Server r First thing a server does is notify the OS it is interested in WWW server requests; these are typically on TCP port 80. Other services use different ports (e.g., SSL is on 443) r Allocate a socket and bind()'s it to the address (port 80) r Server calls listen() on the socket to indicate willingness to receive requests r Calls accept() to wait for a request to come in (and blocks) r When the accept() returns, we have a new socket which represents a new connection to a client s = socket(); /* allocate listen socket */ bind(s, 80); /* bind to TCP port 80 */ listen(s); /* indicate willingness to accept */ while (1) { newconn = accept(s); /* accept new connection */b

83 C. Williamson Wireless 2003 Tutorial83 Processing a Request r getsockname() called to get the remote host name m for logging purposes (optional, but done by most) r gethostbyname() called to get name of other end m again for logging purposes r gettimeofday() is called to get time of request m both for Date header and for logging r read() is called on new socket to retrieve request r request is determined by parsing the data m “GET /images/jul4/flag.gif” remoteIP = getsockname(newconn); remoteHost = gethostbyname(remoteIP); gettimeofday(currentTime); read(newconn, reqBuffer, sizeof(reqBuffer)); reqInfo = serverParse(reqBuffer);

84 C. Williamson Wireless 2003 Tutorial84 Processing a Request (cont) r stat() called to test file path m to see if file exists/is accessible m may not be there, may only be available to certain people m "/microsoft/top-secret/plans-for-world-domination.html" r stat() also used for file meta-data m e.g., size of file, last modified time m "Has file changed since last time I checked?“ r might have to stat() multiple files and directories r assuming all is OK, open() called to open the file fileName = parseOutFileName(requestBuffer); fileAttr = stat(fileName); serverCheckFileStuff(fileName, fileAttr); open(fileName);

85 C. Williamson Wireless 2003 Tutorial85 Responding to a Request r read() called to read the file into user space r write() is called to send HTTP headers on socket (early servers called write() for each header!) r write() is called to write the file on the socket r close() is called to close the socket r close() is called to close the open file descriptor r write() is called on the log file read(fileName, fileBuffer); headerBuffer = serverFigureHeaders(fileName, reqInfo); write(newSock, headerBuffer); write(newSock, fileBuffer); close(newSock); close(fileName); write(logFile, requestInfo);

86 C. Williamson Wireless 2003 Tutorial86 Network View: HTTP and TCP r TCP is a connection-oriented protocol SYN SYN/ACK ACK GET URL YOUR DATA HERE FIN FIN/ACK ACK Web ClientWeb Server

87 C. Williamson Wireless 2003 Tutorial87 Example Web Page Harry Potter Movies As you all know, the new HP book will be out in June and then there will be a new movie shortly after that… “Harry Potter and the Bathtub Ring” page.html hpface.jpg castle.gif

88 C. Williamson Wireless 2003 Tutorial88 Client Server The “classic” approach in HTTP/1.0 is to use one HTTP request per TCP connection, serially. TCP SYN TCP FIN page.html G TCP SYN TCP FIN hpface.jpg G TCP SYN TCP FIN castle.gif G

89 C. Williamson Wireless 2003 Tutorial89 Client Server Concurrent (parallel) TCP connections can be used to make things faster. TCP SYN TCP FIN page.html G castle.gif G F S G hpface.jpg S F C S C S

90 C. Williamson Wireless 2003 Tutorial90 Client Server The “persistent HTTP” approach can re-use the same TCP connection for Multiple HTTP transfers, one after another, serially. Amortizes TCP overhead, but maintains TCP state longer at server. TCP FIN Timeout TCP SYN page.html G hpface.jpg G castle.gif G

91 C. Williamson Wireless 2003 Tutorial91 Client Server The “pipelining” feature in HTTP/1.1 allows requests to be issued asynchronously on a persistent connection. Requests must be processed in proper order. Can do clever packaging. TCP FIN Timeout TCP SYN page.html G castle.gif hpface.jpg GG

92 C. Williamson Wireless 2003 Tutorial92 Summary of Web and HTTP r The major application on the Internet m Majority of traffic is HTTP (or HTTP-related) r Client/server model: m Clients make requests, servers respond to them m Done mostly in ASCII text (helps debugging!) r Various headers and commands m Too many to go into detail here m Many web books/tutorials exist (e.g., Krishnamurthy & Rexford 2001)

93 C. Williamson Wireless 2003 Tutorial93 6. Wireless TCP: Performance Issues (Part 1)

94 C. Williamson Wireless 2003 Tutorial94 Example #1 r Wireless TCP Performance Problems Wired Internet Wireless Access High capacity, low error rate Low capacity, high error rate Hard to distinguish losses here from losses here

95 C. Williamson Wireless 2003 Tutorial95 Example #1 (Cont’d) r Solution: “wireless-aware TCP” (I-TCP, ProxyTCP, Snoop-TCP, split connections...)

96 C. Williamson Wireless 2003 Tutorial96 Example #2 r Wireless TCP Fairness Problems Wired Internet Wireless Bottleneck ACK DATA ACK D U AP Loss of ACK = Loss of DATA

97 C. Williamson Wireless 2003 Tutorial97 Example #3 r Multi-hop “ad hoc” networking Carey Kelly

98 C. Williamson Wireless 2003 Tutorial98 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

99 C. Williamson Wireless 2003 Tutorial99 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

100 C. Williamson Wireless 2003 Tutorial100 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

101 C. Williamson Wireless 2003 Tutorial101 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

102 C. Williamson Wireless 2003 Tutorial102 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

103 C. Williamson Wireless 2003 Tutorial103 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

104 C. Williamson Wireless 2003 Tutorial104 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

105 C. Williamson Wireless 2003 Tutorial105 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

106 C. Williamson Wireless 2003 Tutorial106 Example #3 (Cont’d) r Multi-hop “ad hoc” networking Carey Kelly

107 C. Williamson Wireless 2003 Tutorial107 Example #3 (Cont’d) r Two interesting subproblems: m Dynamic ad hoc routing: node movement can disrupt the IP routing path at any time, disrupting TCP connection; yet another way to lose packets!!!; possible solution: Explicit Loss Notification (ELN)? Handoff? Route prediction? m TCP flow control: the bursty nature of TCP packet transmissions can create contention for the shared wireless channel among forwarding nodes; collisions between DATA and ACKs possible solution: rate-based flow control? Burst mode? Spatial reuse of channels?

108 C. Williamson Wireless 2003 Tutorial108 Summary of Wireless TCP r TCP is the “four wheel drive” of TP’s r Wireless is a newly emerging technology with rapidly growing deployment popularity r “TCP” and “Wireless” don’t fit together all that well r Making TCP smarter about wireless helps!

109 C. Williamson Wireless 2003 Tutorial109 7. Wireless TCP: Performance Issues (Part 2)

110 C. Williamson Wireless 2003 Tutorial110 Motivation r TCP performance often degrades over wireless networks; reasons “well-known” r Solutions to improve TCP performance over wireless links exist, but how well do they work in a real wireless LAN environment? r How do link-layer mechanisms interact with TCP and affect the overall performance? r Where is the bottleneck in the network protocol processing path, and why?

111 C. Williamson Wireless 2003 Tutorial111 Background - TCP r Widely used on the Internet (e.g. Web) r Connection-oriented, reliable byte stream r Window-based flow control r Slow start and congestion avoidance r Fast retransmission, fast recovery r Other extensions, including TCP SACK r Many different versions in use

112 C. Williamson Wireless 2003 Tutorial112 Background – IEEE 802.11b r An “Ethernet-like” LAN standard (11 Mbps) r Infrastructure mode and ad hoc mode r Carrier-sense multiple access with collision avoidance (CSMA/CA) to reduce collisions r MAC-layer: positive acknowledgment and retransmissions (to recover from channel errors) r Dynamic rate adaptation: can choose data transmission rate of 1, 2, 5.5, or 11 Mbps

113 C. Williamson Wireless 2003 Tutorial113 Background – USB r Widely used industry standard for connecting a computer to its peripherals (bus topology) r Lots of USB-based (wireless) network cards r Data transfers managed by Host Controller (HC) r Synchronous bus: 1 msec slots for transfers r Transfer requests are handled using vertical and horizontal linked-list data structures r Two processing modes for HC: m Breadth-First or Depth-First r High Speed Bandwidth Reclamation (HSBR)

114 C. Williamson Wireless 2003 Tutorial114 Background – USB (cont’d) r Queued mode (keep HC busy) r Transfer size: 64 – 1023 bytes each DF BF

115 C. Williamson Wireless 2003 Tutorial115 Background – USB (cont’d) r Queued mode (keep HC busy) r Transfer size: 64 – 1023 bytes each FSBR

116 C. Williamson Wireless 2003 Tutorial116 Experimental Methodology r Experimental Setup (HW/SW) m Laptop – Compaq Evo 719c with multiport USB wireless card (Linux 2.4) m Access point – Lucent RG-1000 m Stationary host on Ethernet LAN – SunOS 5.8 m Run netperf on laptop and netserver on wired host m SnifferPro 4.6 wireless “sniffer” and tcpdump r Experimental Factors m USB mode, driver settings m Wireless channel (distance) between laptop and AP netserver Ethernet AP netperf Sniffer data acks laptops tcpdump

117 C. Williamson Wireless 2003 Tutorial117 Initial Result r Windows 2000 implementation of TCP is more than 3 times faster than Linux TCP! r Reason: Linux driver bug (2 Mbps vs 11 Mbps) OS Linux Windows 2000 1.52 Mbps 5.11 Mbps Throughput

118 C. Williamson Wireless 2003 Tutorial118 Results – USB Experiments

119 C. Williamson Wireless 2003 Tutorial119 Results – USB Experiments r With FSBR disabled, USB is the bottleneck r With FSBR enabled (the default in Linux), the wireless network is the bottleneck r Queued mode makes no difference with FSBR on, but helps when FSBR is turned off r Queued mode (even with FSBR turned on) may be very important when higher speed wireless link is used (e.g. IEEE 802.11a)

120 C. Williamson Wireless 2003 Tutorial120 Results – Wireless Problems r We observed unusually high collision rates on the wireless channel for TCP transfers, which we call the TCP data/ACK collision problem m Scenario: laptop and AP are 1 m apart m For TCP, MAC-layer retransmit rate: 4.58-4.73% m For UDP, MAC-layer retransmit rate: 0.47-0.98% m In general, a retransmission rate of 1.75%-7.2% has been seen for other vendor HW/SW (N = 1) m For TCP, disabling MAC-layer retransmission degrades throughput by 23%

121 C. Williamson Wireless 2003 Tutorial121 Results – Wireless Problems r The MAC-layer rate adaptation problem m Scenario: laptop and AP are 100 m apart m Lousy TCP throughput, lots of retransmits m Reason: the multiplicative increase and multiplicative decrease (MIMD) bandwidth probing mechanism causes network thrashing and wastes battery power m The small congestion window causes temporary deadlock if the TCP receiver uses delayed Ack

122 C. Williamson Wireless 2003 Tutorial122 Results – Wireless Problems (MAC-layer rate adaptation)

123 C. Williamson Wireless 2003 Tutorial123 Summary of Observations r TCP performance on WLAN can be wacky! (at least for Compaq Multiport 802.11b USB wireless card under Linux 2.4) r Several factors can affect overall performance m Poorly configured USB bus could be the bottleneck m Linux TCP implementation bug makes TCP unable to recognize the first spurious timeout m Poor MAC-layer rate adaptation algorithm can cause a “network thrashing” problem m TCP’s data/ACK structure may induce excessive collisions at the MAC layer on wireless LANs

124 C. Williamson Wireless 2003 Tutorial124 7. Wireless Web: Performance Issues

125 C. Williamson Wireless 2003 Tutorial125 Introduction and Motivation  Observation: the same wireless technology that allows a Web client to be mobile also allows Web servers to be mobile  Idea: portable, short-lived, ad hoc networks  Possible applications: o classroom area networks, seminars o press conferences, media events o sporting events, gaming, exhibitions o conferences and trade shows o disaster recovery sites, field work, etc.

126 C. Williamson Wireless 2003 Tutorial126 Objectives  to assess feasibility of portable networks  to benchmark the performance capabilities and limitations of an Apache Web server in a wireless ad hoc network  to identify the performance bottlenecks  to understand impacts of different factors o number of clients o Web object size o persistent connections o transmit power (energy consumption) o wireless channel conditions

127 C. Williamson Wireless 2003 Tutorial127 Experimental Setup Compaq Notebooks (1.2GHz Pentium III, 128MB RAM, 512 KB L2 cache, Cisco Aironet 350 network cards) RedHat Linux 7.3, httperf, Apache 1.3.23, SnifferPro 4.6 Network: 11 Mbps IEEE 802.11b wireless LAN, ad hoc mode

128 C. Williamson Wireless 2003 Tutorial128 Experimental Setup (Cont’d) IEEE 802.11b: a standard for wireless LANs Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA), up to 11 Mbps data rate at physical layer ad hoc mode frames are addressed directly from sender to receiver httperf Web benchmarking software tool developed at HP Labs Web server: Apache (version 1.3.23) Process-based, flexible, powerful, HTTP/1.1-compliant SnifferPro 4.6 real-time capture, recording all wireless channel activity, enabling protocol analysis at MAC, IP, TCP and HTTP layers

129 129 Experimental Design Factor Levels Number of Clients 1, 2, 4 HTTP Transaction Rate (per-client)10, 20, 30, …, 160 HTTP Transfer Size (KB)1, 2, 4, 8, …, 100 Persistent Connectionsno, yes HTTP Requests per Connection1, 5, 10, 15, …, 60 Transmit Power (mW)1, 5, 20, 30, 50, 100 Client-Server Distance (m)1, 10, 100 Impacts of different factors on wireless Web server performance (one-factor-at-a-time) Experimental Factors and Levels Performance metrics – HTTP transaction rate, throughput, response time, error rate at Application Layer, – TCP connection duration at Network Layer – Transmit queue behaviour at Link Layer,

130 C. Williamson Wireless 2003 Tutorial130 Experiment 1: Request Rate Purpose : to determine the range of feasible and sustainable loads for the wireless Web server Design : Number of Clients: 1 HTTP transaction rate: 10, 20, …, 160 req/sec HTTP transfer size: 1 KB (fixed) Persistent connections: no Transmit power: 100 mW Client-server distance: 1 meter (on same desk)

131 C. Williamson Wireless 2003 Tutorial131 Wireless Web Performance at Application Layer Main observation: As the offered load increases: linear increase  instability  lower plateau Peak throughput < 1 Mbps for 1 KB transfers

132 C. Williamson Wireless 2003 Tutorial132 Experiment 2: Transfer Size Purpose : to study impact of HTTP response size Design : Number of Clients: 1 HTTP transaction rate: 10 req/sec (fixed) HTTP transfer size (KB): 1, 2, 4, 8, … Persistent connections: no Transmit power: 100 mW Client-server distance: 1 meter (on same desk)

133 C. Williamson Wireless 2003 Tutorial133 Light load: 8 KB Duration: 24 msec Throughput: 2.8 Mbps Overload: 64 KB Duration: >100 msec Throughput: 4.1 Mbps Medium load: 32 KB Duration: 67 msec Throughput: 3.9 Mbps Measurement at Network Layer

134 C. Williamson Wireless 2003 Tutorial134 Experiment 3: Persistent Connections Persistent Connections: Multiple HTTP transactions can be sent on the same TCP connection. amortize overhead of TCP connection processing reduce memory consumption for TCP state Purpose of this experiment: to study impact of persistent connection on wireless Web performance Design: Number of Clients: 1 and 2 HTTP transaction rate: 10 req/sec (fixed) HTTP transfer size: 1 KB (fixed) Persistent connections: yes Transmit power: 100 mW Client-server distance: 1 meter (on same desk)

135 C. Williamson Wireless 2003 Tutorial135 Achieved Throughput for Experiment with Persistent Connections Main observation: Peak throughput: 3.22 Mbps, 3.5x improvement over non-persistent connections (0.9 Mbps), two clients share the server and network resources equally

136 C. Williamson Wireless 2003 Tutorial136 Summary and Conclusions  What we did: wireless Web server, portable nw Application-layer measurements (httperf) Network-layer measurements (Wireless Sniffer)  Our results show: Server capability: 100 conn/sec for non-persistent HTTP with throughputs up to 4 Mbps (adequate?) Bottleneck: at wireless network interface Some “network thrashing” for large HTTP transfers when the network utilization is high (aborts, resets) Effect of wireless channel on performance at TCP and HTTP-level (MAC-layer retransmits) Power consumption issue for mobile client and server

137 C. Williamson Wireless 2003 Tutorial137 8. Summary, Questions, and Discussion

138 C. Williamson Wireless 2003 Tutorial138 Credits r Thanks to the following people for the use of their slides and/or knowledge: m David Schwab, U of Saskatchewan m Erich Nahum, IBM m Sniffer Technologies m Network Associates m IEEE m Guangwei Bai and Tianbo Kuang,U of C


Download ppt "C. Williamson Wireless 2003 Tutorial1 Wireless Internet: Protocols and Performance Carey Williamson iCORE Professor Department of Computer Science University."

Similar presentations


Ads by Google