os fall’02 introduction to networking and distributed systems operating systems fall 2002

38
OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

Post on 21-Dec-2015

225 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Introduction to Networking and Distributed Systems

Operating SystemsFall 2002

Page 2: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Overview Intro to Networking

Review of Basic principles: layers, protocols, etc…

TCP/IP and the InternetImplementation issues

Intro to Distributed systemsclient/server

Page 3: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Communication in everyday life

I like rabbits

Ik houvankonijnen

L: Dutch

J’aimeleslapins

Ik houvankonijnen

L: Dutch

Ik houvankonijnen

L: Dutch

Fax#

Ik houvankonijnen

L: Dutch

Fax#

Page 4: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Computer based communication

mail mail

mail mail

encode encode

message

messagerep

Page 5: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Computer based communication

mail mail

encode encodemessagerep

mail mail

encode encode

packetspackets

mess rep pkt age rep pkt

Page 6: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Computer based communication

mail mail

encode encode

packetspackets

routeroute route

message rep pkt addr

Page 7: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Computer based communication

mail mail

encode encode

packetspackets

routeroute route

message rep pkt addr ECC

errorerror error

Page 8: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Layered organization Computer networks are structured

as layer (protocol) stacks Each layer provides services to the

layer above Layers communicate by protocols

protocol

service service APIAPI

Page 9: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Protocols Protocol is a collection of message

formats and their interpretation needed to implement the layer service

format: header+dataheaders convey the protocol specific information

Page 10: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Standards and openness Protocols must be standardized for interoperability

Layer APIs must be standardized for portability

Existing standards:ISO OSI Layered model (“eight-layer model”)TCP/IP is a de-facto model of the Internet

Page 11: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

ISO OSI Layered modelApplication

Presentation

Session

Transport

Network

Data Link

Physical

Application

Presentation

Session

Transport

Network

Data Link

Physical

Page 12: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Lower OSI Layers Physical layer:

Voltages to represent 0/1, how many bits per second can be sent, simplex/duplex, hardware

Data Link layer:Grouping bits into frames, point-to-point reliability, error detection/correction

Page 13: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Network and Transport Network layer:

Getting data from one host to another Routing, addressing,

fragmentation/reassembly

Transport layer: End-to-end application connectivityReliable transport connection: Messages are not lost and delivered in the

order they were sent Transmission Control Protocol (TCP)

Page 14: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Session and Presentation Session layer:

Enhanced transport layer: session control

Presentation layer:Message structure: e.g., recordsData representationcompression and encryption

Page 15: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Application Layer General-purpose high level services

and abstractionsFile transfer (FTP)Hyper-text transfer (HTTP)Remote Procedure Call (RPC)Network File System (NFS)Object Request Brokers CORBA, Java RMI

Etc...

Page 16: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

TCP/IP Protocol Suite

Application

Presentation

Session

Transport

Network

Datalink

Physical

Application

TCP/UDP

IP

Physical

OSI model TCP/IP protocol suite

Network access

OS

Hardware

Page 17: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Physical Networks Each computer is directly attached to

some physical networkNetwork Interface Cards (NIC)+cablesUsually limited geographical scale (Local Area Network=LAN) MAN, WAN

supports routing, addressing, network access within its boundaries

LAN: Ethernet (10Mbit/sec, 100Mbit/sec), Token ring, Fibre channel, etc...

Page 18: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Physical networks characteristics

Bandwidth: Number of bits per second

Latency: The time it takes to send a single bit

Ethernet: Shared bus bandwidth: 10Mbit/secSwitched Ethernet bw: 100Mbit/sec

Page 19: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Ethernet LAN

Ethernet

IBM Compatible

IBM Compatible

IBM Compatible IBM Compatible

IBM Compatible

Shared bus Each NIC has a

unique address Messages are

broadcastIf collision occurs, wait for a randomly chosen time period and retry Maximum Transfer Unit

(MTU) = 1536 Bytes

Page 20: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Internet protocol (IP) Creates an illusion of a single

physical network over a collection of heterogeneous LANs

Global addressing, routingFragmentation, reassembly to overcome differences in the MTU sizes

Architecture: LANs interconnected by routers (gateways)

Page 21: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Internet Protocol (IP) Connectionless

Each packet is routed independently based on the IP address in the header

Connections are supported by the transport layer (TCP)

Page 22: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

The Internet

Ethernet

Token-ring

Ethernet

IBM Compatible

IBM Compatible

IBM Compatible

IBM Compatible

Hub

Ethernet

IBM Compatible

IBM Compatible

IBM Compatible

IBM Compatible

Hub

IBM CompatibleIBM Compatible

HubIBM Compatible

IBM Compatible

Page 23: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

The Internet

In ternetIP pro toco l

Computer

W orkstation

W orkstation

Mainframe

Minicomputer

Laptop

Laptop

Minicomputer

Page 24: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

TCP/IP transport protocols

Connectivity between application end-points

Application end-point is uniquely identified by (IP address,port number)

Transmission Control Protocol (TCP)Reliable end-to-end byte stream, connection oriented

User Datagram Protocol (UDP)Unreliable, connectionless

Page 25: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Implementation issues Reliability Flow control Routing

Page 26: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Reliability Physical networks are inherently

unreliableMessages can be both: corrupted and lost

Dealing with corruptionError detection, error correction

Dealing with message lossretransmission

Page 27: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Error detection/correction Parity bit is the simplest error

detection techniqueParity bit is the binary sum of the message bitsDetects corruption of a single bit

More parity bits are needed for error correction

Page 28: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Error correction Forward Error Correction (FEC)

A bit at position holds parity of bits whose positions includes in its binary representation

The positions of wrong parity bits yield the position of the erroneous bit

Corrects a single bit error

In practice more sophisticated techniques are used (e.g., CRC)

0,2 iii2

Page 29: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Dealing with message loss Timeouts

Send a message, wait for an acknowledgment (ACK)If an acknowledgment does not arrive during a predefined timeout period: retransmit the message If ack is lost a message can be sent more

than once!

Negative acknowledgments

Page 30: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Flow control Sender and received have limited buffer

space to hold outgoing and incoming messages

Flow control is needed to avoid buffer overflow

The simplest technique:The receiver buffer size in known in advanceSender never sends a new message until it knows that the receiver has enough space to accommodate it

Page 31: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Routing Each router holds a table indicating

the next router (hop) on the way to each destination

The next hop router must reside on the same physical network (LAN)

Routers exchange messages to update their routing tables

Protocols: Distance Vector (Bellman-Ford), Open Shortest Path First (OSPF)

Page 32: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Distributed Systems A distributed system (middleware) is an

implementation of an application level service

Distributed systems support high level abstractions

Remote Procedure Call (RPC): everything looks like a local function call

Network File System (NFS): everything looks like a local file

Object Based systems: Everything looks like a local object

Page 33: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Client/Server Paradigm Distributed systems are usually

structured according to the client/server model

A server implements a service Clients request service from the

server using a pre-defined protocol WWW, FTP, Telnet, NFS are all

client/server based

Page 34: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Internet Well-known services Well-known services must be

supported by all the computers connected to the Internet

Ftp, telnet, rlogin, nfs

Domain Name Service (DNS)Symbolic name <-> IP address

Uniquely identified by the port number of the server

HTTP: 80, FTP: 20

Page 35: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

RPC A server registers a procedure

implementation A client calls a function which looks

local to the clientE.g., add(a,b)

The RPC implementation packs (marshals) the function name and parameter values into a message and sends it to the server

Page 36: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

RPC Server accepts the message,

unpacks (unmarshals) parameters and calls the local function

Return values is then marshaled into a message and sent back to the client

Marshaling/unmarshaling must take into account differences in data representation

Page 37: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

RPC Transport: both TCP and UDP Data types: atomic types and non-

recursive structures Pointers are not supported Complex memory objects (e.g.,

linked lists) are not supported NFS is built on top of RPC

Page 38: OS Fall’02 Introduction to Networking and Distributed Systems Operating Systems Fall 2002

OS Fall’02

Next: Storage Area Networks and Modern storage architectures