Welcome! Operating Systems and Networks • Brief introduction of lecturer and TAs – Adrian Perrig, Professor in Department of Computer Science, Director of Network Security Group – Exercise sessions: David Barrera (PhD), Raphael Reischuk (PhD) – Labs / homeworks: Tae-Ho Lee, Chris Pappas Networks Part 1: Introduction – Network security group research area: design and implementation of secure future Internet architecture (SCION project http://www.scion-ar c hit e ct ur e .ne t )

Adrian Perrig Network Security Group ETH Zürich

2

Course Structure Lecture Style

• Lectures • Student interaction is encouraged! • Homework – Please ask questions if something is unclear • Projects – Please point out any errors that you spot – • Exercise sessions Please focus on lecture instead of facebook, twitter, etc. • Quizzes • Please turn off cell phone and Wi F i during class

3 4

Minds open…

… Laptops closed and cell phones / ipads off

6 Textbook and Slide Credit Problems with Being On-line During Class • Textbook: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edition, 2011. • It takes the mind a few minutes to reach a state of deep • Slides adapted from slide deck by David Wetherall concentration • Lecture video at: – Reaching deep concentration needs to be trained, many people http://media.pearsoncmg.com/ph/streaming/esm/tanenbaum5e_videon have lost this ability due to constant / frequent interruptions otes/tanenbaum_videoNotes.html • Knowing that one cannot be interrupted increases concentration. Said another way: Expectation of interruption prevents deep concentration – Try to be off-line when studying networking! • Open laptop / iPad / cell phone used for surfing can also disrupt / interrupt people sitting behind you

7

Highly Recommended as Reference Also recommended • Larry L. Peterson and Bruce S. • Kevin R. Fall and W. Davie: Richard Stevens: “Computer Networks: A Systems Approach” “TCP/IP Illustrated, • 5th Edition Volume 1: The Protocols” • 2nd Edition, 2011

9

Also recommended Study Recommendations Computer Networking: A Top-Down Approach: Kurose and Ross • Make list of acronyms, concepts 5th Edition • Read corresponding sections in text book – Available in INFK library • Participate in exercise sessions, solve homework, Srinivasan Keshav: and DO THE PROJECTS! An Engineering Approach to Computer Networking 11 12 Homework Assignment Presentations Projects • We will have 2 hands-on projects • Assignments are posted at the end of each week and presented in the following week – Reliable communication – Routing • Projects are completed in groups of 3-4 students – Register at http://bit.ly/22OxK0S – First project will be posted by Friday midnight on course web page and presented next week

13 14

Final Grade Focus of the course

• Projects & Exercises are optional – but highly recommended to do them • Networking grade = exam grade ??? • Final grade = average( Networking grade, OS grade )

15 16

Focus of the course (2) The Main Point • Three “networking” topics: 1. To learn how the Internet works – What really happens when you “browse the web”? Distributed systems – What are TCP/IP, DNS, HTTP, NAT, VPNs, 802.11 etc. anyway? Networking 2. To learn the fundamentals of computer networks Communications

• We mainly study the Networking aspects

17 18 Why learn about the Internet? From this experimental network …

1. Curiosity ARPANET ~1970 2. Understand how the system works we’re spending most of our time with – Interesting statistic: we’re spending more time online than sleeping! 3. Impact on our world (a) Dec. 1969. (b) July 1970. (c) March 1971. 4. Job prospects!

19 20

To this! Internet – Societal Impact Internet ~2005 • An enabler of societal change • An everyday institution – Easy access to knowledge used at work, home, – Electronic commerce and on-the-go – Personal relationships • Visualization contains – Discussion without censorship millions of links

Attribution: By Th e Op te Project [CC-BY-2.5], vi a W i ki med i a C o mmo n s

21 22

Internet – Economic impact The Main Point (2) 1. To learn how the Internet works • An engine of economic growth 2. To learn the fundamentals of computer – Advertising-sponsored search networks – Online stores – What hard problems must they solve? – Online marketplaces – Crowdsourcing – What design strategies have proven valuable?

23 24 Why learn the Fundamentals? Fundamentals – Intellectual Interest

1. Apply to all computer networks • Example key problem: Reliability! – Any part of the Internet might fail 2. Intellectual interest – Messages might be corrupted – How to create a reliable network out of unreliable 3. Change / reinvention components? 4. Pass this course :-) • Reliability solutions – Codes to detect/correct errors – Routing around failures ...

25 26

Fundamentals – Intellectual Interest (2) Fundamentals – Reinvention

Key problem Example solutions • The Internet is constantly being re-invented! Reliability despite Codes for error detection/correction (§3.2, 3.3) – Growth over time and technology trends drive failures Routing around failures (§5.2) Network growth Addressing (§5.6) and naming (§7.1) upheavals in Internet design and usage and evolution Protocol layering (§1.3) • Today’s Internet is different from yesterday’s Allocation of resources Multiple access (§4.2) like bandwidth Congestion control (§5.3, 6.3) – And tomorrow’s will be different again Security against Confidentiality of messages (§8.2, 8.6) – But the fundamentals remain the same various threats Authentic ation of communicating parties (§8.7)

27 28

Fundamentals – Reinvention (2) Fundamentals – Reinvention (3) • Examples of upheavals in the past 1-2 decades • Currently around 1.1 billion Growth / Tech Driver Upheaval Internet hosts … Emergence of the web Content Distribution Networks Digital songs/videos Peer-to-peer file sharing Falling cost/bit Voice-over-IP cal li ng Many Internet hosts IPv6 Wireless advances Mobile devices

29 30 Not a Course Goal Example Uses of Networks

• Work: • To learn IT job skills – Email, file sharing, printing, … – How to configure equipment • Home: • E.g., Cisco certifications – Movies / songs, news, calls / video / messaging, e- – But course material is relevant, and we use hands-on commerce, What do these uses tell us about … tools • Mobile: why we build networks? – Calls / texts, games, videos, maps, information access …

31 32

For User Communication For Resource Sharing • • From the telephone onwards: Many users may access the same underlying resource – VoIP (voice-over-IP) – E.g., 3D printer, search index, machines in the cloud – Video conferencing →More cost effective than dedicated resources per user – Instant messaging – – Social networking Even network links are shared via statistical multiplexing →Enables remote communication – Need low latency for interactivity

33 34

Statistical Multiplexing Statistical Multiplexing (2) • Sharing of network bandwidth between users according • Example: Users in an ISP network 5 to the statistics of their demand – Network has 10 0 Mbps (units of bandwidth) 100 . . . – (Multiplexing just means sharing) – Each user subscribes to 5 Mbps, for videos ISP 5 – Useful because users are mostly idle and their traffic is bursty – But a user is active only 50% of the time … 5 • How many users can the ISP support? • Key question: – With dedicated bandwidth for each user: – How much does it help? – Probability all bandwidth is used: (assuming independent users)

35 36 Statistical Multiplexing (3) For Content Delivery • With 30 independent users, still unlikely (2% chance) to • Same content is delivered to many users need more than 100 Mbps! – Videos (large), songs, apps and upgrades, web pages, – Binomial probabilities … → Can serve more users with the same size network – Statistical multiplexing gain is →More efficient than sending a copy all the way to 30/20 or 1.5X each user – But may get unlucky; users will have degraded service – Uses replicas in the network

37 38

Content Delivery (2) Content Delivery (3)

• Sending content from the source to 4 users takes 4 x 3 = • But sending content via replicas takes only 4 + 2 = 6 12 “network hops” in the example “network hops”

User User

...... Source Source Replica User User

39 40

For Computer Communication To Connect Computers to the Physical World

• To let computers interact with other computers • For gathering sensor data, and for manipulating the – E.g., e-commerce, backup, cloud computing world – E.g., webcams, location on mobile phones, door locks, … →Enables automated information processing across different parties • This is a rich, emerging usage (IoT: Internet of Things)

41 42 The Value of Connectivity The Value of Connectivity (2) • “Metcalfe’s Law” ~1980: Bob Metcalfe • Example: both sides have 12 nodes, but the left network – The value of a network of N nodes is has more connectivity proportional to N2 – Large networks are relatively more valuable than small ones vs +

66 connections 15 connections 15 connections : © 2009 IEEE 43 44

Parts of a Network Component Names

Component Function Example application Applic ation, or app, user Uses the network Skype, iTunes, Amazon Host, or end-system, edge Supports apps Laptop, mobile, desktop device, node, source, sink Router, or switc h, node, Relays messages Access point, cable/DSL hub, intermediate system between links modem router link host Link, or c hannel Connects nodes Wires, wireless

45 46

Types of Links Wireless Links • Message is broadcast • Full-duplex – – Bidirectional Received by all nodes in range – Not a good fit with our model • Half-duplex – Bidirectional

• Simplex – unidirectional

47 48 Wireless Links (2) A Small Network

• Often show logical links • Connect a couple of computers – Not all possible connectivity

• Next, a large network …

49 50

Example Networks

• Commonly known by type of technology or their purpose

• [see how many you can give]

Source: Internet2 52

Example Networks (2) Network names by scale • WiFi (802.11) • Enterprise / Ethernet Scale Type Example • ISP (Internet Service Provider) Vicinity PAN (Personal Area Network) Bluetooth (e.g., headset) • Cable / DSL Building LAN (Local Area Network) WiFi, Ethernet • Mobile phone / cellular (2G, 3G, 4G) City MAN (Metropolitan Area Network) Cable, DSL • Bluetooth Country WAN (Wide Area Network) Large ISP • Tel ephone Planet The Internet (network of all networks) The Internet! • VANET • Satellite ...

53 54 Internetworks Network Boundaries

• An internetwork, or internet, is what you get when you • What part is the “network”? join networks together – Just another network app • The Internet (capital “I”) is the internet we all use router host link

55 56

Network Boundaries (2) Key Interfaces • Between (1) apps and network, and (2) network • Cloud as a generic network components – More formal treatment later on app app

router host link

host

57 58

Key Interfaces (2) Key Interfaces (3) 1. Network-application interfaces define how apps use 2. Network-network interfaces define how nodes work the network together – Sockets are widely used in practice – Traceroute can peek inside the network

app app

host host

59 60 Network Service API Hides Details Traceroute Van Jacobson • Apps talk to other apps with no real idea of what is • Widely used command-line tool to inside the network let hosts peek inside the network – This is good! But you may be curious … – On all OSes (tracerton Windows) – Developed by Van Jacobson ~1987 app app – Uses a network-network interface (IP) in ways we will explain later ???

host host : Credit: Wikipedia (public domain)

61 62

Traceroute (2) Traceroute (3) • Probes successive hops to find network path

...... 1 hop 2 hops 3 hops N-1 hops N hops Local Local Remote Remote Host Host Host Host

63 64

Using Traceroute Using Traceroute (2) • ISP names and places are educated guesses

Home tde Te le f onic a Level3 pnw-gigapop UW 1 hop 3 hops 4 hops 6 hops 1 hop 3 hops

. . .

100 ms UW 180 ms >200 ms My computer NYC San Jose Seattle www. uw. edu (www1.cac.washington.edu)

65 66 Recently, some strange paths observed Networks Need Modularity (§1.3)

• http://research.dyn.com/2013/11/mitm-internet-hijacking/ • The network does much for apps: – Make and break connections – Find a path through the network We need a form of – Transfers information reliably – Transfers arbitrary length information modularity, to help – Send as fast as the network allows manage complexity – Shares bandwidth among users – Secures information in transit and support reuse – Lets many new hosts be added – …

67 68

Protocols and Layers Protocols and Layers (2)

• Protocols and layering is the main structuring method • Protocols are horizontal, layers are vertical used to divide up network functionality Instance of Peer Protocol X – Each instance of a protocol talks virtually to its peer using the protocol X X X instanc e protocol Service provided – Each instance of a protocol uses only the services of the lower Lower layer by Protocol Y instanc e (of layer protocol Y) Y Y

Node 1 Node 2

69 70

Protocols and Layers (3) Protocols and Layers (4) • Set of protocols in use is called a protocol stack • Protocols you’ve probably heard of: – TCP, IP, 802.11, Ethernet, HTTP, SSL, DNS, … and many more • An example protocol stack – Used by a web browser on a host that is wirelessly connected to the Internet

71 72 Protocols and Layers (5) Encapsulation

• Protocols you’ve probably heard of: Browser • Encapsulation is the mechanism used to effect protocol – TCP, IP, 802.11, Ethernet, HTTP, SSL, DNS, layering … and many more HTTP – Lower layer wraps higher layer content, adding its own • An example protocol stack TCP information to make a new message for delivery – Like sending a letter in an envelope; postal service doesn’t – Used by a web browser on a host that is IP wirelessly connected to the Internet look inside 802.11

73 74

Encapsulation (2) Encapsulation (3)

• Message “on the wire” begins to look like an onion HTTP HTTP HTTP HTTP – Lower layers are outermost TCP HTTP TCP TCP TCP HTTP HTTP HTTP IP TCP HTTP IP IP IP TCP HTTP TCP HTTP TCP 802.11 IP TCP HTTP 802.11 802.11 802.11 IP TCP HTTP IP TCP HTTP IP (network)

802.11 IP TCP HTTP 802.11 802.11 IP TCP HTTP

75 76

Encapsulation (4) Demultiplexing • Normally draw message like this: • Incoming message must be passed to the protocols that – Each layer adds its own header it uses

802.11 IP TCP HTTP SMTP HTTP DNS

First bits on the wire Last bits TCP UDP

• More involved in practice IP ARP – Trailers as well as headers, encrypt/compress contents – Segmentation (divide long message) and reassembly Ethernet ??

77 78 Demultiplexing (2) Advantage of Layering • Done with demultiplexing keys in the headers • Information hiding and reuse

SMTP HTTP DNS Browser Server Browser Server

TCP port number TCP UDP HTTP HTTP HTTP HTTP

IP protocol field TCP TCP TCP TCP IP ARP or IP IP IP IP Ethertype value Ethernet Incoming Host message 802.11 802.11 Ethernet Ethernet Ethernet IP TCP HTTP

79 80

Advantage of Layering (2) Advantage of Layering () • Using information hiding to connect different systems • Using information hiding to connect different systems Browser Server Browser Server HTTP IP TCP HTTP HTTP HTTP HTTP TCP TCP TCP TCP IP IP IP IP IP IP 802.11 802.11 Ethernet Ethernet 802.11 Ethernet 802.11 IP TCP HTTP Ethernet IP TCP HTTP

81 82

Disadvantage of Layering A Little Guidance Please … (§1.4, §1.6)

• Adds overhead • What functionality should we implement at which layer? – But minor for long messages – This is a key design question • Hides information – Reference models provide frameworks to guide us – App might care whether it is running over wired or wireless!

83 84 OSI “7 layer” Reference Model Internet Reference Model • A principled, international standard, to connect systems • A four layer model based on experience; omits some – Influential, but not used in practice. (Woops) OSI layers and uses IP as the network layer. – Provides functions needed by users – Converts different data representations Application – Programs that use network service – Manages task dialogs Transport – Provides end-to-end data delivery – Provides end-to-end delivery Internet – Send packets over multiple networks – Sends packets over multiple links – Sends frames of information Link – Send frames over a link – Sends bits as signals

85 86

Internet Reference Model (2) Internet Reference Model (3) • With examples of common protocols in each layer • IP is the “narrow waist” of the Internet – Supports many different links below and apps above

7 Application 7 Application SMTP HTTP RTP DNS 4 Transport 4 Transport TCP UDP 3 Internet 3 Internet IP

2/1 Link 2/1 Link Ethernet 3G Cable DSL 802.11

87 88

Standards Bodies Layer-based Names • Where all the protocols come from! • – Focus is on interoperability For units of data:

Body Area Examples Layer Unit of Data ITU Te l e c o m G.992, ADSL, H.264,MPEG4 Application Message IEEE Communications 802.3,Ethernet, 802.11, WiFi Transport Segment IETF Internet RFC 2616, HTTP/1.1 Network Packet RFC 1034/1035, DNS Link Frame W3C Web HTML5 standard CSS standard Physical Bit

89 90 Layer-based Names (2) Layer-based Names (3) • For devices in the network: • For devices in the network:

App App Repeater (or hub) PhysicalPhysical Proxy or Transport Transport middlebox Network Network Link Link or gateway Switch (or bridge) Link Link

Router Network Network But they all Link Link look like this!

91 92

A Note About Layers Course Reference Model • We mostly follow the Internet • They are guidelines, not strict – A little more about the Physical layer, and alternatives – May have multiple protocols working together in one layer – May be difficult to assign a specific protocol to a layer 7 Application – Programs that use network service • Some layer violations 4 Transport – Provides end-to-end data delivery – Application behaves differently depending on network loss 3 Network – Send packets over multiple networks rate or available bandwidth 2 Link – Send frames over one or more links 1 Physical – Send bits using signals

93 94

Lecture Progression Important Concepts • Bottom-up through the layers: • Important concepts in this lecture – Statistical multiplexing, statistical multiplexing gain Application -HTTP, DNS, CDNs Transport -TCP, UDP – OSI 7 layer model, interfaces, protocols Network - IP, NAT, BGP – Encapsulation, demultiplexing Link - Ethernet, 802.11 Physical - wires, fiber, wireless

95 96 Bonus Material: Rough Internet Timeline History of the Internet (§1.5.1) Estimated Hosts 9 10 3: Modern Internet & Web 106 2: NSFNET

103 1: ARPANET Year 1969 1982 1995 2013

97 98

The Beginning – ARPANET ARPANET – Influences • Leading up to the ARPANET (1960s): • ARPANET by U.S. DoD was the precursor to the Internet – Packet switching (Kleinrock, Davies), decentralized control (Baran) – Motivated for resource sharing Len Kleinrock – Launched with 4 nodes in 1969, grew to hundreds of hosts – First “killer app” was email

Credit: Credit: Internet Hall of Fame Credit: Internet Hall of Fame

99 100

ARPANET – Influences (2) ARPANET Geographical Map (Dec. 1978)

• In the early ARPANET 56 kbps links – Internetworking became the basis for the Internet – Pioneered by Cerf & Kahn in 1974, later became TCP/IP “IMPs” were – They are popularly known as early routers the “fathers of the Internet”

© 2009 IEEE © 2009 IEEE

Source: ARPANET Information Brochure, DCA 1979 101 102 Growing Up – NSFNET Early Internet Architecture • NSFNET ’85 supports educational networks • Hierarchical, with NSFNET as the backbone – Initially connected supercomputer sites, but soon became the backbone for all networks 56 kbps links in ‘85 1.5 Mbps links in ‘88 • Classic Internet protocols we use emerged NSFNET Backbone 45 Mbps links in ‘91 – TCP/IP (transport), DNS (naming), Berkeley sockets (API) in ’83, BGP (routing) in ’93 Regional Regional Regional Network Network • Much growth from PCs and Ethernet LANs Network – Campuses, businesses, then homes – 1 million hosts by 1993 … Customer Customer Customer Customer Customer Customer

103 104

Modern Internet – Birth of the Web Modern Internet Architecture • Complex business arrangements affect connectivity • After ’95, connectivity is provided by Tim Berners-Lee large ISPs who are competitors – Still decentralized, other than registering identifiers – Content Provider They connect at Internet eXchange IXP Transit ISP Point (IXP) facilities Content Provider – Later, large content providers connect IXP IXP Transit ISP Facility at which • Web bursts on the scene in ’93 networks connect – Growth leads to CDNs, ICANN in ‘98 Regional ISP Regional ISP Regional ISP – Most bits are video (soon wireless) © 2009 IEEE – Content is driving the Internet Customer Customer Customer Customer Customer Customer

105 106