SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Operating Systems
         CMPSCI 377
           Networks
            Emery Berger
University of Massachusetts Amherst




  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
Networks
    Goal: Efficient, correct, robust message passing

    between two separate nodes

    Local area network (LAN) – nodes in single

    building, fast & reliable (Ethernet)
        Media: twisted-pair, coax, fiber
    

        Bandwidth: 10-1,000MB/s
    



    Wide area network (WAN) – nodes across large

    geographic area (Internet)
        Media: fiber, microwave links, satellite channels
    

        Bandwidth: 1.544MB/s (T1), 45 MB/s (T3)
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   2
Principles of Net Communication

    Data broken into packets (~ 1Kb)

        Basic unit of transfer
    

    Computers & routers control packet flow




    Road analogy:

        Packets = cars
    

        Network = roads
    

        Computer = traffic lights (intersection)
    

        Too many packets on shared link/node =
    
        traffic jam


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   3
Communication Protocols
    Protocol: agreed-upon rules for


    communication
    Protocol stack: layers that comprise


    networking software
        Each layer N provides service to layer N+1
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   4
Traditional Layers
    Application layer – applications that use the net


    Presentation layer – data format conversion

    (big/little endian)
    Session layer – implements communication strategy

    (e.g., RPC)
    Transport layer – reliable end-to-end communication


    Network layer – routing & congestion control


    Data link control layer – reliable point-to-point

    communication over unreliable channel
    Physical layer – electrical/optical signaling across “wire”





      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   5
TCP/IP Protocol Stack




    Internet standard protocol stack

        TCP: reliable protocol – packets received in order
    

        UDP (user datagram protocol) – unreliable
    

          No guarantee of delivery


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   6
Packet Format

    All info needed to

    recreate original
    message
    Packets may arrive

    out of order
        need sequence
    
        number
    Data segment

    contains headers
    for higher protocol
    layers &
    application data

          UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   7
Sockets
    Standard API for network programming


        Duplex communication (2-way)
    

    Can configure sockets to use UDP or TCP


        UDP – best for lossy communication
    

              Pings, video, audio, other multimedia
          

              Sends datagrams (packets)
          


        TCP – most stuff
    

              Sends reliable stream of bytes
          




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   8
Socket communication
    Sockets (in TCP) send stream of bytes


        Multiple sends may be combined
    

        into one received message
    To send multiple application-level

    messages, must have application level
    protocol
        E.g., 4-bytes = message type, 4-bytes =
    

        message length, plus message



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   9
Client-side: using sockets
    Creates socket


        int fd = socket (AF_INET, SOCK_STREAM, 0)
    

    Converts hostname to IP address with


    getaddrinfo
        getaddrinfo (name, portStr, NULL, portNum)
    

    Connects to host


        connect (fd, addr, len); // from getaddrinfo
    

    Once connected, can send or recv


        send (fd, data, amount, 0);
    

        recv (fd, buf, len, 0);
    


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   10
Server-side: using sockets
    As before:


        Create socket as before
    

        Convert hostname to IP address with getaddrinfo
    

        but in passive mode
              hint.ai_flags = AI_PASSIVE
          

              getaddrinfo (name, portStr, &hint, &addrinfo)
          



    Binds socket to address:


        bind (fd, addr, len); // from getaddrinfo
    


    Listens for connection:


        listen (fd, 1); // number of waiting msgs
    

    Accepts connection ) new socket


        int newfd = accept (fd, addr, len);
    



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   11
Exercise
    Lamest web server ever


        Wait for connections on localhost port 80
    

        Read message until first newline (‘n’)
    

        Send <html><body>Hello
    

        world</body></html>
        Use:
    

              int fd = socket (AF_INET, SOCK_STREAM, 0)
          

              getaddrinfo (name, portStr, &hint, &addrinfo)
          

              bind (fd, addr, addrlen)
          

              int v = listen (fd, 1)
          

              int newfd = accept (fd, addr, len)
          

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   12
Network Topologies

    Connection of nodes impacts:


        Maximum & average communication time
    

        Fault tolerance
    

        Expense
    




    Two basic topologies:


        Bus (for LANs)
    

        Point-to-point
    




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   13
Bus Network Topologies


    Bus nodes connect to common network





    Linear bus – single shared link


        Nodes connect directly to each other via bus
    

        Inexpensive (linear in # of nodes)
    

        Tolerant of node failures
    

        Ethernet LAN
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   14
Bus Network Topologies




    Ring bus – single shared circular link


        Same technology & tradeoffs as linear bus
    



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   15
Point-to-Point Network Topologies




    Fully-connected


        Each message takes one “hop”
    

        Node failure – no effect on communication with
    

        others
        Expensive – impractical for WANs
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   16
Point-to-Point Network Topologies




    Fully-connected


        Each message takes one “hop”
    

        Node failure – no effect on communication with
    

        others
        Expensive – impractical for WANs
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   17
Point-to-Point Network Topologies




    Fully-connected


        Each message takes one “hop”
    

        Node failure – no effect on communication with
    

        others
        Expensive – impractical for WANs
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   18
Point-to-Point Network Topologies




    Fully-connected


        Each message takes one “hop”
    

        Node failure – no effect on communication with
    

        others
        Expensive – impractical for WANs
    

        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   19
Point-to-Point Network Topologies

                               2

                     1                     3


                                       4

    Partially connected

        Links between some, but not all nodes
    

        Less expensive, less tolerant to failures
    

              Single node failure can partition network
          

        Several hops – requires routing
    



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   20
Point-to-Point Network Topologies

    I want to go
                                 2
    to Node 4!

                       1                     3


                                         4

     Partially connected

          Links between some, but not all nodes
      

          Less expensive, less tolerant to failures
      

                Single node failure can partition network
            

          Several hops – requires routing
      



          UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   21
Point-to-Point Network Topologies

    I want to go
                                 2
    to Node 4!

                       1                     3


                                         4

     Partially connected

          Links between some, but not all nodes
      

          Less expensive, less tolerant to failures
      

                Single node failure can partition network
            

          Several hops – requires routing
      



          UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   22
Point-to-Point Network Topologies




    Tree structure: network hierarchy

        Messages fast between direct descendants
    

              Max message cost?
          

        Not failure tolerant
    

              Any interior node fails – network partitioned
          


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   23
Point-to-Point Network Topologies




    Star network: all nodes connect to central node


        Each message takes how many hops?
    

        Not failure tolerant
    

        Inexpensive – sometimes used for LANs
    



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   24
Point-to-Point Network Topologies




    One-directional ring


        Given n nodes, max hops?
    

        Inexpensive
    

        Fault-tolerant?
    


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   25
Point-to-Point Network Topologies




    Bi-directional ring


        Given n nodes, max hops?
    

        Inexpensive
    

        Fault-tolerant? One node? Two?
    


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   26
Point-to-Point Network Topologies




    Doubly-connected ring: nodes connected to

    neighbors & one more distant
        Given n nodes, max hops?
    

        Fault-tolerant?
    

        More expensive
    


        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   27
The End




  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   28
Distributed Systems
    Distributed system: physically separate processors

    connected by one or more communication links
      no shared clock or memory


                                                     P2
           P1



                    P4                              P3


    Most systems today distributed in some way


     e-mail, file servers, network printers, remote
      backup, web...
      UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   29
Parallel vs. Distributed Systems
    Tightly coupled systems: “parallel


    processing”
        Processors share clock, memory, run one OS
    

        Frequent communication
    




    Loosely coupled systems: “distributed


    computing”
        Each processor has own memory, runs
    

        independent OS
        Infrequent communication
    



        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   30
Advantages of Distributed Systems
    Resource sharing


    Computational speedup


    Reliability


    Communication





     UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   31
Advantages of Distributed Systems
    Resource sharing


        Resources need not be replicated
    

              Shared files
          


        Expensive (scarce) resources can be shared
    

              Poster-size color laser printers
          


        Processors present same environment to
    

        user
              Keeping files on file server
          




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   32
Advantages, continued
    Computational speedup


        n processors = n times computational power
    

              SETI@home
          


        Problems must be decomposable into
    
        subproblems
              Trivial = embarrassingly parallel
          


        Coordination & communication required
    
        between cooperating processes
              Synchronization
          

              Exchange of results
          




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   33
Advantages, continued
    Reliability


        Replication of resources provides fault
    

        tolerance
              One node crashes, user works on another one
          

              Performance degradation but system available
          


        Must avoid single point of failure
    

              Single, centralized component of system
          

              Example: central file servers
          




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   34
Advantages, continued
    Communication


        Users/processes on different systems can
    

        communicate
        Mail, transaction processing systems like
    

        airlines & banks, www




        UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science   35

Contenu connexe

En vedette

Processor allocation in Distributed Systems
Processor allocation in Distributed SystemsProcessor allocation in Distributed Systems
Processor allocation in Distributed SystemsRitu Ranjan Shrivastwa
 
Parallel computing
Parallel computingParallel computing
Parallel computingvirend111
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed SystemsDr Sandeep Kumar Poonia
 
Applications of paralleL processing
Applications of paralleL processingApplications of paralleL processing
Applications of paralleL processingPage Maker
 
Parallel computing
Parallel computingParallel computing
Parallel computingVinay Gupta
 

En vedette (6)

Processor allocation in Distributed Systems
Processor allocation in Distributed SystemsProcessor allocation in Distributed Systems
Processor allocation in Distributed Systems
 
Parallel Computing
Parallel Computing Parallel Computing
Parallel Computing
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 
Processes and Processors in Distributed Systems
Processes and Processors in Distributed SystemsProcesses and Processors in Distributed Systems
Processes and Processors in Distributed Systems
 
Applications of paralleL processing
Applications of paralleL processingApplications of paralleL processing
Applications of paralleL processing
 
Parallel computing
Parallel computingParallel computing
Parallel computing
 

Similaire à Operating Systems - Networks

The Evolving Internet Fndtn
The Evolving Internet FndtnThe Evolving Internet Fndtn
The Evolving Internet Fndtnguestbf78f8b
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and ThreadsEmery Berger
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksAtif Shahzad
 
network basics
network basicsnetwork basics
network basicsAvin Ash
 
LAN Demo
LAN DemoLAN Demo
LAN Demoalcsoft
 
PPT on computer networks and communication
PPT on computer networks and communicationPPT on computer networks and communication
PPT on computer networks and communicationMuhammadAhsanAnsari5
 
Westermo webinar: Learning the Basics of Ethernet Networking
Westermo webinar: Learning the Basics of Ethernet NetworkingWestermo webinar: Learning the Basics of Ethernet Networking
Westermo webinar: Learning the Basics of Ethernet NetworkingWestermo Network Technologies
 
Class Note
Class NoteClass Note
Class NoteAK IJ
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaProf. Dr. K. Adisesha
 
QsNetIII Adaptively Routed Network For HPC
QsNetIII Adaptively Routed Network For HPCQsNetIII Adaptively Routed Network For HPC
QsNetIII Adaptively Routed Network For HPCFederica Pisani
 
Software defined network
Software defined networkSoftware defined network
Software defined networkBogamoga1
 
Chapter 5 introduction to computer communication networks
Chapter 5   introduction to computer communication networksChapter 5   introduction to computer communication networks
Chapter 5 introduction to computer communication networksN. A. Sutisna
 
InfiniBand In-Network Computing Technology and Roadmap
InfiniBand In-Network Computing Technology and RoadmapInfiniBand In-Network Computing Technology and Roadmap
InfiniBand In-Network Computing Technology and Roadmapinside-BigData.com
 
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniDistributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniVMware Tanzu
 
Simplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 TeachersSimplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 Teacherswebhostingguy
 

Similaire à Operating Systems - Networks (20)

The Evolving Internet Fndtn
The Evolving Internet FndtnThe Evolving Internet Fndtn
The Evolving Internet Fndtn
 
01 intro
01 intro01 intro
01 intro
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networks
 
network basics
network basicsnetwork basics
network basics
 
LAN Demo
LAN DemoLAN Demo
LAN Demo
 
PPT on computer networks and communication
PPT on computer networks and communicationPPT on computer networks and communication
PPT on computer networks and communication
 
Westermo webinar: Learning the Basics of Ethernet Networking
Westermo webinar: Learning the Basics of Ethernet NetworkingWestermo webinar: Learning the Basics of Ethernet Networking
Westermo webinar: Learning the Basics of Ethernet Networking
 
Class Note
Class NoteClass Note
Class Note
 
Gaurab Ixp Tutorial
Gaurab Ixp TutorialGaurab Ixp Tutorial
Gaurab Ixp Tutorial
 
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. AdiseshaCCN Unit-3 Data Link Layer by Dr. K. Adisesha
CCN Unit-3 Data Link Layer by Dr. K. Adisesha
 
QsNetIII Adaptively Routed Network For HPC
QsNetIII Adaptively Routed Network For HPCQsNetIII Adaptively Routed Network For HPC
QsNetIII Adaptively Routed Network For HPC
 
Software defined network
Software defined networkSoftware defined network
Software defined network
 
Chapter 5 introduction to computer communication networks
Chapter 5   introduction to computer communication networksChapter 5   introduction to computer communication networks
Chapter 5 introduction to computer communication networks
 
Ccna day1
Ccna day1Ccna day1
Ccna day1
 
The Basics of Industrial Ethernet Communications
The Basics of Industrial Ethernet CommunicationsThe Basics of Industrial Ethernet Communications
The Basics of Industrial Ethernet Communications
 
Tata Chuna
Tata Chuna Tata Chuna
Tata Chuna
 
InfiniBand In-Network Computing Technology and Roadmap
InfiniBand In-Network Computing Technology and RoadmapInfiniBand In-Network Computing Technology and Roadmap
InfiniBand In-Network Computing Technology and Roadmap
 
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane MaldiniDistributed Reactive Services with Reactor & Spring - Stéphane Maldini
Distributed Reactive Services with Reactor & Spring - Stéphane Maldini
 
Simplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 TeachersSimplified Networking and Troubleshooting for K-12 Teachers
Simplified Networking and Troubleshooting for K-12 Teachers
 

Plus de Emery Berger

Doppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierDoppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierEmery Berger
 
Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingEmery Berger
 
Programming with People
Programming with PeopleProgramming with People
Programming with PeopleEmery Berger
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationEmery Berger
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)Emery Berger
 
Operating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsOperating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsEmery Berger
 
Operating Systems - File Systems
Operating Systems - File SystemsOperating Systems - File Systems
Operating Systems - File SystemsEmery Berger
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationEmery Berger
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - SynchronizationEmery Berger
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and PagingEmery Berger
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual MemoryEmery Berger
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsEmery Berger
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorEmery Berger
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementEmery Berger
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without PagingEmery Berger
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesEmery Berger
 
Exterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityExterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityEmery Berger
 
Operating Systems - Garbage Collection
Operating Systems - Garbage CollectionOperating Systems - Garbage Collection
Operating Systems - Garbage CollectionEmery Berger
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Emery Berger
 
Composing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap LayersComposing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap LayersEmery Berger
 

Plus de Emery Berger (20)

Doppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language BarrierDoppio: Breaking the Browser Language Barrier
Doppio: Breaking the Browser Language Barrier
 
Dthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic MultithreadingDthreads: Efficient Deterministic Multithreading
Dthreads: Efficient Deterministic Multithreading
 
Programming with People
Programming with PeopleProgramming with People
Programming with People
 
Stabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance EvaluationStabilizer: Statistically Sound Performance Evaluation
Stabilizer: Statistically Sound Performance Evaluation
 
DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)DieHarder (CCS 2010, WOOT 2011)
DieHarder (CCS 2010, WOOT 2011)
 
Operating Systems - Advanced File Systems
Operating Systems - Advanced File SystemsOperating Systems - Advanced File Systems
Operating Systems - Advanced File Systems
 
Operating Systems - File Systems
Operating Systems - File SystemsOperating Systems - File Systems
Operating Systems - File Systems
 
Operating Systems - Advanced Synchronization
Operating Systems - Advanced SynchronizationOperating Systems - Advanced Synchronization
Operating Systems - Advanced Synchronization
 
Operating Systems - Synchronization
Operating Systems - SynchronizationOperating Systems - Synchronization
Operating Systems - Synchronization
 
Virtual Memory and Paging
Virtual Memory and PagingVirtual Memory and Paging
Virtual Memory and Paging
 
Operating Systems - Virtual Memory
Operating Systems - Virtual MemoryOperating Systems - Virtual Memory
Operating Systems - Virtual Memory
 
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained EnvironmentsMC2: High-Performance Garbage Collection for Memory-Constrained Environments
MC2: High-Performance Garbage Collection for Memory-Constrained Environments
 
Vam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory AllocatorVam: A Locality-Improving Dynamic Memory Allocator
Vam: A Locality-Improving Dynamic Memory Allocator
 
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory ManagementQuantifying the Performance of Garbage Collection vs. Explicit Memory Management
Quantifying the Performance of Garbage Collection vs. Explicit Memory Management
 
Garbage Collection without Paging
Garbage Collection without PagingGarbage Collection without Paging
Garbage Collection without Paging
 
DieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe LanguagesDieHard: Probabilistic Memory Safety for Unsafe Languages
DieHard: Probabilistic Memory Safety for Unsafe Languages
 
Exterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High ProbabilityExterminator: Automatically Correcting Memory Errors with High Probability
Exterminator: Automatically Correcting Memory Errors with High Probability
 
Operating Systems - Garbage Collection
Operating Systems - Garbage CollectionOperating Systems - Garbage Collection
Operating Systems - Garbage Collection
 
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
Exploiting Multicore CPUs Now: Scalability and Reliability for Off-the-shelf ...
 
Composing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap LayersComposing High-Performance Memory Allocators with Heap Layers
Composing High-Performance Memory Allocators with Heap Layers
 

Dernier

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 

Dernier (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 

Operating Systems - Networks

  • 1. Operating Systems CMPSCI 377 Networks Emery Berger University of Massachusetts Amherst UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science
  • 2. Networks Goal: Efficient, correct, robust message passing  between two separate nodes Local area network (LAN) – nodes in single  building, fast & reliable (Ethernet) Media: twisted-pair, coax, fiber  Bandwidth: 10-1,000MB/s  Wide area network (WAN) – nodes across large  geographic area (Internet) Media: fiber, microwave links, satellite channels  Bandwidth: 1.544MB/s (T1), 45 MB/s (T3)  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 2
  • 3. Principles of Net Communication Data broken into packets (~ 1Kb)  Basic unit of transfer  Computers & routers control packet flow  Road analogy:  Packets = cars  Network = roads  Computer = traffic lights (intersection)  Too many packets on shared link/node =  traffic jam UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 3
  • 4. Communication Protocols Protocol: agreed-upon rules for  communication Protocol stack: layers that comprise  networking software Each layer N provides service to layer N+1  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 4
  • 5. Traditional Layers Application layer – applications that use the net  Presentation layer – data format conversion  (big/little endian) Session layer – implements communication strategy  (e.g., RPC) Transport layer – reliable end-to-end communication  Network layer – routing & congestion control  Data link control layer – reliable point-to-point  communication over unreliable channel Physical layer – electrical/optical signaling across “wire”  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 5
  • 6. TCP/IP Protocol Stack Internet standard protocol stack  TCP: reliable protocol – packets received in order  UDP (user datagram protocol) – unreliable   No guarantee of delivery UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 6
  • 7. Packet Format All info needed to  recreate original message Packets may arrive  out of order need sequence  number Data segment  contains headers for higher protocol layers & application data UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 7
  • 8. Sockets Standard API for network programming  Duplex communication (2-way)  Can configure sockets to use UDP or TCP  UDP – best for lossy communication  Pings, video, audio, other multimedia  Sends datagrams (packets)  TCP – most stuff  Sends reliable stream of bytes  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 8
  • 9. Socket communication Sockets (in TCP) send stream of bytes  Multiple sends may be combined  into one received message To send multiple application-level  messages, must have application level protocol E.g., 4-bytes = message type, 4-bytes =  message length, plus message UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 9
  • 10. Client-side: using sockets Creates socket  int fd = socket (AF_INET, SOCK_STREAM, 0)  Converts hostname to IP address with  getaddrinfo getaddrinfo (name, portStr, NULL, portNum)  Connects to host  connect (fd, addr, len); // from getaddrinfo  Once connected, can send or recv  send (fd, data, amount, 0);  recv (fd, buf, len, 0);  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 10
  • 11. Server-side: using sockets As before:  Create socket as before  Convert hostname to IP address with getaddrinfo  but in passive mode hint.ai_flags = AI_PASSIVE  getaddrinfo (name, portStr, &hint, &addrinfo)  Binds socket to address:  bind (fd, addr, len); // from getaddrinfo  Listens for connection:  listen (fd, 1); // number of waiting msgs  Accepts connection ) new socket  int newfd = accept (fd, addr, len);  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 11
  • 12. Exercise Lamest web server ever  Wait for connections on localhost port 80  Read message until first newline (‘n’)  Send <html><body>Hello  world</body></html> Use:  int fd = socket (AF_INET, SOCK_STREAM, 0)  getaddrinfo (name, portStr, &hint, &addrinfo)  bind (fd, addr, addrlen)  int v = listen (fd, 1)  int newfd = accept (fd, addr, len)  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 12
  • 13. Network Topologies Connection of nodes impacts:  Maximum & average communication time  Fault tolerance  Expense  Two basic topologies:  Bus (for LANs)  Point-to-point  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 13
  • 14. Bus Network Topologies Bus nodes connect to common network  Linear bus – single shared link  Nodes connect directly to each other via bus  Inexpensive (linear in # of nodes)  Tolerant of node failures  Ethernet LAN  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 14
  • 15. Bus Network Topologies Ring bus – single shared circular link  Same technology & tradeoffs as linear bus  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 15
  • 16. Point-to-Point Network Topologies Fully-connected  Each message takes one “hop”  Node failure – no effect on communication with  others Expensive – impractical for WANs  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 16
  • 17. Point-to-Point Network Topologies Fully-connected  Each message takes one “hop”  Node failure – no effect on communication with  others Expensive – impractical for WANs  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 17
  • 18. Point-to-Point Network Topologies Fully-connected  Each message takes one “hop”  Node failure – no effect on communication with  others Expensive – impractical for WANs  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 18
  • 19. Point-to-Point Network Topologies Fully-connected  Each message takes one “hop”  Node failure – no effect on communication with  others Expensive – impractical for WANs  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 19
  • 20. Point-to-Point Network Topologies 2 1 3 4 Partially connected  Links between some, but not all nodes  Less expensive, less tolerant to failures  Single node failure can partition network  Several hops – requires routing  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 20
  • 21. Point-to-Point Network Topologies I want to go 2 to Node 4! 1 3 4 Partially connected  Links between some, but not all nodes  Less expensive, less tolerant to failures  Single node failure can partition network  Several hops – requires routing  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 21
  • 22. Point-to-Point Network Topologies I want to go 2 to Node 4! 1 3 4 Partially connected  Links between some, but not all nodes  Less expensive, less tolerant to failures  Single node failure can partition network  Several hops – requires routing  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 22
  • 23. Point-to-Point Network Topologies Tree structure: network hierarchy  Messages fast between direct descendants  Max message cost?  Not failure tolerant  Any interior node fails – network partitioned  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 23
  • 24. Point-to-Point Network Topologies Star network: all nodes connect to central node  Each message takes how many hops?  Not failure tolerant  Inexpensive – sometimes used for LANs  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 24
  • 25. Point-to-Point Network Topologies One-directional ring  Given n nodes, max hops?  Inexpensive  Fault-tolerant?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 25
  • 26. Point-to-Point Network Topologies Bi-directional ring  Given n nodes, max hops?  Inexpensive  Fault-tolerant? One node? Two?  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 26
  • 27. Point-to-Point Network Topologies Doubly-connected ring: nodes connected to  neighbors & one more distant Given n nodes, max hops?  Fault-tolerant?  More expensive  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 27
  • 28. The End UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 28
  • 29. Distributed Systems Distributed system: physically separate processors  connected by one or more communication links  no shared clock or memory P2 P1 P4 P3 Most systems today distributed in some way   e-mail, file servers, network printers, remote backup, web... UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 29
  • 30. Parallel vs. Distributed Systems Tightly coupled systems: “parallel  processing” Processors share clock, memory, run one OS  Frequent communication  Loosely coupled systems: “distributed  computing” Each processor has own memory, runs  independent OS Infrequent communication  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 30
  • 31. Advantages of Distributed Systems Resource sharing  Computational speedup  Reliability  Communication  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 31
  • 32. Advantages of Distributed Systems Resource sharing  Resources need not be replicated  Shared files  Expensive (scarce) resources can be shared  Poster-size color laser printers  Processors present same environment to  user Keeping files on file server  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 32
  • 33. Advantages, continued Computational speedup  n processors = n times computational power  SETI@home  Problems must be decomposable into  subproblems Trivial = embarrassingly parallel  Coordination & communication required  between cooperating processes Synchronization  Exchange of results  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 33
  • 34. Advantages, continued Reliability  Replication of resources provides fault  tolerance One node crashes, user works on another one  Performance degradation but system available  Must avoid single point of failure  Single, centralized component of system  Example: central file servers  UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 34
  • 35. Advantages, continued Communication  Users/processes on different systems can  communicate Mail, transaction processing systems like  airlines & banks, www UNIVERSITY OF MASSACHUSETTS AMHERST • Department of Computer Science 35