06/04/17

Welcome! Operang Systems and Networks • Brief introducon of lecturer and TAs – Adrian Perrig, Professor in Department of Computer Science, Director of Network Security Group – Teaching assistants: Tae-Ho Lee, Chris Pappas, Laurent Chuat Networks Part 1: Introducon – Network security group research area: design and implementaon of secure future architecture (SCION project hp://www.scion- architecture.net) Adrian Perrig Network Security Group ETH Zürich

2

Course Structure Lecture Style

• Lectures • Student interacon is encouraged! • Homework – Please ask quesons if something is unclear • Exercise sessions – Please point out any errors that you spot – • Quizzes Please focus on lecture instead of Facebook, Twier, etc. • Please turn off your phone and other devices during class

3 4

Minds open…

… Laptops closed and cell phones / ipads off

6

1 06/04/17

Textbook and Slide Credit Problems with Being Online During Class • Textbook: TANENBAUM, ANDREW S.; WETHERALL, DAVID J., COMPUTER NETWORKS, 5th Edion, 2011. • It takes the mind a few minutes to reach a state of deep • Slides adapted from slide deck by David Wetherall concentraon • Lecture video at: hp://media.pearsoncmg.com/ph/streaming/esm/ – Reaching deep concentraon needs to be trained, many people tanenbaum5e_videonotes/tanenbaum_videoNotes.html have lost this ability due to constant / frequent interrupons • Knowing that one cannot be interrupted increases concentraon. Said another way: Expectaon of interrupon prevents deep concentraon – Try to be off-line when studying networking! • Open laptop / iPad / cell phone used for surfing can also disrupt / interrupt people sing 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 Edion Volume 1: The Protocols” • 2nd Edion, 2011

9

Also recommended Study Recommendaons Computer Networking: A Top-Down Approach: Kurose and Ross • Make list of acronyms, concepts 5th Edion • Read corresponding secons in text book – Available in INFK library • Parcipate in exercise sessions, solve homework, Srinivasan Keshav: and DO THE PROJECTS! An Engineering Approach to Computer

11 Networking 12

2 06/04/17

Quizzes Final Grade • Extra credit!!! • 5 Quizzes in total • Exercises are oponal – during lecture (at the beginning or end) – but highly recommended to do them – 10 minutes max. – not announced at the previous lecture • Quizzes do not harm your grade – about the previously taught set of lecture slides – highly recommended to aend class • Each quiz 1 point: • Networking grade = exam grade + quiz grade – 0.2 points for parcipaon • Final grade = average( Networking grade, OS grade ) – 4 quesons x 0.2 points

13 14

Focus of the course Focus of the course (2) • Three “networking” topics:

Distributed systems ??? Networking Communicaons

• We mainly study the Networking aspects

15 16

The Main Point Why learn about the Internet?

1. To learn how the Internet works 1. Curiosity – What really happens when you “browse the web”? – What are TCP/IP, DNS, HTTP, NAT, VPNs, 802.11 etc. 2. Understand how the system works we’re spending anyway? most of our me with – Interesng stasc: we’re spending more me online 2. To learn the fundamentals of computer networks than sleeping! 3. Impact on our world 4. Job prospects!

17 18

3 06/04/17

From this experimental network … To this! ARPANET ~1970 Internet ~2005 • An everyday instuon used at work, home, and on-the-go • Visualizaon contains (a) Dec. 1969. (b) July 1970. (c) March 1971. millions of links

Aribuon: By The Opte Project [CC-BY-2.5], via Wikimedia Commons

19 20

Internet – Societal Impact Internet – Economic impact

• An enabler of societal change • An engine of economic growth – Easy access to knowledge – Adversing-sponsored search – Electronic commerce – Online stores – Personal relaonships – Online marketplaces – Discussion without censorship – Crowdsourcing

21 22

The Main Point (2) Why learn the Fundamentals? 1. To learn how the Internet works 1. Apply to all computer networks 2. To learn the fundamentals of computer 2. Intellectual interest networks

– What hard problems must they solve? 3. Change / reinvenon – What design strategies have proven valuable? 4. Pass this course :-)

23 24

4 06/04/17

Fundamentals – Intellectual Interest Fundamentals – Intellectual Interest (2) • Example key problem: Reliability! Key problem Example soluons – Any part of the Internet might fail Reliability despite Codes for error detecon/correcon (§3.2, 3.3) – Messages might be corrupted failures Roung around failures (§5.2) – How to create a reliable network out of unreliable Network growth Addressing (§5.6) and naming (§7.1) components? and evoluon Protocol layering (§1.3) Allocaon of resources Mulple access (§4.2) • Reliability soluons like bandwidth Congeson control (§5.3, 6.3) – Codes to detect/correct errors Security against Confidenality of messages (§8.2, 8.6) – Roung around failures ... various threats Authencaon of communicang pares (§8.7)

25 26

Fundamentals – Reinvenon Fundamentals – Reinvenon (2) • The Internet is constantly being re-invented! • Currently around – Growth over me and technology trends drive 1.1 billion upheavals in Internet design and usage Internet hosts … • Today’s Internet is different from yesterday’s – And tomorrow’s will be different again – But the fundamentals remain the same

27 28

Fundamentals – Reinvenon (3) Not a Course Goal • Examples of upheavals in the past 1-2 decades • To learn IT job skills Growth / Tech Driver Upheaval – Emergence of the web Content Distribuon Networks How to configure equipment Digital songs/videos Peer-to-peer file sharing • E.g., Cisco cerficaons Falling cost/bit Voice-over-IP calling – But course material is relevant, and we use hands-on Many Internet hosts IPv6 tools Wireless advances Mobile devices

29 30

5 06/04/17

Example Uses of Networks Example Uses of Networks • Work: • Work: – Email, file sharing, prinng, … – Email, file sharing, prinng, … • Home: • Home: – Movies / songs, news, calls / video / messaging, e- – Movies / songs, news, calls / video / messaging, e- commerce, … commerce, … What do these uses tell us about • Mobile: • Mobile: why we build networks? – Calls / texts, games, videos, maps, informaon access … – Calls / texts, games, videos, maps, informaon access …

31 32

For User Communicaon 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 effecve than dedicated resources per user – Instant messaging – – Social networking Even network links are shared via stascal mulplexing →Enables remote communicaon – Need low latency for interacvity

33 34

Stascal Mulplexing Stascal Mulplexing (2)

• Sharing of network bandwidth between users according • Example: Users in an ISP network 5 to the stascs of their demand . . . – Network has 100 Mbps (units of bandwidth) 100 ISP – (Mulplexing just means sharing) – Each user subscribes to 5 Mbps, for videos 5 – – Useful because users are mostly idle and their traffic is bursty But a user is acve only 50% of the me … 5

• How many users can the ISP support? • Key queson: – With dedicated bandwidth for each user: – How much does it help? – Probability all bandwidth is used: (assuming independent users)

35 36

6 06/04/17

Stascal Mulplexing (3) For Content Delivery • With 30 independent users, sll unlikely (2% chance) to • Same content is delivered to many users need more than 100 Mbps! – Binomial probabilies – Videos (large), songs, apps and upgrades, web pages, … → Can serve more users with the same size network – Stascal mulplexing 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 Communicaon To Connect Computers to the Physical World

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

41 42

7 06/04/17

The Value of Connecvity The Value of Connecvity (2) • “Metcalfe’s Law” ~1980: Bob Metcalfe • Example: both sides have 12 nodes, but the le network – The value of a network of N nodes is has more connecvity proporonal to N2 – Large networks are relavely more valuable than small ones vs +

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

Parts of a Network Component Names

Component Funcon Example applicaon Applicaon, 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 switch, node, Relays messages Access point, cable/DSL router hub, intermediate system between links modem host link Link, or channel Connects nodes Wires, wireless

45 46

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

• Simplex – unidireconal

47 48

8 06/04/17

Wireless Links (2) A Small Network

• Oen show logical links • Connect a couple of computers – Not all possible connecvity

• 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) Scale Type Example • Enterprise / Ethernet • 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 • Telephone Planet The Internet (network of all networks) The Internet! • VANET • Satellite ...

53 54

9 06/04/17

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-applicaon interfaces define how apps use 2. Network-network interfaces define how nodes work the network together – Sockets are widely used in pracce – Traceroute can peek inside the network

app app

host host

59 60

10 06/04/17

Network Service API Hides Details Traceroute • 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 (tracert on 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 Telefonica 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 Seale www.uw.edu (www1.cac.washington.edu)

65 66

11 06/04/17

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

• hp://research.dyn.com/2013/11/mitm-internet-hijacking/ • The network does much for apps: – Make and break connecons – Find a path through the network We need a form of – Transfers informaon reliably – Transfers arbitrary length informaon modularity, to help – Send as fast as the network allows manage complexity – Shares bandwidth among users – Secures informaon 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 vercal

used to divide up network funconality Instance of Peer Protocol X – Each instance of a protocol talks virtually to its peer using the protocol X X X instance protocol Service provided – Each instance of a protocol uses only the services of the lower Lower layer by Protocol Y instance (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

12 06/04/17

Protocols and Layers (5) Encapsulaon

• Protocols you’ve probably heard of: Browser • Encapsulaon 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 informaon to make a new message for delivery – Like sending a leer 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

Encapsulaon (2) Encapsulaon (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

Encapsulaon (4) Demulplexing • 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 pracce IP ARP – Trailers as well as headers, encrypt/compress contents – Segmentaon (divide long message) and reassembly Ethernet ??

77 78

13 06/04/17

Demulplexing (2) Advantage of Layering • Done with demulplexing keys in the headers • Informaon 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 informaon hiding to connect different systems • Using informaon 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 Lile Guidance Please … (§1.4, §1.6)

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

83 84

14 06/04/17

OSI “7 layer” Reference Model Internet Reference Model • A principled, internaonal standard, to connect systems • A four layer model based on experience; omits some – Influenal, but not used in pracce. (Woops) OSI layers and uses IP as the network layer. – Provides funcons needed by users – Converts different data representaons Applicaon – Programs that use network service

– Manages task dialogs Transport – Provides end-to-end data delivery – Provides end-to-end delivery Internet – Send packets over mulple networks – Sends packets over mulple links – Sends frames of informaon 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 Applicaon 7 Applicaon 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: Layer Unit of Data Body Area Examples ITU Telecom G.992, ADSL, H.264, MPEG4 Applicaon Message IEEE Communicaons 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 Physical Bit CSS standard

89 90

15 06/04/17

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

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

Network Network Router 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 lile more about the Physical layer, and alternaves – May have mulple protocols working together in one layer – May be difficult to assign a specific protocol to a layer 7 Applicaon – Programs that use network service • Some layer violaons 4 Transport – Provides end-to-end data delivery – Applicaon behaves differently depending on network loss 3 Network – Send packets over mulple 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 • Boom-up through the layers: • Important concepts in this lecture – Stascal mulplexing, stascal mulplexing gain Applicaon - HTTP, DNS, CDNs Transport - TCP, UDP – OSI 7 layer model, interfaces, protocols Network - IP, NAT, BGP – Encapsulaon, demulplexing Link - Ethernet, 802.11 Physical - wires, fiber, wireless

95 96

16 06/04/17

Bonus Material: Rough Internet Timeline History of the Internet (§1.5.1) Esmated 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) – Movated for resource sharing Len Kleinrock – Launched with 4 nodes in 1969, grew to hundreds of hosts – First “killer app” was email

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

99 100

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

Vint Cerf • 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 Informaon Brochure, DCA 1979 101 102

17 06/04/17

Growing Up – NSFNET Early Internet Architecture • NSFNET ’85 supports educaonal networks • Hierarchical, with NSFNET as the backbone – Inially 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 (roung) in ’93 Regional Regional Regional Network Network • Much growth from PCs and Ethernet LANs Network – Campuses, businesses, then homes Customer Customer – 1 million hosts by 1993 … Customer Customer Customer Customer

103 104

Modern Internet – Birth of the Web Modern Internet Architecture • Complex business arrangements affect connecvity • Aer ’95, connecvity is provided by Tim Berners-Lee – large ISPs who are competors Sll decentralized, other than registering idenfiers Content Provider – They connect at Internet eXchange IXP Point (IXP) facilies Transit ISP 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

18