27
CSS 432 1 CSS432 Foundation Textbook Ch1 Professor: Munehiro Fukuda

CSS432 Foundation Textbook Ch1

  • Upload
    lumina

  • View
    57

  • Download
    0

Embed Size (px)

DESCRIPTION

CSS432 Foundation Textbook Ch1. Professor: Munehiro Fukuda. …. limitations. length. #nodes. Building Blocks. Nodes: PC, special-purpose hardware… hosts switches Links: coax cable, optical fiber… point-to-point multiple access. Clouds - Networks. - PowerPoint PPT Presentation

Citation preview

Page 1: CSS432 Foundation Textbook Ch1

CSS 432 1

CSS432 FoundationTextbook Ch1

Professor: Munehiro Fukuda

Page 2: CSS432 Foundation Textbook Ch1

CSS 432 2

Building Blocks

Nodes: PC, special-purpose hardware… hosts switches

Links: coax cable, optical fiber… point-to-point

multiple access…

length

#nodes

limitations

Page 3: CSS432 Foundation Textbook Ch1

CSS 432 3

Clouds - Networks

A set of nodes, each connected to one or more p2p link

Switched network Circuit switch Packet switch

A set of independent clouds (networks) interconnected to forma an internetwork

Internet

A network can be defined recursively as...

Switch: forwarding message Router/gateway:forwarding message

Page 4: CSS432 Foundation Textbook Ch1

CSS 432 4

Strategies

Circuit switching: carry bit streamsoriginal telephone network

Packet switching: store-and-forward messages Internet

Page 5: CSS432 Foundation Textbook Ch1

CSS 432 5

Addressing and Routing

Address: byte-string that identifies a node usually unique

Routing: process of forwarding messages to the destination node based on its address Forwarding: local, static, and implemented by h/w Routing: dynamic, complex, and implemented by s/w

Types of addresses unicast: node-specific broadcast: all nodes on the network multicast: some subset of nodes on the network

Page 6: CSS432 Foundation Textbook Ch1

CSS 432 6

Multiplexing Synchronous Time-Division Multiplexing (STDM) Frequency-Division Multiplexing (FDM)

L1

L2

L3

R1

R2

R3Switch 1 Switch 2

Two limitations: If a host has no data to send, the corresponding time slot or

frequency becomes idle. The maximum number of flows, (#time slots and #different

frequencies) are fixed.

Page 7: CSS432 Foundation Textbook Ch1

CSS 432 7

Statistical Multiplexing On-demand time-division Schedule link on a per-packet basis Packets from different sources interleaved on link Buffer packets that are contending for the link Buffer (queue) overflow is called congestion

Page 8: CSS432 Foundation Textbook Ch1

CSS 432 8

Inter-Process Communication Turn host-to-host connectivity into process-to-

process communication. Fill gap between what applications expect and what

the underlying technology provides.

Host Host

Application

Host

Application

Host Host

Channel

Page 9: CSS432 Foundation Textbook Ch1

CSS 432 9

IPC Abstractions

Request/Reply Examples

FTP Web (HTTP) NFS

Requirements At most one message

delivery FIFO order Security

Stream-Based Examples

On-demand video Video conferencing

Requirements One/two-way traffic Bulk data transfer: 60Mbps Some data may be dropped

off. FIFO order Security

Page 10: CSS432 Foundation Textbook Ch1

CSS 432 10

What Goes Wrong in the Network?

Bit-level errors (electrical interference) Packet-level errors (congestion) Link and node failures

Messages are delayed Messages are deliver out-of-order Third parties eavesdrop

Page 11: CSS432 Foundation Textbook Ch1

CSS 432 11

Layering Use abstractions to hide complexity Abstraction naturally lead to layering Alternative abstractions at each layer

Request/replychannel

Message streamchannel

Application programs

Hardware

Host-to-host connectivity

Page 12: CSS432 Foundation Textbook Ch1

CSS 432 12

Process-to-process channels

Layering Use abstractions to hide complexity Abstraction naturally lead to layering Alternative abstractions at each layer

Application programs

Hardware

Host-to-host connectivity

Request/replychannel

Message streamchannel

Page 13: CSS432 Foundation Textbook Ch1

CSS 432 13

Protocols and Interfaces Protocol: Building each layer of a network architecture Each layer’s protocol has two different interfaces

service interface: operations on this protocol peer-to-peer interface: messages exchanged with peer

Host1

Protocol

Host 2

Protocol

High-levelobject

High-levelobject

Service

interface

Peer-to-peerinterface

Page 14: CSS432 Foundation Textbook Ch1

CSS 432 14

Protocol Machinery Protocol Graph

most peer-to-peer communication is indirect peer-to-peer is direct only at hardware level

Applications employ the protocol stack RRP/HHP

Fileapplication

Digitallibrary

application

Videoapplication

RRP MSP

HHP

Host 1

Fileapplication

Digitallibrary

application

Videoapplication

RRP MSP

HHP

Host 2

RRP: Request/Reply Protocol MSP: Message Stream ProtocolHPP: Host-to-Host Protocol

Page 15: CSS432 Foundation Textbook Ch1

CSS 432 15

Machinery (cont) Encapsulation (header + body or payload) Multiplexing and Demultiplexing (a demux key in each header)

RRP DataHHP

Applicationprogram

Applicationprogram

Host 1 Host 2

Data

RRP

RRP Data

HHP

Data

RRP

RRP Data

HHP

Page 16: CSS432 Foundation Textbook Ch1

CSS 432 16

OSI Architecture

Application

Presentation

Session

Transport

End host

One or more nodes

within the network

Network

Data link

Physical

Network

Data link

Physical

Network

Data link

Physical

Application

Presentation

Session

Transport

End host

Network

Data link

Physical

Page 17: CSS432 Foundation Textbook Ch1

CSS 432 17

Internet Architecture Defined by Internet Engineering Task Force (IETF) Hourglass Design Application vs Application Protocol (FTP, HTTP)

FTP HTTP NV TFTP

TCP UDP

IP

NET1 NET2 NETn Ethernet, FDDI, etc.

Internet Protocol

Reliable byte-stream channel Unreliable datagram delivery

Focal point for the architecture

Netscape, IE, Mosaic, etc.

Page 18: CSS432 Foundation Textbook Ch1

CSS 432 18

Socket API

Creating a socketint socket(int domain, int type, int protocol)

domain = PF_INET, PF_UNIX type = SOCK_STREAM, SOCK_DGRAM

Passive Open (on server)int bind(int socket, struct sockaddr *addr, int addr_len)

int listen(int socket, int backlog)

int accept(int socket, struct sockaddr *addr, int addr_len)

Page 19: CSS432 Foundation Textbook Ch1

CSS 432 19

Sockets (cont)

Active Open (on client)int connect(int socket, struct sockaddr *addr,

int addr_len)

Sending/Receiving Messagesint send(int socket, char *msg, int mlen, int flags)

int recv(int socket, char *buf, int blen, int flags)

Or

int write( int socket, char *msg, int mlen )

int read( int socket, char *buf, int blen );

Page 20: CSS432 Foundation Textbook Ch1

CSS 432 20

Sockets (Code Example)int sd, newSd;sd = socket(AF_INET, SOCK_STREAM, 0);

sockaddr_in server;bzero( (char *)&server, sizeof( server ) );server.sin_family =AF_INET;server.sin_addr.s_addr = htonl( INADDR_ANY )server.sin_port = htons( 12345 );bind( sd, (sockaddr *)&server, sizeof( server ) );

struct hostent *host = gethostbyname( arg[0] );sockaddr_in server;bzero( (char *)&server, sizeof( server ) );server.sin_family = AF_INET;server.s_addr = inet_addr( inet_ntoa( *(struct in_addr*)*host->h_addr_list ) );server.sin_port = htons( 12345 );

connect( sd, (sockaddr *)&server, sizeof( server ) );

sockaddr_in client; socklen_t len=sizeof(client);while( true ) { newSd = accept(sd, (sockaddr *)&client, &len);

write( sd, buf1, sizeof( buf ) );write( sd, buf2, sizeof( buf ) ); if ( fork( ) == 0 ) {

close( sd ); read( newSd, buf1, sizeof( buf1 ) ); read( newSd, buf2, sizeof( buf2 ) );

} close( newSd );}

read() read()

socket()

connect()

write()

socket()

connect()

write()

listen( sd, 5 );

socket()

bind()

listen()

accept()

buf2, buf1

buf2, buf1close( newsd);exit( 0 );

int sd = socket(AF_INET, SOCK_STREAM, 0);

Page 21: CSS432 Foundation Textbook Ch1

CSS 432 21

Protocol Implementation Issues Process Model

Process per protocol Process per message

avoid context switches

Buffer Model Copy from Application buffer to network buffer Zero copy / pin-down communication

avoid data copies

Page 22: CSS432 Foundation Textbook Ch1

CSS 432 22

(a) (b)

Process Model

Process-per-Protocol

• Simple message passing mechanisms between processes

• A context switch required at each layer

Process-per-Message

• For sending, functions are called down from top to bottom.

• For receiving, functions are called up from bottom to top.

Applications

Presentation

Transport

Session

Process 1

Process 2

Process 3

Static piece of code

Static piece of code

Static piece of code

Network

Page 23: CSS432 Foundation Textbook Ch1

CSS 432 23

Buffer Model

Avoid data copies Avoid OS interventions

message message message

message

copied

message

copied

message

passed

message

passed

message

bypassed

Conventional buffer transfer Zero copy communication Pin downed communication

Page 24: CSS432 Foundation Textbook Ch1

CSS 432 24

Performance Metrics Bandwidth (throughput)

data transmitted per time unit link versus end-to-end notation

Mbps = 106 bits per second Gbps = 109 bits per second

Latency (delay) time to send message from point A to point B one-way versus round-trip time (RTT) components

Latency = Propagation + Transmit + QueuePropagation = Distance / SpeedOfLightTransmit = Size / Bandwidth Even in the same distance, latency varies depending on the size of

message.

Page 25: CSS432 Foundation Textbook Ch1

CSS 432 25

Ideal versus Actual Bandwidth

RTT dominates Throughput = TransferSize / TransferTime TransferTime = RTT + 1/Bandwidth x TransferSize RTT:

a request message sent out and data received back

Example: 1-MB file across a 1-Gbps network with RTT=100ms. 1MB / 1Gbps = 8Mb / 1000Mbps = 8msec TransferTime = 100 + 8 = 108msec Throughput = 1MB / 108msec = 74.1 Mbps

Page 26: CSS432 Foundation Textbook Ch1

CSS 432 26

Delay x Bandwidth Product

Amount of data “in flight” or “in the pipe” Example: 100ms x 45Mbps = 560KB Receiver must prepare a buffer whose

size is at least 2 x Delay x Bandwidth

Bandwidth

Delay

Page 27: CSS432 Foundation Textbook Ch1

CSS 432 27

Reviews Components: hosts, links, switches, routers and networks Switching (circuit and packet) and multiplexing (STDM,

FDM, and statistical) OSI and Internet architectures Socket Performance metrics: Bandwidth and latency

Exercises in Chapter 1 Ex. 5 (RTT) Ex. 12 and 31 (STDM and FDM) Ex. 18 (Latency) Ex. 32 (Packet Sequence)