* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Network
IEEE 802.1aq wikipedia , lookup
SIP extensions for the IP Multimedia Subsystem wikipedia , lookup
Passive optical network wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Internet protocol suite wikipedia , lookup
Network tap wikipedia , lookup
Multiprotocol Label Switching wikipedia , lookup
TCP congestion control wikipedia , lookup
Serial digital interface wikipedia , lookup
Point-to-Point Protocol over Ethernet wikipedia , lookup
List of wireless community networks by region wikipedia , lookup
Computer network wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Airborne Networking wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Asynchronous Transfer Mode wikipedia , lookup
Deep packet inspection wikipedia , lookup
Packet switching wikipedia , lookup
Wake-on-LAN wikipedia , lookup
UniPro protocol stack wikipedia , lookup
CMPUT429/CMPE382 Winter 2001 TopicA: Network (Adapted from David A. Patterson’s CS252, Spring 2001 Lecture Slides) 1/17/01 CMPUT429/CMPE382 Amaral I/O to External Devices and Other Computers Processor interrupts Cache Memory - I/O Bus Main Memory I/O Controller Disk Disk I/O Controller Graphics I/O Controller Network ideal: high bandwidth, low latency 1/17/01 CMPUT429/CMPE382 Amaral Networks • Goal: Communication between computers • Eventual Goal: treat collection of computers as one big computer, distributed resource sharing • Theme: Different computers must agree on many things – Overriding importance of standards and protocols – Fault tolerance critical as well • Warning: Terminology-rich environment 1/17/01 CMPUT429/CMPE382 Amaral Example Major Networks IP - internet Protocol TCP - Transmission Control Protocol CS Net FDDI 100Mbps Phonenet T1, 56Kbps ARPA net NSF Net CS Net Relay 1.6Mbps 10 Mbps Token Ring 4Mbps Ethernet 1/17/01 T3, 230Kbps Bitnet ATM X.25 (Telenet, Uninet_ CMPUT429/CMPE382 Amaral Networks • Facets people talk a lot about: – – – – – direct (point-to-point) vs. indirect (multi-hop) topology (e.g., bus, ring, DAG) routing algorithms switching (aka multiplexing) wiring (e.g., choice of media, copper, coax, fiber) • What really matters: – – – – 1/17/01 latency bandwidth cost reliability CMPUT429/CMPE382 Amaral Interconnections (Networks) • Examples: – MPP networks (SP2): 100s nodes; Š 25 meters per link – Local Area Networks (Ethernet): 100s nodes; Š 1000 meters – Wide Area Network (ATM): 1000s nodes; Š 5,000,000 meters a.k.a. end systems, hosts a.k.a. network, communication subnet 1/17/01 Interconnection Network CMPUT429/CMPE382 Amaral More Network Background • Connection of 2 or more networks: Internetworking • 3 cultures for 3 classes of networks – MPP: performance, latency and bandwidth – LAN: workstations, cost – WAN: telecommunications, phone call revenue • Try for single terminology • Motivate the interconnection complexity incrementally 1/17/01 CMPUT429/CMPE382 Amaral ABCs of Networks • Starting Point: Send bits between 2 computers • • • • Queue (FIFO) on each end Information sent called a “message” Can send both ways (“Full Duplex”) Rules for communication? “protocol” – Inside a computer: » Loads/Stores: Request (Address) & Response (Data) » Need Request & Response signaling 1/17/01 CMPUT429/CMPE382 Amaral A Simple Example • What is the format of message? – Fixed? Number bytes? Request/ Response 1 bit Address/Data 32 bits 0: Please send data from Address 1: Packet contains data corresponding to request • Header/Trailer: information to deliver a message • Payload: data in message (1 word above) 1/17/01 CMPUT429/CMPE382 Amaral Questions About Simple Example • What if more than 2 computers want to communicate? – Need computer “address field” (destination) in packet • What if packet is garbled in transit? – Add “error detection field” in packet (e.g., CRC) • What if packet is lost? – More “elaborate protocols” to detect loss (e.g., NAK, ARQ, time outs) • What if there are multiple processes/machine? – Queue per process to provide protection • Simple questions such as these lead to more complex protocols and packet formats 1/17/01 CMPUT429/CMPE382 Amaral A Simple Example Revisted • What is the format of packet? – Fixed? Number bytes? Request/ Response Address/Data CRC 1 bit 32 bits 4 bits 00: Request—Please send data from Address 01: Reply—Packet contains data corresponding to request 10: Acknowledge request 11: Acknowledge reply 1/17/01 CMPUT429/CMPE382 Amaral Software to Send and Receive • SW Send steps 1: Application copies data to OS buffer 2: OS calculates checksum, starts timer 3: OS sends data to network interface HW and says start • SW Receive steps 3: OS copies data from network interface HW to OS buffer 2: OS calculates checksum, if matches send ACK; if not, deletes message (sender resends when timer expires) 1: If OK, OS copies data to user address space and signals application to continue • Sequence of steps for SW: protocol – Example similar to UDP/IP protocol in UNIX 1/17/01 CMPUT429/CMPE382 Amaral Network Performance Measures • Overhead: latency of interface vs. Latency: 1/17/01 network CMPUT429/CMPE382 Amaral Universal Performance Metrics Sender Sender Overhead Transmission time (size ÷ bandwidth) (processor busy) Time of Flight Transmission time (size ÷ bandwidth) Receiver Overhead Receiver Transport Latency (processor busy) Total Latency Total Latency = Sender Overhead + Time of Flight + Message Size ÷ BW + Receiver Overhead Includes header/trailer in BW calculation? 1/17/01 CMPUT429/CMPE382 Amaral Example Performance Measures Interconnect MPP LAN WAN Example Bisection BW Int./Link BW Transport Latency HW Overhead to/from SW Overhead to/from CM-5 Ethernet ATM N x 5 MB/s 1.125 MB/s N x 10 MB/s 20 MB/s 1.125 MB/s 10 MB/s 5 µsec 15 µsec 50 to 10,000 µs 0.5/0.5 µs 6/6 µs 6/6 µs 1.6/12.4 µs 200/241 µs 207/360 µs (TCP/IP on LAN/WAN) Software overhead dominates in LAN, WAN 1/17/01 CMPUT429/CMPE382 Amaral Total Latency Example • 10 Mbit/sec., sending overhead of 230 µsec & receiving overhead of 270 µsec. • a 1000 byte message (including the header), allows 1000 bytes in a single message. • 2 situations: distance 0.1 km vs. 1000 km • Speed of light = 299,792.5 km/sec (1/2 in media) • Latency0.1km = • Latency1000km = • Long time of flight => complex WAN protocol 1/17/01 CMPUT429/CMPE382 Amaral Simplified Latency Model • Total Latency = Overhead + Message Size / BW • Overhead = Sender Overhead + Time of Flight + Receiver Overhead • Example: show what happens as the following parameters change: – Overhead: 1, 25, 500 µsec – BW: 10,100, 1000 Mbit/sec (factors of 10) – Message Size: 16 Bytes to 4 MB (factors of 4) 1/17/01 • If overhead 500 µsec, how big a message > 10 Mb/s? CMPUT429/CMPE382 Amaral Overhead, BW, Size Delivered BW 200 o500,b200 0 0 1 2 8 28 79 Effective Bandwidth (Mbit/sec) 1,000 1/17/01 o1, bw1000 o25, bw1000 100 10 o1, bw10 1 o500, bw100 o25, bw100 o1, bw100 o25, bw10 o500, bw1000 o500, bw10 Msg Size 0 o25,bw100: overhead of 25 microseconds, bandwidth of 100 Mbits/second 0 CMPUT429/CMPE382 Amaral Cummulative % Measurement: Sizes of Message for NFS 100% 90% 80% 70% 60% 50% 40% 30% 20% 10% 0% Msgs 0 1/17/01 Why? Bytes 1024 2048 3072 4096 5120 6144 7168 8192 Packet size • 95% Msgs, 30% bytes for packets Š 200 bytes • > 50% data transfered in packets = 8KB CMPUT429/CMPE382 Amaral Impact of Overhead on Delivered BW Delivered BW (MB/sec) 1000.00 1 100.00 10 100 10.00 1000 1.00 1000 100 10 1 0.10 MinTime one-way µsecs Peak BW (MB/sec) 1/17/01 • BW model: Time = overhead + msg size/peak BW CMPUT429/CMPE382 Amaral • > 50% data transfered in packets = 8KB HW Interface Issues • Where to connect network to computer? – – – – Cache consistent to avoid flushes? (=> memory bus) Latency and bandwidth? (=> memory bus) Standard interface card? (=> I/O bus) MPP => memory bus; LAN, WAN => I/O bus CPU Network $ I/O Controller L2 $ Memory Bus Memory 1/17/01 Network I/O Controller ideal: high bandwidth, low latency, standard interface I/O bus Bus Adaptor CMPUT429/CMPE382 Amaral SW Interface Issues • How to connect network to software? – – – – Programmed I/O?(low latency) DMA? (best for large messages) Receiver interrupted or receiver polls? Poll-watchdog? • Things to avoid – Invoking operating system in common case – Operating at uncached memory speed (e.g., check status of network interface) 1/17/01 CMPUT429/CMPE382 Amaral CM-5 Software Interface Overhead • CM-5 example (MPP) • As rate of messages arriving changes, use polling or interrupt? – Solution: Always enable interrupts, have interrupt routine poll until no messages pending – Low rate => interrupt – High rate => polling 1/17/01 90 message overhead (µsecs) – Time per poll 1.6 µsecs; time per interrupt 19 µsecs – Minimum time to handle message: 0.5 µsecs – Enable/disable 4.9/3.8 µsecs 100 80 70 60 Polling 50 40 30 Interrupts 20 10 0 0 10 20 30 40 50 60 70 80 90 100 message interarriv al (µsecs) Time between messages CMPUT429/CMPE382 Amaral Network Media Twisted Pair: Copper, 1mm think, twisted to avoid attenna effect (telephone) Coaxial Cable: Fiber Optics Transmitter – L.E.D – Laser Diode light source 1/17/01 Used by cable companies: high BW, good noise immunity Light: 3 parts are cable, light source, light detector. Total internal Multimode reflection light disperse Receiver – Photodiode (LED), Single mode sinle wave (laser) Silica Plastic Covering Braided outer conductor Insulator Copper core Air CMPUT429/CMPE382 Amaral Costs of Network Media (1995) Cost/meter Cost/interface Bandwidth Distance Media $0.23 $2 2 km 1 Mb/s twisted pair (0.1 km) (20 Mb/s) copper wire 1 km $1.64 $5 10 Mb/s coaxial cable 2 km $1.03 $1000 600 Mb/s multimode optical fiber 2000 Mb/s single mode 100 km $1.64 $1000 optical fiber Note: more elaborate signal processing allows higher BW from copper (ADSL) Single mode Fiber measures: BW * distance as 3X/year 1/17/01 CMPUT429/CMPE382 Amaral Connecting Multiple Computers • Shared Media vs. Switched: pairs communicate at same time: “point-to-point” connections • Aggregate BW in switched network is many times shared – point-to-point faster since no arbitration, simpler interface • Arbitration in Shared network? – Central arbiter for LAN? – Listen to check if being used (“Carrier Sensing”) – Listen to check if collision (“Collision Detection”) – Random resend to avoid repeated collisions; not fair arbitration; – OK if low utilization 1/17/01 (A. K. A. data switching interchanges, multistage interconnection networks, interface message processors) CMPUT429/CMPE382 Amaral Example Interconnects Interconnect MPP Example Maximum length CM-5 Ethernet 25 m 500 m; between nodes optical: 2 km—25 km 4 1 40 MHz 10 MHz Switch Shared 2048 254 ATM copper: 100 m Š5 repeaters Copper Twisted pair copper wire or optical fiber Number data lines Clock Rate Shared vs. Switch Maximum number of nodes Media Material 1/17/01 LAN Twisted pair copper wire or Coaxial cable WAN 1 •155.5 MHz Switch > 10,000 CMPUT429/CMPE382 Amaral Switch Topology • Structure of the interconnect • Determines – Degree: number of links from a node – Diameter: max number of links crossed between nodes – Average distance: number of hops to random destination – Bisection: minimum number of links that separate the network into two halves (worst case) • Warning: these three-dimensional drawings must be mapped onto chips and boards which are essentially two-dimensional media – Elegant when sketched on the blackboard may look awkward when constructed from chips, cables, boards, and boxes (largely 2D) • Networks should not be interesting! 1/17/01 CMPUT429/CMPE382 Amaral Important Topologies N = 1024 Type Degree Diameter Ave Dist Bisection Diam Ave D 1D mesh Š2 N-1 1 2D mesh Š4 2(N1/2 - 1) 2N1/2 / 3 N1/2 63 21 3D mesh Š6 3(N1/3 - 1) 3N1/3 / 3 N2/3 ~30 ~10 nD mesh Š 2n n(N1/n - 1) nN1/n / 3 N(n-1) / n Ring 2 N/2 N/4 2 2D torus 4 N1/2 N1/2 / 2 2N1/2 32 16 k-ary n-cube 2n (N = kn) n(N1/n) nk/2 nN1/n/2 nk/4 15 8 (3D) Hypercube n = LogN n/2 10 5 N/3 (N = kn) n 2kn-1 N/2 Cube-Connected Cycles Hypercude 23 1/17/01 CMPUT429/CMPE382 Amaral Topologies (cont) N = 1024 Type Degree Diameter Ave Dist Bisection Diam Ave D 2D Tree 3 2Log2 N ~2Log2 N 1 20 ~20 4D Tree 5 2Log4 N 2Log4 N - 2/3 1 10 9.33 kD k+1 Logk N 2D fat tree 4 Log2 N N 2D butterfly 4 Log2 N N/2 20 20 Fat Tree 1/17/01 CMPUT429/CMPE382 Amaral Butterfly Multistage: nodes at ends, switches in middle N/2 Butterfly ° ° ° • All paths have equal length • Unique path from any input to any output N/2 Butterfly 1/17/01 ° ° ° • Conflicts that try to avoid • Don’t want algortihm to have to know paths CMPUT429/CMPE382 Amaral Summary: Interconnections • Communication between computers • Packets for standards, protocols to cover normal and abnormal events • Performance issues: HW & SW overhead, interconnect latency, bisection BW • Media sets cost, distance • Shared vs. Swicthed Media determines BW • HW and SW Interface to computer affects overhead, latency, bandwidth • Topologies: many to chose from, but (SW) overheads make them look alike; cost issues in topologies, not algorithms CMPUT429/CMPE382 1/17/01 Amaral Review: Performance Metrics Sender Sender Overhead Transmission time (size ÷ bandwidth) (processor busy) Time of Flight Transmission time (size ÷ bandwidth) Receiver Overhead Receiver Transport Latency (processor busy) Total Latency Total Latency = Sender Overhead + Time of Flight + Message Size ÷ BW + Receiver Overhead Includes header/trailer in BW calculation? 1/17/01 CMPUT429/CMPE382 Amaral Connection-Based vs. Connectionless • Telephone: operator sets up connection between the caller and the receiver – Once the connection is established, conversation can continue for hours • Share transmission lines over long distances by using switches to multiplex several conversations on the same lines – “Time division multiplexing” divide B/W transmission line into a fixed number of slots, with each slot assigned to a conversation • Problem: lines busy based on number of conversations, not amount of information sent • Advantage: reserved bandwidth 1/17/01 CMPUT429/CMPE382 Amaral Connection-Based vs. Connectionless • Connectionless: every package of information must have an address => packets – Each package is routed to its destination by looking at its address – Analogy, the postal system (sending a letter) – also called “Statistical multiplexing” – Note: “Split phase buses” are sending packets 1/17/01 CMPUT429/CMPE382 Amaral Routing Messages • Shared Media – Broadcast to everyone • Switched Media needs real routing. Options: – Source-based routing: message specifies path to the destination (changes of direction) – Virtual Circuit: circuit established from source to destination, message picks the circuit to follow – Destination-based routing: message specifies destination, switch must pick the path » deterministic: always follow same path » adaptive: pick different paths to avoid congestion, failures » Randomized routing: pick between several good paths to balance network load 1/17/01 CMPUT429/CMPE382 Amaral Deterministic Routing Examples • mesh: dimension-order routing – (x1, y1) -> (x2, y2) – first x = x2 - x1, – then y = y2 - y1, • hypercube: edge-cube routing – X = xox1x2 . . .xn -> Y = yoy1y2 . . .yn – R = X xor Y – Traverse dimensions of differing address in order 110 010 111 • tree: common ancestor • Deadlock free? 011 100 000 001 1/17/01 101 CMPUT429/CMPE382 Amaral Store and Forward vs. Cut-Through • Store-and-forward policy: each switch waits for the full packet to arrive in switch before sending to the next switch (good for WAN) • Cut-through routing or worm hole routing: switch examines the header, decides where to send the message, and then starts forwarding it immediately – In worm hole routing, when head of message is blocked, message stays strung out over the network, potentially blocking other messages (needs only buffer the piece of the packet that is sent between switches). CM-5 uses it, with each switch buffer being 4 bits per port. – Cut through routing lets the tail continue when head is blocked, compresses the whole message into a single switch. (Requires a buffer large enough to hold the largest packet). 1/17/01 CMPUT429/CMPE382 Amaral Store and Forward vs. Cut-Through • Advantage of cut-through and store-and-forward: – Latency reduces as a function of: number of intermediate switches X size of the packet to time for 1st part of the packet to negotiate the switches + (packet size / interconnect BW) – (see example on page 594 of Textbook) 1/17/01 CMPUT429/CMPE382 Amaral Congestion Control • Packet switched networks do not reserve bandwidth; this leads to contention (connection based limits input) • Solution: prevent packets from entering until contention is reduced (e.g., freeway on-ramp metering lights) • Options: – Packet discarding: If packet arrives at switch and there is no room in buffer, the packet is discarded (e.g., UDP) – Flow control: between pairs of receivers and senders; use feedback to tell sender when it is allowed to send next packet » Back-pressure: separate wires to tell sender to stop » Window: destination gives original sender right to send N packets before getting permission to send more; overlaps latency of interconnection with overhead to send & receive packet (e.g., TCP), adjustable window 1/17/01 CMPUT429/CMPE382 Amaral Congestion Control (cont.) • Options (cont.): – Choke packets: aka “rate-based”; » Limit traffic only when the network is congested; » Each switch monitors itself and enters on a warning state when it passes a threshold; » Each packet received by a switch that is in the warning state is sent back to the source as a choke packet, which contains the original destination. » When it receives a choke packet, the source reduces traffic to that destination by a fixed % (e.g., ATM) 1/17/01 CMPUT429/CMPE382 Amaral Practical Issues for Inteconnection Networks • Standardization advantages: – low cost (components used repeatedly) – stability (many suppliers to chose from) • Standardization disadvantages: – Time for committees to agree – When to standardize? » Before anything built? => Committee does design? » Too early suppresses innovation • Perfect interconnect vs. Fault Tolerant? – Will SW crash on single node prevent communication? (MPP typically assume perfect) • Reliability (vs. availability) of interconnect 1/17/01 CMPUT429/CMPE382 Amaral Practical Issues Interconnection Example Standard Fault Tolerance? Hot Insert? MPP CM-5 No No No LAN Ethernet Yes Yes Yes WAN ATM Yes Yes Yes • Standards: required for WAN, LAN! • Fault Tolerance: Can nodes fail and still deliver messages to other nodes? required for WAN, LAN! • Hot Insert: If the interconnection can survive a failure, can it also continue operation while a new node is added to the interconnection? required for CMPUT429/CMPE382 WAN, LAN! 1/17/01 Amaral Cross-Cutting Issues for Networking • Efficient Interface to Memory Hierarchy vs. to Network – SPEC ratings => fast to memory hierarchy – Writes go via write buffer, reads via L1 and L2 caches • Example: 40 MHz SPARCStation(SS)-2 vs 50 MHz SS-20, no L2 cache vs 50 MHz SS-20 with L2 cache I/O bus latency; different generations • SS-2: combined memory, I/O bus => 200 ns • SS-20, no L2$: 2 busses +300ns => 500ns • SS-20, w L2$: cache miss+500ns => 1000ns 1/17/01 CMPUT429/CMPE382 Amaral Protocols: HW/SW Interface • Internetworking: allows computers on independent and incompatible networks to communicate reliably and efficiently; – Enabling technologies: SW standards that allow reliable communications without reliable networks – Hierarchy of SW layers, giving each layer responsibility for portion of overall communications task, called protocol families or protocol suites • Transmission Control Protocol/Internet Protocol (TCP/IP) – This protocol family is the basis of the Internet – IP makes best effort to deliver; TCP guarantees delivery – TCP/IP used even when communicating locally: NFS uses IP even though communicating across homogeneous LAN 1/17/01 CMPUT429/CMPE382 Amaral Protocol • Key to protocol families is that communication occurs logically at the same level of the protocol, called peer-to-peer, but is implemented via services at the lower level • Danger that each level increases latency if implemented as a hierarchy (e.g., multiple check sums) 1/17/01 CMPUT429/CMPE382 Amaral TCP/IP packet 1/17/01 • Application sends message • TCP breaks into 64KB segments, adds 20B header • IP adds 20B header, sends to network • If Ethernet, broken into 1500B packets with headers, trailers • Header, trailers have length field, destination, window number, version, ... Ethernet IP Header TCP Header IP Data TCP data (Š 64KB) CMPUT429/CMPE382 Amaral Example Networks • Ethernet: shared media 10 Mbit/s proposed in 1978, carrier sensing with expotential back-off on collision detection • 10 Mbit Ethernet successors? – – – – – 1/17/01 FDDI: shared media (too late) ATM (too late?) Switched Ethernet 100 Mbit Ethernet (Fast Ethernet) Gigabit Ethernet CMPUT429/CMPE382 Amaral Connecting Networks • Bridges: connect LANs together, passing traffic from one side to another depending on the addresses in the packet. – operate at the Ethernet protocol level – usually simpler and cheaper than routers • Routers or Gateways: these devices connect LANs to WANs or WANs to WANs and resolve incompatible addressing. – Generally slower than bridges, they operate at the internetworking protocol (IP) level – Routers divide the interconnect into separate smaller subnets, which simplifies manageability and improves security • Cisco is major supplier; basically special purpose computers 1/17/01 CMPUT429/CMPE382 Amaral Example Networks MPP LAN WAN IBM SP-2 100 Mb Ethernet Length (meters) 10 Number data 8 lines 40 MHz Clock Rate Switch? Yes Nodes (N) Š512 Material copper Bisection BW 320xNodes (Mbit/s) 320 Peak Link BW (Mbits/s) Measured Link 284 BW 1/17/01 ATM 200 100/1000 1 1 100 MHz 155/622… No Yes Š254 copper 10000 copper/fiber 100 155xNodes 100 155 -- 80 CMPUT429/CMPE382 Amaral Example Networks (cont’d) MPP LAN WAN IBM SP-2 100 Mb Ethernet Latency (µsecs) Send+Receive Ovhd (µsecs) Topology Connectionless? Store & Forward? Congestion Control Standard Fault Tolerance 1/17/01 ATM 1 1.5 50 39 440 630 Fat tree Line Star Yes Yes No No No Yes Backpressure Carrier Sense Choke packets No Yes Yes Yes Yes Yes CMPUT429/CMPE382 Amaral Examples: Interface to Processor 1/17/01 CMPUT429/CMPE382 Amaral Packet Formats • Fields: Destination, Checksum(C), Length(L), Type(T) • Data/Header Sizes in bytes: (4 to 20)/4, (0 to CMPUT429/CMPE382 1500)/26, 48/5 1/17/01 Amaral Example Switched LAN Performance Network Interface Switch Link BW AMD Lance Ethernet Baynetworks 10 Mb/s EtherCell 28115 Fore SBA-200 ATM Fore ASX-200 155 Mb/s Myricom Myrinet Myricom Myrinet 640 Mb/s • On SPARCstation-20 running Solaris 2.4 OS • Myrinet is example of “System Area Network”: networks for a single room or floor: 25m limit 1/17/01 – shorter => wider faster, less need for optical – short distance => source-based routing => simpler switches – Compaq-Tandem/Microsoft also sponsoring SAN, called “ServerNet” CMPUT429/CMPE382 Amaral Networking Summary • Protocols allow hetereogeneous networking – Protocols allow operation in the presense of failures • Routing issues: store and forward vs. cut through, congestion, ... • Standardization key for LAN, WAN – Internetworking protocols used as LAN protocols => large overhead for LAN • Integrated circuit revolutionizing networks as well as processors • Switch is a specialized computer 1/17/01 CMPUT429/CMPE382 Amaral