Powerpoint

Introduction to Networking and Wireless Networks Professor Jim ...

You must be logged in to download this document
Reviews
Shared by: moti
Stats
views:
80
rating:
not rated
reviews:
0
posted:
11/20/2008
language:
English
pages:
0
Introduction to Networking and Wireless Networks Department of Computer Science University of Massachusetts http://www.cs.umass.edu/~kurose Brian Donovan, Tim Ireland, Adam Nyzio Professor Jim Kurose UPRM, January 23, 24, 2006 Class website: http://gaia.cs.umass.edu/uprm Introduction 1-1 What is this course about?  quick introduction to principles of networking,    Internet, particularly wireless (802.11) networking learn practice of computer networking: day two “in the field” assume: no previous background in networking questions/comments: lots, hopefully Who am I? Who are you? Computer Networking: A Top Down Approach Featuring the Internet, J. Kurose & K. Ross Addison Wesley, 3rd ed., 2004   Introduction 1-2 Overview: Part 1: Whirlwind Introduction to Networking (Monday)     9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks Part 2: In the field (Tuesday)  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-3 A top-down approach: networking “top-down”  end-system applications, end-end transport  network core: routing, hooking nets together Ethernet, 802.11  link-level protocols, e.g., Introduction 1-4 Part 1: Networking Overview Our goal:  get “feel” and Overview:  what‟s the Internet terminology  more depth, detail later in course  approach:  use Internet as example  what‟s a protocol?  network edge  network core  access net, physical media  Internet/ISP structure  performance: loss, delay  protocol layers, service model Introduction 1-5 What is the Internet? Collection of end-systems running networked applications, inter-connected together by routers and links, controlled by network protocols Introduction 1-6 What is the Internet: end systems … not just computers Internet phones Web-enabled toaster + weather report local ISP regional ISP IP picture frame http://www.ceiva.com/ Blackberry world’s smallest web server Photo courtesy U. Mass radar! company network Introduction 1-7 What is the Internet: routers, links Routers: forward packets (chunks of data) Links: physical transport  local ISP wide variety of media, speeds Cat 5/6 twisted pair 10Mbps – 10Gbps regional ISP satellite (10’s Mbps) Wi-Fi (10-54 Mbps) Optical fiber (10Gbps) Point-point wireless (10-54 Mpbs) Cable (1-5Mbps) company network Introduction 1-8 What‟s a protocol? a human protocol and a computer network protocol: Hi Hi Got the time? TCP connection request TCP connection response Get http://www.awl.com/kurose-ross 2:00 time Introduction 1-9 What‟s a protocol? human protocols:  “what‟s the time?”  “I have a question”  introductions … specific msgs sent … specific actions taken when msgs received, or other events Question: Other human protocols network protocols:  machines rather than humans  all communication activity in Internet governed by protocols (I‟ll tell you networking equivalent) protocols define format, order of msgs sent and received among network entities, and actions taken on msg transmission, receipt Introduction 1-10 What‟s the Internet: “nuts and bolts” view  protocols control sending, receiving of msgs  router server local ISP workstation  Internet: “network of networks”  e.g., TCP, IP, HTTP, FTP, 802.11 mobile   Internet standards  RFC: Request for comments  IETF: Internet Engineering Task Force loosely hierarchical public Internet versus private intranet regional ISP company network Introduction 1-11 So this course will be about:  applications, end system  routers  links running in applications, end systems, routers, links (think “software control”) protocols …with a special emphasis on 802.11 wireless networks, with an eye towards UPRM CASA student radar testbed Introduction 1-12 The network edge:  end systems (hosts):    run application programs e.g. Web, email at “edge of network” client host requests, receives service from always-on server e.g. Web browser/server; email client/server  client/server model    peer-peer model:   minimal (or no) use of dedicated servers e.g. Skype, BitTorrent, KaZaA Introduction 1-13 Network Core: Packet Switching each end-end data stream divided into packets  user A, B packets share network resources  each packet uses full link bandwidth  resources used as needed resource contention:  aggregate resource demand can exceed amount available  congestion: packets queue, wait for link use Bandwidth division into “pieces” Dedicated allocation Resource reservation Introduction 1-14 Packet Switching: Statistical Multiplexing A B 100 Mb/s Ethernet statistical multiplexing 1.5 Mb/s C queue of packets waiting for output link D E statistical multiplexing:  sharing of bandwidth on demand  no fixed allocation of bandwidth to users Introduction 1-15 Packet switching versus circuit switching Packet switching allows more users to use network!  1 Mb/s link  each user:  100 kb/s when “active”  active 10% of time  circuit-switching:  10 users  packet switching:  with 35 users, probability > 10 active less than .0004 N users 1 Mbps link Q: how did we get value 0.0004? Introduction 1-16 Access networks and physical media Q: How to connect end systems to edge router?  residential access nets  institutional access networks (school, company)  mobile access networks Keep in mind:  bandwidth (bits per second) of access network?  shared or dedicated? Introduction 1-17 Company access: local area networks  company/univ local area network (LAN) connects end system to edge router  Ethernet:  shared or dedicated link connects end system and router  10 Mbs, 100Mbps, Gigabit Ethernet Introduction 1-18 Wireless access networks  shared network connects end system to router  wireless access via base station aka “access point” router base station  wireless LANs:  802.11b/g (WiFi): 11 or 54 Mbps  wider-area wireless access  provided by telco operator  3G ~ 384 kbps • Will it happen??  GPRS in Europe/US mobile hosts Introduction 1-19 Internet structure: network of networks  roughly hierarchical  at center: “tier-1” ISPs (e.g., MCI, Sprint, AT&T, Cable and Wireless), national/international coverage  treat each other as equals Tier-1 providers usually interconnect (peer) privately Tier 1 ISP Tier 1 ISP Tier 1 ISP Introduction 1-20 Tier-1 ISP: e.g., Sprint Sprint US backbone network DS3 (45 Mbps) OC3 (155 Mbps) OC12 (622 Mbps) OC48 (2.4 Gbps) Seattle Tacoma POP: point-of-presence to/from backbone Stockton San Jose Cheyenne … … … … Kansas City . … peering Chicago Roachdale New York Pennsauken Relay Wash. DC Anaheim Atlanta to/from customers Fort Worth Orlando Introduction 1-21 Internet structure: network of networks  “Tier-2” ISPs: smaller (often regional) ISPs   connect to one or more tier-1 ISPs, possibly other tier-2 ISPs customer of tier-1 provider (pay!) Tier-2 ISPs also peer privately with each Tier-2 ISP pays tier-1 ISP for connectivity to rest of Internet  tier-2 ISP is customer of tier-1 provider Tier-2 ISP Tier-2 ISP Tier 1 ISP Tier 1 ISP Tier-2 ISP Tier 1 ISP Tier-2 ISP Tier-2 ISP Introduction 1-22 Internet structure: network of networks  “Tier-3” ISPs and local ISPs  last hop (“access”) network (closest to end systems) local ISP Local and tier3 ISPs are customers of higher tier ISPs connecting them to rest of Internet Tier 3 ISP Tier-2 ISP local ISP Tier-2 ISP local ISP local ISP Tier 1 ISP Tier 1 ISP Tier-2 ISP local ISP Tier 1 ISP Tier-2 ISP local ISP Introduction 1-23 Tier-2 ISP local local ISP ISP Internet structure: network of networks  a packet passes through many networks! local ISP Tier 3 ISP Tier-2 ISP local ISP My dad: “Why isn‟t my Internet working?” local ISP Tier-2 ISP local ISP Tier 1 ISP Tier 1 ISP Tier-2 ISP local ISP Tier 1 ISP Tier-2 ISP local local ISP ISP Tier-2 ISP local ISP Introduction 1-24 How do loss and delay occur? packets queue in router buffers  packet arrival rate to link exceeds output link capacity  packets queue, wait for turn packet being transmitted (delay) A B packets queueing (delay) free (available) buffers: arriving packets dropped (loss) if no free buffers Introduction 1-25 Four sources of packet delay packets queue in router buffers  packet arrival rate to link exceeds output link capacity  packets queue, wait for turn A transmission propagation B nodal processing queueing Introduction 1-26 Queueing delay (revisited)  R=link bandwidth (bps)  L=packet length (bits)  a=average packet arrival rate La (bit/sec arriving) traffic intensity = R (bit/sec transmitting)  La/R ~ 0: average queueing delay small  La/R -> 1: delays become large  La/R > 1: more “work” arriving than can be serviced, average delay infinite! Introduction 1-27 “Real” Internet delays and routes  What do “real” Internet delay & loss look like?  Traceroute program: provides delay measurement from source to router along end-end Internet path towards destination. For all i:    sends three packets that will reach router i on path towards destination router i will return packets to sender sender times interval between transmission and reply. 3 probes 3 probes 3 probes Introduction 1-28 “Real” Internet delays and routes traceroute: gaia.cs.umass.edu to www.eurecom.fr Three delay measurements from gaia.cs.umass.edu to cs-gw.cs.umass.edu 1 cs-gw (128.119.240.254) 1 ms 1 ms 2 ms 2 border1-rt-fa5-1-0.gw.umass.edu (128.119.3.145) 1 ms 1 ms 2 ms 3 cht-vbns.gw.umass.edu (128.119.3.130) 6 ms 5 ms 5 ms 4 jn1-at1-0-0-19.wor.vbns.net (204.147.132.129) 16 ms 11 ms 13 ms 5 jn1-so7-0-0-0.wae.vbns.net (204.147.136.136) 21 ms 18 ms 18 ms 6 abilene-vbns.abilene.ucaid.edu (198.32.11.9) 22 ms 18 ms 22 ms 7 nycm-wash.abilene.ucaid.edu (198.32.8.46) 22 ms 22 ms 22 ms trans-oceanic 8 62.40.103.253 (62.40.103.253) 104 ms 109 ms 106 ms link 9 de2-1.de1.de.geant.net (62.40.96.129) 109 ms 102 ms 104 ms 10 de.fr1.fr.geant.net (62.40.96.50) 113 ms 121 ms 114 ms 11 renater-gw.fr1.fr.geant.net (62.40.103.54) 112 ms 114 ms 112 ms 12 nio-n2.cssi.renater.fr (193.51.206.13) 111 ms 114 ms 116 ms 13 nice.cssi.renater.fr (195.220.98.102) 123 ms 125 ms 124 ms 14 r3t2-nice.cssi.renater.fr (195.220.98.110) 126 ms 126 ms 124 ms 15 eurecom-valbonne.r3t2.ft.net (193.48.50.54) 135 ms 128 ms 133 ms 16 194.214.211.25 (194.214.211.25) 126 ms 128 ms 126 ms 17 * * * * means no response (probe lost, router not replying) 18 * * * 19 fantasia.eurecom.fr (193.55.113.142) 132 ms 128 ms 136 ms Introduction 1-29 Quick “live” measurement  Let‟s trace route and delays to gaia.cs.umass.edu from UPRM  MS-DOS tracert program  pingplotter freeware (www.pingplotter.com)  anywhere else to trace (maybe someplace far away)? Introduction 1-30 Protocol “Layers”  Networks links of various media, applications, protocols, hardware, software  are complex: hosts, routers, How to organize structure (architecture) of network, or our discussion of networks?  Layering: protocols in layer N implements a service (provided to layer N+1), using service provided by layer N  e.g.: layer 4 (TCP) provide reliable end-end data transfer over layer 3 service (IP) providing lossy end-end data transfer Introduction 1-31 Internet protocol stack  application: supporting network applications  FTP, SMTP, HTTP application  transport: process-process data transfer  transport network TCP, UDP  network: routing of datagrams from source to destination  link physical IP, routing protocols  link: data transfer between  neighboring network elements PPP, Ethernet, 802.11 Introduction 1-32  physical: bits “on the wire” source message segment Ht M M M M frame Hl Hn Ht datagram Hn Ht application transport network link physical Encapsulation link physical switch destination M Ht Hn Ht Hl Hn Ht M M M application transport network link physical Hn Ht Hl Hn Ht M M network link physical Hn Ht M router Introduction 1-33 source message segment frame Ht M M M M datagram Hn Ht Hl Hn Ht application transport network link physical Encapsulation link physical switch destination application transport network link physical network link physical router Introduction 1-34 Introduction: Summary Covered lots of material!  Internet overview  what‟s a protocol?  network edge, core, access network  packet-switching  Internet/ISP structure  performance: loss, delay  layering and service models You now have:  context, overview, “feel” of networking  more depth, detail to follow! Introduction 1-35 Overview: Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-36 1.2: Application, transport layers Application Layer  Principles of network Transport Layer  Multiplexing  Reliable data transfer  Congestion control  UDP applications  HTTP (the web‟s protocol)  TCP Introduction 1-37 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 Introduction 1-38 Internet transport protocols services TCP service:  UDP service:  unreliable data transfer 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 between sending and receiving process  does not provide: connection setup, reliability, flow control, congestion control, timing, or bandwidth guarantee Q: why bother? Why is there a UDP? Introduction 1-39 Internet apps: application, transport protocols Application e-mail remote terminal access Web file transfer streaming multimedia Application layer protocol SMTP [RFC 2821] Telnet [RFC 854] HTTP [RFC 2616] FTP [RFC 959] proprietary (e.g. RealNetworks) proprietary (e.g., Vonage,Dialpad) Underlying transport protocol TCP TCP TCP TCP TCP or UDP Internet telephony typically UDP Introduction 1-40 Client-server architecture server:   always-on host permanent IP address initiate communication with server may be intermittently connected may have dynamic IP addresses do not communicate directly with each other clients:     Introduction 1-41 Processes communicating Process: program running within a host.  processes in different hosts communicate by exchanging messages process  sends/receives messages to/from its socket  socket analogous to door  host or server host or server process socket controlled by app developer process socket sending process shoves message out door, relies on transport layer to deliver to receiver-side socket TCP with buffers, variables Internet TCP with buffers, variables controlled by OS Introduction 1-42 Addressing processes  to send to end-system: host device has unique32-bit  to send to socket on end-system: port number  network services has well-known port numbers: • HTTP server: 80 • Mail server: 25  to send HTTP message to gaia.cs.umass.edu web IP address server:   IP address: 128.119.245.12 Port number: 80 Introduction 1-43 App-layer protocol defines  types of messages exchanged,  e.g., request, response  message syntax:  what fields in messages & how fields are delineated  message semantics  meaning of information in fields  rules for when and how Public-domain protocols:  defined in RFCs  allows for interoperability  e.g., HTTP, SMTP Proprietary protocols:  e.g., Skype processes send & respond to messages Introduction 1-44 The Web and HTTP Goal: see application level protocol “in action”  HTTP: hypertext transfer protocol  HTTP has 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 PC running Explorer Mac running Firefox Introduction 1-45 HTTP overview Two important HTTP message types:  GET request (client-toserver)  RESPONSE (server to client)  very simple! Uses TCP:  client initiates TCP connection (creates socket) to server, port 80  server accepts TCP connection from client  HTTP messages (GET, RESPONSE) exchanged between browser (HTTP client) and Web server (HTTP server)  TCP connection closed Introduction 1-46 HTTP request message  HTTP GET message:  ASCII (human-readable format) request line (GET, POST, HEAD commands) GET /somedir/page.html HTTP/1.1 Host: www.someschool.edu User-agent: Mozilla/4.0 header Connection: close lines Accept-language:fr (extra carriage return, line feed) Carriage return, line feed indicates end of message Introduction 1-47 HTTP response message status line (protocol status code status phrase) header lines HTTP/1.1 200 OK Connection close Date: 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 ... data, e.g., requested HTML file Introduction 1-48 HTTP response status codes In first line in server->client response message. A few sample codes: 200 OK  request succeeded, requested object later in this message requested object moved, new location specified later in this message (Location:) request message not understood by server requested document not found on this server Introduction 301 Moved Permanently  400 Bad Request  404 Not Found  505 HTTP Version Not Supported 1-49 Observing HTTP in action  Ethereal packet-sniffer (www.ethereal.com)  captures, records link-layer frames being sent/received  recall: HTTP encapsulated inside TCP inside IP inside Ethernet  use tomorrow to capture/analyze 802.11 wireless packet sniffer packet analyzer application application (e.g., www browser, ftp client) operating system packet capture (pcap) copy of all Ethernet frames sent/received Transport (TCP/UDP) Network (IP) Link (Ethernet) Physical to/from network to/from network Introduction 1-50 Figure 1: Packet sniffer structure Ethereal Screen Shot command menus display filter specification listing of captured packets details of selected packet header packet content in hexadecimal and ASCII Figure 2: Ethereal Graphical User Interface Introduction 1-51 Overview: Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-52 1.3 Internet transport-layer protocols  reliable, in-order delivery (TCP)    congestion control flow control connection setup application transport network data link physical network data link physical network data link physical network data link physical  unreliable, unordered network data link physical delivery: UDP  no-frills extension of “best-effort” IP network data link physical application transport network data link physical  services not available:  delay guarantees  bandwidth guarantees Introduction 1-53 Multiplexing/demultiplexing Demultiplexing at rcv host: delivering received segments to correct socket = socket application transport network P3 = process P1 P1 application transport network Multiplexing at send host: gathering data from multiple sockets, enveloping data with header (later used for demultiplexing) P2 P4 application transport network link physical link physical link physical host 1 host 2 host 3 Introduction 1-54 How demultiplexing works  host receives IP datagrams  32 bits source port # dest port #   each datagram has source IP address, destination IP address each datagram carries 1 transport-layer segment each segment has source, destination port number other header fields  host uses IP addresses & port numbers to direct segment to appropriate socket application data (message) TCP/UDP segment format Introduction 1-55 Error Control: detecting errors Goal: detect “errors” (e.g., flipped bits) in transmitted segment Sender:  treat segment contents Receiver:  compute checksum of as sequence of 16-bit integers  Internet checksum: addition (1‟s complement sum) of segment contents  sender puts checksum value into checksum field received segment  check if computed checksum equals checksum field value:  NO - error detected  YES - no error detected. But maybe errors nonetheless? More later …. Introduction 1-56 UDP segment format: simple! 32 bits Length, in bytes of UDP segment, including header source port # length dest port # checksum Internet checksum Application data (message) UDP segment format UDP services:  demultiplexing  error detection  nothing else! Introduction 1-57 Reliable Communication  Q: how do humans communicate reliably? Humans      Computers      Introduction 1-58 Mechanisms for reliable data transfer  error detection capabilities (checksum)  retransmit is packet lost or assumed lost  timer at sender to recover from lost message  sequence numbers to detect lost or duplicated messages  acknowledgement message: receiver lets sender know what was received Introduction 1-59 Reliable data transfer scenarios Introduction 1-60 Reliable data transfer scenarios Introduction 1-61 Performance of stop-and-wait  works, but performance stinks  example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet: Ttransmit =  L (packet length in bits) 8kb/pkt = = 8 microsec R (transmission rate, bps) 10**9 b/sec U sender: utilization – fraction of time sender busy sending U   sender = L/R RTT + L / R = .008 30.008 = 0.00027 1KB pkt every 30 msec -> 33kB/sec thruput over 1 Gbps link network protocol limits use of physical resources! Introduction microsec onds 1-62 Pipelining: increased utilization sender first packet bit transmitted, t = 0 last bit transmitted, t = L / R first packet bit arrives last packet bit arrives, send ACK last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK receiver RTT ACK arrives, send next packet, t = RTT + L / R Increase utilization by a factor of 3! U sender = 3*L/R RTT + L / R = .024 30.008 = 0.0008 microsecon ds Introduction 1-63 TCP: Transport Control Protocol Internet‟s reliable data transfer protocol  sequence numbers  receiver-to-sender ACKs:   timers: estimate round trip, set timer ACK(x) cumulative: “I‟ve received all segments up through seq. # x”  pipelining: allow up to N un-ACKed segments  increase N slowly until loss detected (congestion)  when loss occurs: N = N/2 Introduction 1-64 TCP “probes” for available bandwidth  increasing N until loss occurs, then decreasing N  like children, finding their parent‟s limits congestion window 24 Kbytes 16 Kbytes 8 Kbytes time Introduction 1-65 TCP segment structure 32 bits URG: urgent data (generally not used) ACK: ACK # valid PSH: push data now (generally not used) RST, SYN, FIN: connection estab (setup, teardown commands) Internet checksum (as in UDP) source port # dest port # sequence number head not UA P R S F len used acknowledgement number Receive window Urg data pnter checksum counting by bytes of data (not segments!) # bytes rcvr willing to accept Options (variable length) application data (variable length) Introduction 1-66 Let‟s look at TCP “in action” … using Ethereal Introduction 1-67 Overview: Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-68 1.4: Network Layer Overview:  forwarding and routing  What‟s inside a router  the Internet Protocol addressing  IP datagram format  ICMP   routing (path selection): not covered Introduction 1-69 Network layer  transport segment from     sending to receiving host on sending side encapsulates segments into datagrams on rcving side, delivers segments to transport layer network layer protocols in every host, router Router examines header fields in all IP datagrams passing through it application transport network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical network data link physical application transport network data link physical Introduction 1-70 Two Key Network-Layer Functions  forwarding: move packets from router‟s input to appropriate router output route taken by packets from source to dest.  analogy:  routing: process of  routing: determine planning trip from source to dest  forwarding: process of getting through single interchange routing algorithms Introduction 1-71 Interplay between routing and forwarding routing algorithm local forwarding table header value output link Forwarding: value in arriving packet’s header (in case of Internet, destination IP address), determines outgoing interface 0100 0101 0111 1001 3 2 2 1 0111 1 3 2 Introduction 1-72 Router Architecture Overview Two key router functions:  run routing algorithms/protocol (RIP, OSPF, BGP)  forwarding datagrams from incoming to outgoing link Introduction 1-73 Input Port Functions Physical layer: bit-level reception Data link layer: e.g., Ethernet Output Port functions Buffering when datagrams arrive faster than transmission rate  Scheduling discipline chooses among queued datagrams for  transmission Introduction 1-74 The Internet Network layer Host, router network layer functions: Transport layer: TCP, UDP Routing protocols •path selection •RIP, OSPF, BGP IP protocol •addressing conventions •datagram format •packet handling conventions Network layer forwarding table ICMP protocol •error reporting •router “signaling” Link layer physical layer Introduction 1-75 IP datagram format IP protocol version number header length (bytes) “type” of data max number remaining hops (decremented at each router) 32 bits type of ver head. len service length fragment 16-bit identifier flgs offset upper time to header layer live checksum 32 bit source IP address 32 bit destination IP address Options (if any) E.g. timestamp, record route taken, specify list of routers to visit. total datagram length (bytes) for fragmentation/ reassembly upper layer protocol to deliver payload to how much overhead with TCP?  20 bytes of TCP  20 bytes of IP  = 40 bytes + app layer overhead data (variable length, typically a TCP or UDP segment) Introduction 1-76 IP Addressing: introduction  IP address: 32-bit 223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.2.9 223.1.2.2 identifier for host, router interface  interface: connection between host/router and physical link    223.1.3.27 router‟s typically have multiple interfaces host typically has one interface IP addresses associated with each interface 223.1.3.1 223.1.3.2 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 Introduction 1 1-77 Subnets  IP address:  subnet part (high order bits)  host part (low order bits)  223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.2.9 223.1.2.2 What‟s a subnet ?  223.1.3.27  device interfaces with same subnet part of IP address can physically reach each other without intervening router subnet 223.1.3.1 223.1.3.2 network consisting of 3 subnets Introduction 1-78 Subnets Recipe  To determine the subnets, detach each interface from its host or router, creating islands of isolated networks. Each isolated network is called a subnet. 223.1.1.0/24 223.1.2.0/24 223.1.3.0/24 Subnet mask: /24 Introduction 1-79 Subnets How many? 223.1.1.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.9.2 223.1.7.0 223.1.9.1 223.1.8.1 223.1.2.6 223.1.2.1 223.1.2.2 223.1.3.1 223.1.8.0 223.1.7.1 223.1.3.27 223.1.3.2 Introduction 1-80 IP addresses: how to get one? Q: How does host get IP address?  hard-coded by system admin in a file Wintel: control-panel->network->configuration>tcp/ip->properties  UNIX: /etc/rc.config  DHCP: Dynamic Host Configuration Protocol: dynamically get address from as server  “plug-and-play” (more in next chapter)  Introduction 1-81 ICMP: Internet Control Message Protocol  used by hosts & routers to communicate network-level information  error reporting: unreachable host, network, port, protocol  echo request/reply (used by ping)  network-layer “above” IP:  ICMP msgs carried in IP datagrams  ICMP message: type, code plus first 8 bytes of IP datagram causing error Type 0 3 3 3 3 3 3 4 8 9 10 11 12 Code 0 0 1 2 3 6 7 0 0 0 0 0 0 description echo reply (ping) dest. network unreachable dest host unreachable dest protocol unreachable dest port unreachable dest network unknown dest host unknown source quench (congestion control - not used) echo request (ping) route advertisement router discovery TTL expired bad IP header Introduction 1-82 Traceroute and ICMP  Source sends series of UDP segments to dest     When ICMP message First has TTL =1 Second has TTL=2, etc. Unlikely port number  When nth datagram arrives to nth router:    Router discards datagram And sends to source an ICMP message (type 11, code 0) Message includes name of router& IP address arrives, source calculates RTT  Traceroute does this 3 times Stopping criterion  UDP segment eventually arrives at destination host  Destination returns ICMP “host unreachable” packet (type 3, code 3)  When source gets this ICMP, stops. Introduction 1-83 Routing Algorithms: finding paths 5 2 1 v 2 3 3 1 w 1 5 u Graph: G = (N,E) z 2 x y N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Question: What‟s the least-cost path between u and z ? Routing algorithm: algorithm that finds least-cost path Introduction 1-84 Two types of Routing Algorithms: Link State  net topology, link costs Distance Vector  distributed: node only known to all nodes  accomplished via “link state broadcast”  all nodes have same info  computes least cost paths from one node („source”) to all other nodes  gives forwarding table for that node  iterative: after k iterations, know least cost path to k dest.‟s communicate with neighboring nodes  Each node estimates distance to every other node based on info supplied by neighbors  informs neighbor if estimated distance decreases  algorithm converges to shortest path answer Introduction 1-85 Internet: Hierarchical Routing  aggregate routers into regions, “autonomous systems” (AS)  routers in same AS run same routing protocol  “intra-AS” routing protocol  routers in different AS can run different intraAS routing protocol C.b  Internet protocols: OSPF, IS-IS b a C d A Routing among AS: inter-AS routing  networks (AS‟s) are nodes in routing graph  BGP: Border Gateway Protocol  Internet‟s inter-As routing protocols  glue that binds Internet together B.a A.a A.c a b c a B c b 1-86 Introduction Overview: Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-87 1.5: The Data Link Layer Overview:  sharing a broadcast “link” channel: multiple access  link layer addressing  Ethernet  802.11 data-link layer has responsibility of transferring datagram from one node to adjacent node over a link Introduction 1-88 Link Layer Services  framing, link access:  encapsulate datagram into frame, adding header, trailer  channel access if shared medium  “MAC” addresses identifies source, dest • different from IP address!  reliable delivery between adjacent nodes  we learned how to do this already (transport layer)!  seldom used on low bit error link (fiber, twisted pair)  wireless links: higher error rates Introduction 1-89 Multiple Access Links and Protocols Two types of “links”:  point-to-point  PPP for dial-up access  broadcast (shared wire or medium)  Old-fashioned Ethernet  upstream HFC  802.11 wireless LAN Introduction 1-90 Multiple Access protocols  single shared broadcast channel  two or more simultaneous transmissions by nodes: interference  collision if node receives two or more signals at the same time Multiple access protocol:  distributed algorithm that determines how nodes share channel, i.e., determine when node can transmit  communication about channel sharing must use channel itself!  no out-of-band channel for coordination Introduction 1-91 Q: how do humans solve multiple access problem?        Introduction 1-92 MAC Protocols: a taxonomy Three broad classes:  Channel Partitioning divide channel into smaller “pieces” (time slots, frequency, code)  allocate piece to node for exclusive use   “Taking turns”  Nodes take turns, but nodes with more to send can take longer turns  Random Access channel not divided, allow collisions  “recover” from collisions  Introduction 1-93 Channel Partitioning MAC protocols: TDMA TDMA: time division multiple access  access to channel in "rounds"  each station gets fixed length slot (length = pkt trans time) in each round  unused slots go idle  example: 6-station LAN, 1,3,4 have pkt, slots 2,5,6 idle Introduction 1-94 “Taking Turns” MAC protocols Polling: Token passing:  master node  control token passed from “invites” slave nodes one node to next to transmit in turn sequentially.  concerns:  token message  polling overhead  concerns:   latency single point of failure (master)    token overhead latency single point of failure (token) Introduction 1-95 Random Access Protocols  When node has packet to send  transmit at full channel data rate R.  no a priori coordination among nodes  two or more transmitting nodes ➜ “collision”,  random access MAC protocol specifies:  how to detect collisions  how to recover from collisions (e.g., via delayed retransmissions)  Examples of random access MAC protocols:  slotted ALOHA  ALOHA  CSMA, CSMA/CD, CSMA/CA Introduction 1-96 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit:  If channel sensed idle: transmit entire frame  If channel sensed busy, defer transmission  human analogy: don‟t interrupt others! CSMA/CD: (CD = collision detection)  colliding transmissions detected and aborted, reducing channel wastage Collisions can still occur! Introduction 1-97 MAC Addresses  32-bit IP address:   network-layer address used to get datagram to destination IP subnet  MAC (or LAN or physical or Ethernet) address:  used to get frame from one interface to another physically-connected interface (same network)  48 bit MAC address (for most LANs) burned in the adapter ROM Introduction 1-98 ARP: Address Resolution Protocol Question: how to determine MAC address of B knowing B‟s IP address? A 137.196.7.23 ARP protocol:  node A broadcasts 137.196.7.78 1A-2F-BB-76-09-AD 137.196.7.14 LAN 71-65-F7-2B-08-53 request: who knows B‟s MAC protocol  B replies to A with its MAC address 58-23-D7-FA-20-B0 137.196.7.88 B 0C-C4-11-6F-E3-98 Introduction 1-99 Ethernet “dominant” wired LAN technology:  cheap $20 for 100Mbs!  first widely used LAN technology  kept up with speed race: 10 Mbps – 10 Gbps  Uses CSMA/CD: binary backoff Metcalfe‟s Ethernet sketch Introduction 1-100 Ethernet Frame Structure Sending adapter encapsulates IP datagram (or other network layer protocol packet) in Ethernet frame Introduction 1-101 Overview: Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-102 1.6 Elements of a wireless network wireless hosts  laptop, PDA, IP phone  run applications  may be stationary (non-mobile) or mobile  network infrastructure wireless does not always mean mobility Introduction 1-103 1.6 Elements of a wireless network base station  typically connected to wired network  relay - responsible for sending packets between wired network and wireless host(s) in its “area”  e.g., cell towers 802.11 access points network infrastructure Introduction 1-104 1.6 Elements of a wireless network wireless link  typically used to connect mobile(s) to base station  also used as backbone link  multiple access protocol coordinates link access  various data rates, transmission distance network infrastructure Introduction 1-105 Characteristics of selected wireless link standards 54 Mbps 5-11 Mbps 1 Mbps 802.15 802.11{a,g} 802.11b .11 p-to-p link us, tomorrow 3G 2G 384 Kbps 56 Kbps UMTS/WCDMA, CDMA2000 IS-95 CDMA, GSM Indoor 10 – 30m Outdoor 50 – 200m Mid range outdoor 200m – 4Km Long range outdoor 5Km – 20Km Introduction 1-106 Elements of a wireless network infrastructure mode  base station connects mobiles into wired network  handoff: mobile changes base station providing connection into wired network network infrastructure Introduction 1-107 Elements of a wireless network Ad hoc mode   nodes can only no base stations transmit to other nodes within link coverage  nodes organize themselves into a network: route among themselves tomorrow, we will be running our wireless nodes in ad hoc mode. Introduction 1-108 Wireless Link Characteristics Differences from wired link … decreased signal strength: radio signal attenuates as it propagates through matter (path loss)  interference from other sources: standard wireless network frequencies (e.g., 2.4 GHz) shared by other devices (e.g., phone); devices (motors) interfere as well  multipath propagation: radio signal reflects off objects ground, arriving ad destination at slightly different times  …. make communication across (even a point to point) wireless link much more “difficult” Introduction 1-109 Wireless network characteristics Multiple wireless senders and receivers create additional problems (beyond multiple access): C B A A‟s signal strength B C C‟s signal strength A Hidden terminal problem  B, A hear each other  B, C hear each other  A, C can not hear each other space Signal fading:  B, A hear each other  B, C hear each other  A, C can not hear each other means A, C unaware of their interference at B interferring at B Introduction 1-110 IEEE 802.11 Wireless LAN  802.11b  2.4-5 GHz unlicensed radio spectrum  up to 11 Mbps  direct sequence spread spectrum (DSSS) in physical layer • all hosts use same chipping code  widely deployed, using base stations  802.11a  5-6 GHz range  up to 54 Mbps  802.11g  2.4-5 GHz range  up to 54 Mbps  All use CSMA/CA for multiple access  All have base-station and ad-hoc network versions we‟ll use this Introduction 1-111 802.11: Channels, association  802.11b: 2.4GHz-2.485GHz spectrum divided into 11 channels at different frequencies   host: must associate with an AP  scans channels, listening for beacon frames containing AP‟s name (SSID) and MAC address  selects AP to associate with  may perform authentication  may run DHCP to get IP address in AP‟s subnet (we‟‟ll hard-code our IP addresses tomorrow) Introduction 1-112 AP admin chooses frequency for AP  interference possible: channel can be same as that chosen by neighboring AP! IEEE 802.11 MAC Protocol: CSMA/CA 802.11 sender 1 if sense channel idle for DIFS then transmit entire frame (no CD) 2 if sense channel busy then start random backoff time timer counts down while channel idle transmit when timer expires if no ACK, increase random backoff interval, repeat 2 sender DIFS receiver data SIFS 802.11 receiver - if frame received OK return ACK after SIFS (ACK needed due to hidden terminal problem) ACK Introduction 1-113 Avoiding collisions (more) idea: allow sender to “reserve” channel rather than random access of data frames: avoid collisions of long data frames  sender first transmits small request-to-send (RTS) packets to BS using CSMA  RTSs may still collide with each other (but they‟re short)  BS broadcasts clear-to-send CTS in response to RTS  RTS heard by all nodes  sender transmits data frame  other stations defer transmissions Avoid data frame collisions completely using small reservation packets! Introduction 1-114 Collision Avoidance: RTS-CTS exchange A AP B reservation collision DATA (A) B defers time Introduction 1-115 802.11 frame: addressing 2 2 6 6 6 2 6 0 - 2312 payload 4 CRC frame address address address duration control 1 2 3 seq address 4 control Address 1: MAC address of wireless host or AP to receive this frame Address 4: used only in ad hoc mode Address 3: MAC address of router interface to which AP is attached Address 2: MAC address of wireless host or AP transmitting this frame Introduction 1-116 802.11 frame: addressing H1 AP R1 router Internet R1 MAC addr AP MAC addr dest. address source address 802.3 frame AP MAC addr H1 MAC addr R1 MAC addr address 1 address 2 address 3 802.11 frame Introduction 1-117 802.11 frame: more duration of reserved transmission time (RTS/CTS) 2 2 6 6 6 2 frame seq # (for reliable ARQ) 6 0 - 2312 payload 4 CRC frame address address address duration control 1 2 3 seq address 4 control 2 Protocol version 2 Type 4 Subtype 1 To AP 1 1 1 Retry 1 1 1 WEP 1 Rsvd From More AP frag Power More mgt data frame type (RTS, CTS, ACK, data) Introduction 1-118 Our Whirlwind tour is over!:  Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-119 Our Whirlwind tour is over!:  Part 1: Whirlwind Introduction to Networking (Monday)     Part 2: In the field (Tuesday) 9:00 – 10:15 networking overview 10:45 – 12:00 application, transport, network layers 2:00 – 3:00 intro to link layer 3:00 – 4:00 link layer, 802.11 networks  9:00 – 9:30 meet, discuss plans, divide into teams  9:30 – 12:00 short distance 802.11 experiments, measurements  2:00 – ? long-distance 802.11 experiments, measurements Introduction 1-120  we are always looking for great graduate students! www.cs.umass.edu  consider graduate school at UMass intellectually exciting  terrific faculty  collaborative, cross-disciplinary  well, … but not quite as warm and sunny as here   www.ecs.umass.edu Introduction 1-121 DAY TWO Goals:  get out “in the field,” set up a single-link (one-hop) wireless network using directional antennas  transfer radar data over connection   measure, observe variations in performance  antenna aiming/positioning  802.11 parameters: timeout  link distance Introduction 1-122 measure, record traffic for later analysis Equipment setup 2.4 GHz 24 dBi High Performance Reflector Grid Wireless LAN Antenna (8 degree beam width) N-male to N-male cable pigtail Linux laptop driver for Atheros chipset: http://www.madwifi.org/ Proxim Orinoco 8470-FC 802.11b/g PC Card Introduction 1-123 Software we‟ll be using  tcpdump (like Ethereal) – packet capture  iperf – sends packets as fast as possible from client to server over udp or tcp socket  madwifi-tools (www.madwifi.org)  Linux kernel driver for Atheros Wireless LAN chipsets (we‟ll use this)  athctrl –d set specific distance in meters for link optimization (e.g. ACK timeout), athctrl –i ath0 -d 15000 ath0 interface receiver distance < 15,000m Introduction 1-124 Software we‟ll be using Wireless tools (iwconfig)  display wireless link information Link Quality  Signal Level  Noise Level   set wireless link parameters, e.g., speed, address, name iwconfig  iwconfig  iwconfig  iwconfig  ath0 ath0 ath0 ath0 mode Ad-Hoc date 54M txpower 30mW address 192.168.1.1 Introduction 1-125 Configuring the wireless interfaces Configuration of etc/network/interfaces: #Wireless interface auto ath0 iface ath0 inet static address 192.168.1.1 netmask 255.255.255.0 wireless_mode Ad-Hoc wireless_essid CS496 channel 1 #rate 54M (*must set manually) #Ethernet interface auto eth0 iface eth0 inet static address 192.168.1.101 netmask 255.255.255.0 Introduction 1-126 Address configuration MAC: 0020A657B3CB IP: 192.168.1.2 MAC: 0020A657B3C3 IP: 192.168.1.1 Introduction 1-127 Experiments: 7 data sets (at each node) a) Align antennas, set timers, note signal strength, begin tcpdump, begin iperf transfer b) turn each antenna 10 degrees (or until signal strength creasing by factor of 2) c) afternoon experiments; repeat a) and b) also set ACK timer short (100m propagation) and repeat a) d) analyze gathered data later (will be posted on www site: http://gaia.cs.umass.edu/uprm Introduction 1-128 a) UDP throughput over 5 minutes b) TCP throughput over 5 minutes a) repeat above

Related docs
Wireless Networking in the Developing World
Views: 54  |  Downloads: 3
Wireless Networking
Views: 491  |  Downloads: 100
Introduction to Networking Wireless
Views: 44  |  Downloads: 8
Wireless Networks
Views: 16  |  Downloads: 5
Networking and wireless
Views: 3  |  Downloads: 0
TCP in Wireless Networks
Views: 39  |  Downloads: 6
TCP in Wireless Networks
Views: 14  |  Downloads: 3
Wireless Information Networks
Views: 71  |  Downloads: 7
Wireless Home Networking
Views: 257  |  Downloads: 36
Introduction to Wireless Networking
Views: 1  |  Downloads: 0
Introduction to Networking Local Area Networks
Views: 46  |  Downloads: 0
premium docs
Other docs by moti
Sample Equipment Lease
Views: 520  |  Downloads: 10
epworth-all
Views: 359  |  Downloads: 1
CorpDocs- Corporate Governance Guidelines
Views: 406  |  Downloads: 35
website rough layout
Views: 354  |  Downloads: 8
Stock Certificate Common Stock
Views: 718  |  Downloads: 46
Batmobile Dashboard
Views: 566  |  Downloads: 8
Board Resolution Changing Officers Salaries
Views: 144  |  Downloads: 3
Jon Stewart1
Views: 149  |  Downloads: 0
Employee Discipline Aids
Views: 1718  |  Downloads: 90
Strengths and weaknesses checklist
Views: 516  |  Downloads: 10
Job Satisfaction Feedback Form
Views: 754  |  Downloads: 47