CS162 Operating Systems and Systems Programming Lecture 21. Networking. April 8, 2010 Ion Stoica

Similar documents
Page 1. CS162 Operating Systems and Systems Programming Lecture 22. Networking II. Multiple Access Algorithm

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

CS162 Operating Systems and Systems Programming Lecture 21. Networking

Page 1. CS162 Operating Systems and Systems Programming Lecture 20. Reliability and Access Control / Distributed Systems.

CS162 Operating Systems and Systems Programming Lecture 20. Distributed Systems, Networking. Page 1. Goals for Today

Goals of Today s Lecture. Adaptors Communicating

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

CS162 Operating Systems and Systems Programming Lecture 20. Reliability and Access Control / Distributed Systems

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

Lecture 19. Principles behind data link layer services Framing Multiple access protocols

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 19: Networks and Distributed Systems

CS162 Operating Systems and Systems Programming Lecture 20. Reliability and Access Control / Distributed Systems

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

CS162 Operating Systems and Systems Programming Lecture 21. Networking

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

CS3600 SYSTEMS AND NETWORKS

The Link Layer and LANs. Chapter 6: Link layer and LANs

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

ECE 4450:427/527 - Computer Networks Spring 2017

Lecture 9: Bridging. CSE 123: Computer Networks Alex C. Snoeren

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Data Link Layer: Multi Access Protocols

ECE 158A: Lecture 13. Fall 2015

EE 122: Ethernet and

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 20: Networks and Distributed Systems

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Chapter 5 Link Layer and LANs

CS 455/555 Intro to Networks and Communications. Link Layer

1-1. Switching Networks (Fall 2010) EE 586 Communication and. November 8, Lecture 30

CSC 4900 Computer Networks: The Link Layer

CS 3640: Introduction to Networks and Their Applications

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Page 1. CS194-3/CS16x Introduction to Systems. Lecture 20. Networking I. Goals for Today. Distributed Systems Networking

Links. CS125 - mylinks 1 1/22/14

Link Layer and LANs 안상현서울시립대학교컴퓨터 통계학과.

Chapter 5: Link layer

Link Layer and Ethernet

Module 10 Data Link Layer CS655! 10-1!

Outline. Introduction to Networked Embedded Systems - Embedded systems Networked embedded systems Embedded Internet - Network properties

CS4700/CS5700 Fundaments of Computer Networks

Link Layer: Retransmissions

Networks and Distributed Systems. Sarah Diesburg Operating Systems CS 3430

Link Layer and Ethernet

Data Link Layer: Overview, operations

Outline: Connecting Many Computers

Your Future?! Links and LANs! Regrading of Homework! Other Announcements! Goals of Todayʼs Lecture! Link-Layer Services!

Link Layer. (continued)

Chapter 5 Link Layer and LANs

CC451 Computer Networks

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 16

CS 268: Internet Architecture & E2E Arguments. Today s Agenda. Scott Shenker and Ion Stoica (Fall, 2010) Design goals.

Introduction to Information Science and Technology 2017 Networking I. Sören Schwertfeger 师泽仁

Medium Access Control

Lecture 5 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Master Course Computer Networks IN2097

Page 1. Goals for Today" What Is A Protocol?" CS162 Operating Systems and Systems Programming Lecture 10. Protocols, Layering and e2e Argument"

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

Chapter 6 The Link Layer and LANs

Physical Layer. Medium Access Links and Protocols. Point-to-Point protocols. Modems: Signaling. Modems Signaling. Srinidhi Varadarajan

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Page 1. Review: The Problem" Software System Modularity" Solution: Intermediate Layers"

Redes de Computadores. Medium Access Control

Medium Access Protocols

CS 3516: Computer Networks

Links. Error Detection. Link Layer. Multiple access protocols. Nodes Links Frame. Shared channel Problem: collisions How nodes share a channel

MULTIPLE ACCESS PROTOCOLS 2. 1

CCM 4300 Lecture 5 Computer Networks, Wireless and Mobile Communications. Dr Shahedur Rahman. Room: T115

CSE 461: Multiple Access Networks. This Lecture

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

Lecture 8 Link Layer: functionality, error detection, media access algorithm

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

CHAPTER 7 MAC LAYER PROTOCOLS. Dr. Bhargavi Goswami Associate Professor & Head Department of Computer Science Garden City College

Multiple Access and Spanning Tree

Link layer, LANs: outline. Chapter 5-1 Link Layer. Link layer: introduction. Link layer services

CSCD 330 Network Programming

Data Link Layer -2- Network Access

Operating Systems. 16. Networking. Paul Krzyzanowski. Rutgers University. Spring /6/ Paul Krzyzanowski

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

COMP/ELEC 429/556 Introduction to Computer Networks

CS162 Operating Systems and Systems Programming Lecture 21. Networking. Page 1

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

Networking Technologies and Applications

Medium Access Control

CS162 Operating Systems and Systems Programming Lecture 21. Networking

CS 162 Operating Systems and Systems Programming Professor: Anthony D. Joseph Spring Lecture 18: Naming, Directories, and File Caching

Module 4 Data Link Layer CS655! 4-1!

Broadcast Links, Addressing and Media Access Control. Link Layer B. Link and Physical Layers. MAC Addresses

Raj Jain. The Ohio State University Columbus, OH

Data Link Layer -2- Network Access

Link Layer and LANs. CMPS 4750/6750: Computer Networks

Summary of MAC protocols

Random Access. 1. Aloha. 2. Slotted Aloha 3. CSMA 4. CSMA/CD

Chapter V: Link Layer

Principles behind data link layer services

CSC 401 Data and Computer Communications Networks

Direct Link Networks (II)

19: Networking. Networking Hardware. Mark Handley

Module 16: Distributed System Structures

Transcription:

CS162 Operating Systems and Systems Programming Lecture 21 Networking April 8, 2010 Ion Stoica http://inst.eecs.berkeley.edu/~cs162

Distributed file systems Authorization Networking Broadcast Goals for Today Point-to-Point Networking Routing Internet Protocol (IP) Note: Some slides and/or pictures in the following are adapted from slides 2005 Silberschatz, Galvin, and Gagne. Many slides generated from lecture notes by Kubiatowicz. Lec 21.2

Remote File Systems: Virtual File System (VFS) VFS: Virtual abstraction similar to local file system Instead of inodes has vnodes Compatible with a variety of local and remote file systems» provides object-oriented way of implementing file systems VFS allows the same system call interface (the API) to be used for different types of file systems The API is to the VFS interface, rather than any specific type of file system Lec 21.3

Network File System (NFS) Three Layers for NFS system UNIX file-system interface: open, read, write, close calls + file descriptors VFS layer: distinguishes local from remote files» Calls the NFS protocol procedures for remote requests NFS service layer: bottom layer of the architecture» Implements the NFS protocol NFS Protocol: remote procedure calls (RPC) for file operations on server Reading/searching a directory manipulating links and directories accessing file attributes/reading and writing files NFS servers are stateless; each request provides all arguments require for execution Modified data must be committed to the server s disk before results are returned to the client lose some of the advantages of caching Can lead to weird results: write file on one client, read on other, get old data Lec 21.4

Schematic View of NFS Architecture Lec 21.5

Authorization: Who Can Do What? How do we decide who is authorized to do actions in the system? Access Control Matrix: contains all permissions in the system Resources across top» Files, Devices, etc Domains in columns» A domain might be a user or a group of users» E.g. above: User D3 can read F2 or execute F3 In practice, table would be huge and sparse! Lec 21.6

Authorization: Two Implementation Choices Access Control Lists: store permissions with object Still might be lots of users! UNIX limits each file to: r,w,x for owner, group, world More recent systems allow definition of groups of users and permissions for each group ACLs allow easy changing of an object s permissions» Example: add Users C, D, and F with rw permissions Capability List: each process tracks which objects has permission to touch Popular in the past, idea out of favor today Consider page table: Each process has list of pages it has access to, not each page has list of processes Capability lists allow easy changing of a domain s permissions» Example: you are promoted to system administrator and should be given access to all system files Lec 21.7

Authorization: Combination Approach Users have capabilities, called groups or roles Everyone with particular group access is equivalent when accessing group resource Like passport (which gives access to country of origin) Objects have ACLs ACLs can refer to users or groups Change object permissions object by modifying ACL Change broad user permissions via changes in group membership Possessors of proper credentials get access Lec 21.8

Authorization: How to Revoke? How does one revoke someone s access rights to a particular object? Easy with ACLs: just remove entry from the list Takes effect immediately since the ACL is checked on each object access Harder to do with capabilities since they aren t stored with the object being controlled: Not so bad in a single machine: could keep all capability lists in a well-known place (e.g., the OS capability table). Very hard in distributed system, where remote hosts may have crashed or may not cooperate (more in a future lecture) Lec 21.9

Revoking Capabilities Various approaches to revoking capabilities: Put expiration dates on capabilities and force reacquisition Put epoch numbers on capabilities and revoke all capabilities by bumping the epoch number (which gets checked on each access attempt) Maintain back pointers to all capabilities that have been handed out (Tough if capabilities can be copied) Maintain a revocation list that gets checked on every access attempt Lec 21.10

Centralized vs Distributed Systems Server Client/Server Model Peer-to-Peer Model Centralized System: System in which major functions are performed by a single physical computer Originally, everything on single computer Later: client/server model Distributed System: physically separate computers working together on some task Early model: multiple servers working together» Probably in the same room or building» Often called a cluster Later models: peer-to-peer/wide-spread collaboration Lec 21.11

Distributed Systems: Motivation/Issues Why do we want distributed systems? Cheaper and easier to build lots of simple computers Easier to add power incrementally Users can have complete control over some components Collaboration: Much easier for users to collaborate through network resources (such as network file systems) The promise of distributed systems: Higher availability: one machine goes down, use another Better durability: store data in multiple locations More security: each piece easier to make secure Reality has been disappointing Worse availability: depend on every machine being up» Lamport: a distributed system is one where I can t do work because some machine I ve never heard of isn t working! Worse reliability: can lose data if any machine crashes Worse security: anyone in world can break into system Coordination is more difficult Must coordinate multiple copies of shared state information (using only a network) What would be easy in a centralized system becomes a lot more difficult Lec 21.12

Distributed Systems: Goals/Requirements Transparency: the ability of the system to mask its complexity behind a simple interface Possible transparencies: Location: Can t tell where resources are located Migration: Resources may move without the user knowing Replication: Can t tell how many copies of resource exist Concurrency: Can t tell how many users there are Parallelism: System may speed up large jobs by spliting them into smaller pieces Fault Tolerance: System may hide varoius things that go wrong in the system Transparency and collaboration require some way for different processors to communicate with one another Lec 21.13

Administrivia 3 rd project due Monday, April 12 I ll be away next Wednesday-Friday (Eurosys) Lecture will be taught by Ben Hindman No office hour on Thursday, April 15 Matei and Andy will be away as well next week Ben will teach the discussion sections of both Matei and Andy No office hours for Andy and Matei next week Project 4 Initial design, Wednesday (4/21), will give you two discussion sections before deadline Code deadline, Wednesday (5/5), two weeks later Lec 21.14

Networking Definitions Network: physical connection and set of protocols that allows two computers to communicate Packet (frame): unit of transfer, sequence of bits carried over the network Network carries packets from one CPU to another Destination gets interrupt when packet arrives Protocol: agreement between two parties as to how information is to be transmitted Layering: architecture for networking functionality Lec 21.15

Why Layering? The Problem Application Telnet FTP NFS HTTP Transmission Media Coaxial cable Fiber optic Packet radio Re-implement every application for every technology? No! But how does the Internet architecture avoid this? Lec 21.16

Network Layering: Solution Introduce an intermediate layer that provides a single abstraction for various network technologies New application just need to be written for intermediate layer New transmission media just need to provide abstraction of intermediate layer Application SMTP SSH NFS HTTP Intermediate layer Transmission Media Coaxial cable Fiber optic Packet radio Lec 21.17

Layering Layering is a particular form of modularization System is broken into a vertical hierarchy of logically distinct entities (layers) Service provided by one layer is based solely on the service provided by layer below Rigid structure: easy reuse, performance suffers Lec 21.18

Layering: Internet Universal Internet layer: Internet has only Internet Protocol (IP) at the Internet layer Many options for modules above IP Many options for modules below IP Application Telnet FTP DNS Transport Internet TCP IP UDP Link Layer/ Physical Layer LAN Packet radio Lec 21.19

Hourglass 20 Lec 21.20

Implications of Hourglass Single Internet layer module: Allows networks to interoperate Any network technology that supports IP can exchange packets Allows applications to function on all networks Applications that can run on IP can use any network Simultaneous developments above and below IP Lec 21.21

Link Layer Shared broadcast network: a packet reaches everyone in same network Frames: units of data exchanged at the link layer Main Functions Create frames, adding header, trailer Error correction Send data between peers Arbitrate access to physical media (Multiple Access) Lec 21.22

Broadcast Networks Broadcast Network: Shared Communication Medium Processor I/O Device I/O Device I/O Device Memory Shared Medium can be a set of wires» Inside a computer, this is called a bus» All devices simultaneously connected to devices Internet Originally, Ethernet was a broadcast network» All computers on local subnet connected to one another More examples (wireless: medium is air): cellular phones, GSM GPRS, EDGE, CDMA 1xRTT, and 1EvDO Lec 21.23

ID:3 (sender) Broadcast Networks Details Body (Data) Message Header (Dest:2) ID:1 (ignore) ID:4 (ignore) Delivery: When you broadcast a packet farme, how does a receiver know who it is for? (frame goes to everyone!) Put header on front of frame: [ Destination Packet ] Everyone gets frame, discards if not the target In Ethernet, this check is done in hardware» No OS interrupt if not for particular destination This is layering: we re going to build complex network protocols by layering on top of the packet ID:2 (receive) Lec 21.24

Multiple Access Algorithm Single shared broadcast channel Avoid having multiple nodes speaking at once Otherwise, collisions lead to garbled data Multiple access mechanism Distributed algorithm for sharing the channel Algorithm determines which node can transmit Classes of techniques Channel partitioning: divide channel into pieces Taking turns: scheme for trading off who gets to transmit Random access: allow collisions, and then recover» Optimizes for the common case of only one sender Lec 21.25

Channel Partitioning: TDMA TDMA: Time Division Multiple Access Access to channel in "rounds" Each station gets fixed length slot in each round Time-slot length is packet transmission time Unused slots go idle Example: 6-station LAN with slots 0, 3, and 4 Rounds Slots = 0 1 2 3 4 5 0 1 2 3 4 5 Lec 21.26

Channel Partitioning: FDMA FDMA: Frequency Division Multiple Access Channel spectrum divided into frequency bands Each station assigned fixed frequency band Unused transmission time in frequency bands go idle Example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle time FDM cable frequency bands Lec 21.27

data Taking Turns MAC protocols Polling Token passing Master node Control token passed from one invites slave node to next sequentially nodes to transmit in Node must have token to send turn data poll master Concerns: Token overhead Latency Single point of failure (token) slaves Concerns: Polling overhead Latency Single point of failure (master) Lec 21.28

Random Access Protocol: AlohaNet Norm Abramson left Stanford in search of surfing Set up first radio-based data communication system connecting the Hawaiian islands Hub at Alohanet HQ (Univ. Hawaii, Oahu) Other sites spread among the islands Had two radio channels: Random access: sites sent data on this channel Broadcast: only used by hub to rebroadcast incoming data Lec 21.29

Aloha Transmission Strategy When new data arrived at site, send to hub for transmission Site listened to broadcast channel If it heard data repeated, knew transmission was rec d If it didn t hear data correctly, it assumed a collision If collision, site waited random delay before retransmitting Problem: Stability: what if load increases? More collisions less gets through more resent more load More collisions Unfortunately: some sender may have started in clear, get scrambled without finishing Lec 21.30

Ethernet Bob Metcalfe, Xerox PARC, visits Hawaii and gets an idea! Shared medium (coax cable) Can sense carrier to see if other nodes are broadcasting at the same time Sensing is subject to timelag Only detect those sending a short while before Monitor channel to detect collisions Once sending, can tell if anyone else is sending too Lec 21.31

Ethernet s CSMA/CD CSMA: Carrier Sense Multiple Access CD: Collision detection Sense channel, if idle If detect another transmission» Abort, send jam signal» Delay, and try again Else» Send frame Receiver accepts: Frames addressed to its own address Frames addressed to the broadcast address (broadcast) Frames addressed to a multicast address, if it was instructed to listen to that address All frames (promiscuous mode) Lec 21.32

Ethernet s CSMA/CD (more) Exponential back-off Goal: adapt retransmission attempts to estimated current load Heavy load: random wait will be longer First collision: choose K from {0,1}; delay is K x 512 bit transmission times After second collision: choose K from {0,1,2,3} After ten or more collisions, choose K from {0,1,2,3,4,,1023} Minimum packet size Give a host enough time to detect collisions In Ethernet, minimum packet size = 64 bytes What is the relationship between minimum packet size and the length of the LAN? Lec 21.33

Minimum Packet Size (more) a) Time = t; Host 1 starts to send frame Host 1 Host 2 propagation delay (d) b) Time = t + d; Host 2 starts to send a frame, just before it hears from host 1 s frame c) Time = t + 2*d; Host 1 hears Host 2 s frame detects collision Host 1 Host 2 propagation delay (d) Host 1 Host 2 propagation delay (d) d = LAN_length/ligh_speed = min_frame_size/(2*bandwidth) LAN_length = (min_frame_size)*(light_speed)/(2*bandwidth) = = (8*64b)*(2.5*10 8 mps)/(2*10 7 bps) = 6400m approx What about 100 mbps? 1 gbps? 10 gbps? Lec 21.34

Conclusion Authorization Controlling access to resources using» Access Control Lists» Capabilities Network: physical connection that allows two computers to communicate Packet: unit of transfer, sequence of bits carried over the network Broadcast Network: Shared Communication Medium Transmitted packets sent to all receivers Arbitration: act of negotiating use of shared medium» Ethernet: Carrier Sense, Multiple Access, Collision Detect Protocol: Agreement between two parties as to how information is to be transmitted Lec 21.35