510 likes | 640 Views
Lecture 14: Midterm Review. ITCS 6166/8166 091 Spring 2007 Jamie Payton Department of Computer Science University of North Carolina at Charlotte February 21, 2007. Slides adapted from: Computer Networks: A Systems Approach (Peterson and Davis)
E N D
Lecture 14:Midterm Review ITCS 6166/8166 091 Spring 2007 Jamie Payton Department of Computer Science University of North Carolina at Charlotte February 21, 2007 Slides adapted from: Computer Networks: A Systems Approach (Peterson and Davis) Computer Networking: A Top Down Approach Featuring the Internet (Kurose and Ross)
A hodge podge of topics • General overview to put things in perspective….
millions of connected computing devices: hosts = end systems running network apps communication links fiber, copper, radio, satellite transmission rate = bandwidth routers: forward packets (chunks of data) router workstation server mobile local ISP regional ISP company network What’s the Internet?A “nuts and bolts” view
network edge: applications and hosts network core: routers network of networks access networks, physical media: communication links Network Structure
end systems (hosts): run application programs e.g. Web, email at “edge of network” client/server model client host requests, receives service from always-on server e.g. Web browser/server; email client/server peer-peer model: minimal (or no) use of dedicated servers e.g. Skype, BitTorrent, KaZaA Network Edge
Goal: data transfer between end systems handshaking: setup (prepare for) data transfer ahead of time Hello, hello back human protocol set up “state” in two communicating hosts TCP - Transmission Control Protocol Internet’s connection-oriented service TCP service[RFC 793] reliable, in-order byte-stream data transfer loss: acknowledgements and retransmissions flow control: sender won’t overwhelm receiver congestion control: senders “slow down sending rate” when network congested The Network EdgeConnection-oriented Service
Goal: data transfer between end systems same as before! UDP - User Datagram Protocol [RFC 768]: connectionless unreliable data transfer no flow control no congestion control App’s using TCP: HTTP (Web), FTP (file transfer), Telnet (remote login), SMTP (email) App’s using UDP: streaming media, teleconferencing, DNS, Internet telephony The Network Edge Connectionless service
mesh of interconnected routers the fundamental question: how is data transferred through net? circuit switching: dedicated circuit per call: telephone net packet-switching: data sent thru net in discrete “chunks” The Network Core
End-end resources reserved for “call” link bandwidth, switch capacity dedicated resources: no sharing circuit-like (guaranteed) performance call setup required The Network CoreCircuit Switching
network resources (e.g., bandwidth) divided into “pieces” pieces allocated to calls resource piece idle if not used by owning call (no sharing) The Network CoreCircuit Switching • dividing link bandwidth into “pieces” • frequency division • time division
Example: 4 users FDM frequency time TDM frequency time Circuit SwitchingFDM and TDM
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 The Network CorePacket Switching resource contention: • aggregate resource demand can exceed amount available • congestion: packets queue, wait for link use • store and forward: packets move one hop at a time • Node receives complete packet before forwarding
Sequence of A & B packets does not have fixed pattern, shared on demand statistical multiplexing. TDM: each host gets same slot in revolving TDM frame D E Packet SwitchingStatistical Multiplexing 100 Mb/s Ethernet C A statistical multiplexing 1.5 Mb/s B queue of packets waiting for output link
Takes L/R seconds to transmit (push out) packet of L bits on to link or R bps Entire packet must arrive at router before it can be transmitted on next link: store and forward delay = 3L/R (assuming zeropropagation delay) Example: L = 7.5 Mbits R = 1.5 Mbps delay = 15 sec Packet-switchingStore-and-Forward L R R R
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 Packet switching allows more users to use network! Packet switching versus circuit switching N users 1 Mbps link Q: how did we get value 0.0004? See notes from lecture!
Great for bursty data resource sharing simpler, no call setup Excessive congestion: packet delay and loss protocols needed for reliable data transfer, congestion control Q: How to provide circuit-like behavior? bandwidth guarantees needed for audio/video apps still an unsolved problem (chapter 7) Is packet switching a “slam dunk winner?” Packet switching versus circuit switching
Delays in Packet-Switched Networks • Transmission delay • Sending of bits onto the wire • Depends on link bandwidth • Propagation delay • Propagation of bits inside the wire • Depends on medium • Processing delay • Handling of bits on receiving end • Depends on processor and memory speed • Queuing delay • Wait time due to statistical multiplexing • Depends on network load and scheduling algorithm
Transmission delay: R=link bandwidth (bps) L=packet length (bits) time to send bits into link = L/R transmission A propagation B nodal processing queueing Understanding Packet Delay
transmission A propagation B nodal processing queueing Understanding Packet Delay • Propagation delay: • d = length of physical link • s = propagation speed in medium (~2x108 m/sec) • propagation delay = d/s Note: s and R are very different quantities!
Processing delay: B = Check bit errors O = Determine output link Delay = b + o transmission A propagation B nodal processing queueing Understanding Packet Delay
Queuing delay: Time waiting at output link for transmission Depends on congestion level of router Complex topic Varies from packet to packet! Must use statistical measures to estimate queuing delay Thousands of research papers written on queuing delay transmission A propagation B nodal processing queueing Understanding Packet Delay
R=link bandwidth (bps) L=packet length (bits) a=average packet arrival rate Overview of Queuing Delay traffic intensity = La/R • 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!
Analogy Car ~ bit Caravan ~ packet Toll booth ~ host 12 sec to take money from each car Highway ~ connection Speed limit is 100 km/hr Q: How long until caravan is lined up before 2nd toll booth? toll booth toll booth Caravan analogy 100 km 100 km ten-car caravan
Nodal Delay • dproc = processing delay • typically a few microsecs or less • dqueue = queuing delay • depends on congestion • dtrans = transmission delay • = L/R, significant for low-speed links • dprop = propagation delay • a few microsecs to hundreds of msecs
Packet Loss • Queue (aka buffer) has finite capacity • When packet arrives to full queue, packet is dropped (i.e., lost) • Lost packet may be: • Retransmitted by previous node • Retransmitted by source end system • Not retransmitted at all • We’ll discuss techniques for dealing with lost packets later in the semester
application transport network link physical Network Protocol Layers • Network functionality is organized into layers • Each layer implements a service • Layer actions are encapsulated • Each layer relies on services provided by layer below • Benefits of layered approach • Modularity • Simplifies maintenance, updating • Explicit structure • Allows identification, relationship of system pieces
application: network applications FTP, SMTP, HTTP application-layer messages transport: data transfer TCP, UDP segments network: routing data from source to destination IP, routing protocols datagrams link: data transfer between neighboring network elements PPP, Ethernet frames physical: bits “on the wire” application transport network link physical Internet Protocol Stack
network link physical link physical M M M Ht M Hn Hn Hn Hn Ht Ht Ht Ht M M M M Hn Ht Ht Hl Hl Hl Hn Hn Hn Ht Ht Ht M M M source Encapsulation message application transport network link physical segment datagram frame switch destination application transport network link physical router
Change Gears… • Now we’ll talk about stuff at the application layer • See lecture slides for application layer!
Change Gears… • Now we’ll talk about stuff at the transport layer • UDP • TCP • See lecture slides for TCP and congestion control!
Changing Gears… • Now we’ll talk about stuff specifically at the network layer • IP addressing • Forwarding and routing
IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link router’s typically have multiple interfaces host typically has one interface IP addresses associated with each interface 223.1.1.2 223.1.2.1 223.1.3.27 223.1.3.1 223.1.3.2 223.1.2.2 IP Addressing: introduction 223.1.1.1 223.1.2.9 223.1.1.4 223.1.1.3 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1
IP address: subnet part (high order bits) host part (low order bits) What’s a subnet ? device interfaces with same subnet part of IP address can physically reach each other without intervening router Subnets 223.1.1.1 223.1.2.1 223.1.1.2 223.1.2.9 223.1.1.4 223.1.2.2 223.1.1.3 223.1.3.27 subnet 223.1.3.2 223.1.3.1 network consisting of 3 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 Subnets Subnet mask: /24
host part subnet part 11001000 0001011100010000 00000000 200.23.16.0/23 IP addressing: CIDR CIDR:Classless InterDomain Routing • subnet portion of address of arbitrary length • address format: a.b.c.d/x, where x is # bits in subnet portion of address
NAT: Network Address Translation rest of Internet local network (e.g., home network) 10.0.0/24 10.0.0.1 10.0.0.4 10.0.0.2 138.76.29.7 10.0.0.3 Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers
Network Layer Overview:Forwarding and Routing • Forwarding: move packets from router’s input to appropriate router output • Routing: determine route taken by packets from source to dest. • routing algorithms analogy: • routing: process of planning trip from source to destination • forwarding: process of getting through single interchange
Network Layer Overview:Forwarding and Routing routing algorithm local forwarding table header value output link 0100 0101 0111 1001 3 2 2 1 value in arriving packet’s header 1 0111 2 3
Forwarding table Destination Address RangeLink Interface 11001000 00010111 00010000 00000000 through 0 11001000 00010111 00010111 11111111 11001000 00010111 00011000 00000000 through 1 11001000 00010111 00011000 11111111 11001000 00010111 00011001 00000000 through 2 11001000 00010111 00011111 11111111 otherwise 3 4 billion possible entries
Longest prefix matching Prefix MatchLink Interface 11001000 00010111 00010 0 11001000 00010111 00011000 1 11001000 00010111 00011 2 otherwise 3 Examples Which interface? DA: 11001000 00010111 00010110 10100001 Which interface? DA: 11001000 00010111 00011000 10101010
Internet inter-AS routing: BGP • BGP (Border Gateway Protocol):the de facto standard • BGP provides each AS a means to: • Obtain subnet reachability information from neighboring ASs. • Propagate reachability information to all AS-internal routers. • Determine “good” routes to subnets based on reachability information and policy. • allows subnet to advertise its existence to rest of Internet: “I am here”
3a 3b 2a AS3 AS2 1a 2c AS1 2b eBGP session 3c 1b 1d 1c iBGP session BGP basics • Pairs of routers (BGP peers) exchange routing info over semi-permanent TCP connections: BGP sessions • BGP sessions need not correspond to physical links. • When AS2 advertises a prefix to AS1, AS2 is promising it will forward any datagrams destined to that prefix towards the prefix. • AS2 can aggregate prefixes in its advertisement
3a 3b 2a AS3 AS2 1a 2c AS1 2b eBGP session 3c 1b 1d 1c iBGP session Distributing reachability info • With eBGP session between 3a and 1c, AS3 sends prefix reachability info to AS1. • 1c can then use iBGP do distribute this new prefix reach info to all routers in AS1 • 1b can then re-advertise new reachability info to AS2 over 1b-to-2a eBGP session • When router learns of new prefix, creates entry for prefix in its forwarding table.
Path attributes & BGP routes • When advertising a prefix, advert includes BGP attributes. • prefix + attributes = “route” • Two important attributes: • AS-PATH: contains ASs through which prefix advertisement has passed: AS 67 AS 17 • NEXT-HOP: Indicates specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop-AS.) • When gateway router receives route advertisement, uses import policy to accept/decline.
BGP route selection • Router may learn about more than 1 route to some prefix. Router must select route. • Elimination rules: • Local preference value attribute: policy decision • Shortest AS-PATH • Closest NEXT-HOP router: hot potato routing • Additional criteria
BGP messages • BGP messages exchanged using TCP • BGP messages: • OPEN: opens TCP connection to peer and authenticates sender • UPDATE: advertises new path (or withdraws old) • KEEPALIVE keeps connection alive in absence of UPDATES; also ACKs OPEN request • NOTIFICATION: reports errors in previous msg; also used to close connection
BGP routing policy • A,B,C are provider networks • X,W,Y are customer (of provider networks) • X is dual-homed: attached to two networks • X does not want to route from B via X to C • .. so X will not advertise to B a route to C
BGP routing policy (2) • A advertises to B the path AW • B advertises to X the path BAW • Should B advertise to C the path BAW? • No way! B gets no “revenue” for routing CBAW since neither W nor C are B’s customers • B wants to force C to route to w via A • B wants to route only to/from its customers!
Why different Intra- and Inter-AS routing ? Policy: • Inter-AS: admin wants control over how its traffic routed, who routes through its net. • Intra-AS: single admin, so no policy decisions needed Scale: • hierarchical routing saves table size, reduced update traffic Performance: • Intra-AS: can focus on performance • Inter-AS: policy may dominate over performance
Summary • Routing!!! • Next time • Midterm • After break • More routing!!!