Introduction to Computer Science
CSCI 109
Andrew Goodney
Fall 2018
China – Tianhe-2
Introduction to Computer Science CSCI 109 China Tianhe-2 Andrew - - PowerPoint PPT Presentation
Introduction to Computer Science CSCI 109 China Tianhe-2 Andrew Goodney Fall 2018 Lecture 9: Networks October 29th, 2018 Schedule 1 Midterm Scores u 30 questions, 1 point each u
Fall 2018
China – Tianhe-2
1
u 30 questions, 1 point each u Max score: 30 u Min score: u Mean:
2
u Computer networks everywhere!
v Headed towards IoT (*everything* electronic on a network)
u How did we get here?
3
4
u 1960’s
v ”Mainframe” computers = $$MM v Universities and Government facilities install at designated places
(UIUC, UCSD, etc.)
v Allow remote access to researchers across the country to better utilize v Mainframes – 100% busy
u Dumb Terminals and analog modems
5
Phone call
u Any issues with this model?
v Analog connections slow (300BPS) v Only so many phone lines v Long distance calls were expensive
6
u Mid to late 1960’s digital circuits improve things u Also, computer-to-computer communication
7
mainframe
(smaller) mainframe
64kbps digital circuit
(smaller) mainframe (smaller) mainframe
u Terminals in office -> local main frame u Local mainframe -> digital circuit -> big main frame u Key observations:
v Multiple users v Computer-to-computer
8 7
u Still not ideal… u Connections are “circuit switched” (dedicated) between
u What happens when no one is using the circuit? u Really only one dumb-terminal can use connection at a time u Do humans time share well? u Digital circuits still expensive u Also, computer-to-computer identified as key application
9
u Need a way to:
v Connect users at terminals to remote computers v Connect many users at the same time (fairly) v Allow computer-to-computer communications v Maximize the utilization of expensive digital links
10
u What is a packet? u Chunks of user data u And VERY IMPORTANTLY u Meta-data (header) about where the packet is from, and
11
u Now we can build “packet-switched” networks
12
64kbps digital circuit
u What do we have now? u Terminals connect to local computers u Data is broken up into packets sent to switch u Can go to other local computers u Or, switch can ”forward” packet to remote switch u Remote switch sends packet to big, expensive main frame u Main advantage: links are shared amongst all users, or
u Nothing is dedicated to one connection
13
u Sharing and utilization is main advantage of packet switching
14
N users 1 Mbps link example: § 1 Mb/s link § each user:
u circuit-switching:
v 10 users
u packet switching:
v with 35 users, probability > 10
active at same time is less than .0004
v with 50 users, P = 0.01
u How did we make the jump to packet switching? u Idea came about late 1960’s u ARPA (Advanced Research Projects Agency)
v US-DOD wanted packet switched computer-to-computer networks v Seen as crucial to Cold War effort
u This is queueing theory, packet switching is a lot like lines at
15
u Len Kleinrock writes PhD thesis on queuing theory/packet
v All theoretical, didn’t exist yet
u ARAP contacts and says “Hey you seem like just the right guy,
u Gets faculty position at UCLA (~1963), embarks on project u With BBN, builds Interface Message Processor (IMP) (packet
u 49 years ago (today!), sends first message from UCLA to
16
17
u Everything on the network is either:
v Host
u sends or receives data
v Packet switch
u receives packets on interfaces and forwards to other switches or hosts
v Communication link
u Physical connection between two devices that carries data
u Store and forward
v Packet switches “store and forward”
u Receive a packet u Store it (store) u Figure out where to send it (forward) 18
u How do we build modern networks? u The Internet is a network of
u Internet edge:
v Access networks connects hosts to the
network
v Access networks connect to networks in
the core
u Internet Core:
v Networks of networks (ISPs) connecting
together
19
mobile network global ISP regional ISP home network institutional network
u Access networks are Local Area Networks (LANs)
v Host (desktops, laptops, servers) v Switches v Routers
u Routers are special packet switches that bridge (connect)
u WAN = Wide Area Network
v Connects from LAN to network core
20
u Network Core
v LANs and WAN connections from access networks to ISPs v And between ISPs
21
u First look at access networks
v How do we connect hosts (pc, laptop, server, phones) to the network
22
u In 2018 (almost?) all LANs are built with Ethernet
u Homes, businesses, university campus u Built with
v twisted pair (“Ethernet cable”) v Wifi v Optical fiber v Power lines
u Wide range of speeds
v 10M, 100M, 1G, 10G, 40G, 100G
23
24
to/from headend or central office
Cable, DSL modem, or fiber router, firewall, NAT wired Ethernet (100 Mbps
wireless access point (100->1000 Mbps)
wireless devices
25
Ethernet switch institutional mail, web servers institutional router institutional link to ISP (Internet)
u typically used in companies, universities, etc
v 10 Mbps, 100Mbps, 1Gbps, 10Gbps, 40G, 100G transmission rates v today, end systems typically connect into Ethernet switch
u Wireless access to phones, etc u Provided by cellular operators u 2G (dead?), 3G, 4G, now 5G u Speeds vary
v 100’s kilobits/s (2G) v 5G 300Mbps+
26
to Internet
u How to connect access networks to the core?
27
u Digital Subscriber Line (DSL)
v Uses existing phone lines v 10 - 100Mbps v Homes and small businesses
28
central office
ISP
telephone network DSLAM voice, data transmitted at different frequencies over dedicated line to central office
DSL modem splitter
DSL access multiplexer
29
data, TV transmitted at different frequencies over shared cable distribution network
cable modem splitter
cable headend CMTS
ISP
cable modem termination system
v HFC: hybrid fiber coax
§ asymmetric: up to 1Gbps downstream transmission rate, <20 Mbps upstream transmission rate
v network of cable, fiber attaches homes to ISP router
§ homes share access network to cable headend § unlike DSL, which has dedicated access to central office
v Homes and small business
u Institutional networks, ISP to ISP u Laser light on optical fiber u Speeds 100M to 100G u Some homes!
v ATT Fiber, Google Home, other lucky people!
30
u Communication links can be made up of different physical
31
u Twisted Pair: two copper wires twisted around each other u Examples: old phone lines, CAT5(6,7) Ethernet cables u Bandwidth: 100M to 2.5G per pair u Usually multiple pairs per cable
32
u Coaxial cable: center conductor surrounded by insulation
u Carries radio frequency signals u “CableTV” (cable modem) wires in your house, DS3 other
u 100M to 10G per cable
33
u Extremely thin glass cables called strands u Laser light used to transmit data u Can carry multiple wavelengths at once (i.e. multiple
u Essentially unlimited bandwidth per strand u Typically 1G to 100G per wavelength u 96 wavelengths per strand u Short distance: Ethernet on campus u Long distance, undersea u Propagates at 60% speed of light
34
u Also known as radio waves u Connects through free space (no wires) u Wi-fi, cellular, satellite, specialized microwave services u Bandwidth depends on frequency, channel width,
v 900MHz, 2.4GHz, 5GHz, 60GHz
u Propagation affected by walls, buildings, trees, ground,
u Some free-space laser links exist, not very common
35
u Keep saying “network of networks” u What do we mean? u Basic goal of Internet “end to end” communication
v Any host can talk to any host
u End systems connect to Internet via access ISPs (Internet Service
Providers)
v Residential, business and university ISPs
u Access ISPs in turn must be interconnected.
v So that any two hosts can send packets to each other
u Resulting network of networks is very complex
v Evolution was driven by economics and national policies
u Let’s take a stepwise approach to describe current Internet structure
36
u To enable end-to-end communication, all access nets (millions)
37
access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net
u Naïve solution: direct connect every ISP together!
38
access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net
u Solution: One global ISP connects access nets hierarchically u Not possible, never happened…
39
access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net
40
access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net
ISP B ISP A ISP C
IXP IXP
u Regional ISPs arose to connect access nets (schools,
u Regional ISPs connected together at IXPs (Internet Exchange
u Specialized regional networks connect some access networks
v Educational: Los Nettos (socal .edu) v Metro area networks: City chartered networks to lower connection
costs for businesses
41
42
access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net access net
ISP B ISP A ISP C
IXP IXP
regional net
u
at center: small # of well-connected large networks
v
“tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national & international coverage
v
content provider network (e.g, Google): private network that connects it data centers to Internet,
43
access ISP access ISP access ISP access ISP access ISP access ISP access ISP access ISP
u Material so far is how we build packet switched networks u From another perspective: how does data get to the other
44
u All communication on networks is moderated by one or more
u Human protocols:
v ”What time is it?” “Excuse me, where is…” v Introductions, small talk, etc.
u Network Protocols
v Machine to machine
u Network protocols: define the format and order of messages
45
46
Got the time?
TCP connection response
time
TCP connection request Get http://www.awl.com/kurose-ross
u From the programmers perspective, the network is a black-
u A set of infrastructure components that provide an API to get
47
GET http://www.usc.edu/
u To get from device to server and back
v Data must be packetized v Traverse access network à ISP à ISP à ISP à access network à
server (and back)
v Travel across heterogeneous network types, physical layers
u Does (should?) the programmer worry about any of this? u No! It just works. u What is the solution? u A series of Abstractions!
48
u First an analogy
49
ticket (purchase) baggage (check) gates (load) runway takeoff airplane routing ticket (complain) baggage (claim) gates (unload) runway landing airplane routing airplane routing
u Goal: get from one city to the other
v via its own internal-layer actions v relying on services provided by layer below
50
ticket (purchase) baggage (check) gates (load) runway (takeoff) airplane routing
departure airport arrival airport intermediate air-traffic control centers
airplane routing airplane routing ticket (complain) baggage (claim gates (unload) runway (land) airplane routing
ticket baggage gate takeoff/landing airplane routing
u Explicit structure eases system design in highly complex
v Adds structure to the design process
u Modularity
v Each layer provides a service to the layer above, essentially abstracting
the connection details away
v Layers can be updated and improved as long as services offered don’t
change
v Each layer ABSTRACTS the connection between devices at that layer
u Ease for application programmers
v Minimum amount to learn v Use the API provided by upper layers, let the rest sort it out
51
52
Packet flow
abstract connection
u Each layer adds a header as a packet flows down u Header contains the information necessary for that layer to
u Header is removed as data flows up
53
54
Typically software layers Typically hardware layers
u TCP/IP Most famous protocol suite u TCP
v Layer 4 protocol v Guarantees in-order delivery of packets
u Either they get to the other side in order u Or both hosts know a packet was lost
v Offers ”data stream” abstraction to layers above
u IP (Internet Protocol)
v Layer 3 protocol v All “Internet” traffic is IP traffic v Handles addressing (IP addresses) and routing of packets across the
Internet
v No guarantees, packets routed best effort v Offers host-to-host packet service to layers above 55
u Performance Metrics for Networks u Bandwidth - ”how fast is my network”
v How much data (bits) can I get to the other side per second v Applies to communication links, as well as across the network
u Latency – “How slow is my network”
v How long does it take for data to get from one side to the other v Measured in time: s, ms, us
u Loss – “How bad is my network”
v Fraction of packets that get dropped (don’t make it to the other side) v Needs to be <<1% for good network operation
u Throughput – “How good is my network”
v Considering how bandwidth, latency, loss combine with a protocol to
measure how much is actually delivered per unit time
v This is what applications see 56
u “the Internet” came out of (D)ARPA projects in the 1960’s,
u Primary driver was to enable computer-to-computer
57
u Paper for 1988: “The Design Philosophy of the DARPA Internet Protocols”
(David Clark, 1988).
u In PRIORITY order
u 1. Continue despite loss of network infrastructure (degrade, but still function
under attack)
u 2. Support multiple types of communication services (many different
applications)
u 3. Accommodate a variety of networks (e.g. early networks were not all
Ethernet, today’s networks use Ethernet at layer 2, layer 1 is very different)
u 4. Permit distributed management of Internet resources (no one entity is
required for network to function)
u 5. Cost effective u 6. Host attachment should be easy (only local changes required to add host) u 7. Resource accountability (security) 58
u Many of these goals made the Internet as we know it
u Especially the middle 4:
u Support multiple types of communication services (many different
applications)
u Accommodate a variety of networks (e.g. early networks were not all Ethernet,
today’s networks use Ethernet at layer 2, layer 1 is very different)
u Permit distributed management of Internet resources (no one entity is
required for network to function)
u Cost effective 59
u However, some make things interesting u 4. Permit distributed management of Internet resources
u Originally indented to make the network resilient in a military
u Now: basically no one is in charge
v 7. Resource accountability
u If you read the paper, they basically never got to this u This is why Internet security is such a disaster, it wasn’t designed
u Network agents implicitly trusted, this still causes problems, see
60
61
62
63
u ARPANet switches to TCP/IP – still in use!
u Information Sciences Institute
v Part of USC under Viterbi v Researchers, grad students, undergrads v In beautiful MDR
u Became prominent in developing early Internet protocols
v IP
u “The internet protocol provides for transmitting blocks of data called datagrams
from sources to destinations, where sources and destinations are hosts identified by fixed length addresses.”
v ICMP v Domain Name System v Simple Mail Transport Protocol
u ICANN nee IANA
v Internet Assigned Numbers Authority -> ICANN v (USC basically ran the Internet) 64
u Networks allow computers to communicate (exchange data) u Data is broken into packets (small chunks) and sent over shared circuits
(packet switching) by switches and routers
u Internet is a network-of-networks – No one owner/regulator u The Internet provides an API for a service (networking) that lets app
developers write software (abstraction)
u Services are implemented with protocols that are stacked in layers (more
abstraction)
u TCP/IP is the core protocol on which most internetworking is based u Security was not an important design feature when the Internet was invented
– we’re still paying for this now
u Bandwidth, latency, loss, throughput are the important network performance
metrics
u USC/ISI has been involved in inventing the modern Internet since (not quite)
the beginning (e.g DNS, IANA, ICANN)
65