Networks Computer-Computer Comm CPU CPU CPU CPU Memory Device - - PowerPoint PPT Presentation

networks computer computer comm
SMART_READER_LITE
LIVE PREVIEW

Networks Computer-Computer Comm CPU CPU CPU CPU Memory Device - - PowerPoint PPT Presentation

Networks Computer-Computer Comm CPU CPU CPU CPU Memory Device Device Memory Memory Device Device Memory Computer-Computer Comm CPU CPU CPU CPU Comm Comm Comm Comm Memory Memory Memory Memory Device Device Device Device


slide-1
SLIDE 1

Networks

slide-2
SLIDE 2

Computer-Computer Comm

Device Device Memory Memory CPU CPU Device Device Memory Memory CPU CPU

slide-3
SLIDE 3

Computer-Computer Comm

Comm Device Comm Device Memory Memory CPU CPU Modem Modem Phone Phone Comm Device Comm Device Memory Memory CPU CPU Modem Modem Phone Phone

Switched Telephone Network Switched Telephone Network

slide-4
SLIDE 4

Data Networks

Network Device Network Device Memory Memory CPU CPU Network Device Network Device Memory Memory CPU CPU

Specialized Data Network Specialized Data Network

  • WANs, MANs, and LANs
  • Specialized communication protocols
  • Multidrop
  • Packet oriented
  • Looks like other devices… make it look like a file ...
slide-5
SLIDE 5

Multidrop Packet Network

  • Need a cost-effective “switch fabric” --

cheaper/better than the telephone network

  • To transmit/receive:

– Sender convert data packet into form suitable for physical transmission – Deliver packets to destination host – Receiver converts physical signal back into a data packet

  • Need a widely-agreed upon set of protocols
slide-6
SLIDE 6

Protocol Tasks

  • Control information delivery rates
  • Pass info across networks
  • Provide fast/reliable IPC-like communication
  • Support logical byte streams
  • Create other models for communication

– File transfer – Procedure call paradigm – Shared memory paradigm

  • Translate machine-dependent data representations
  • … and more …
slide-7
SLIDE 7

Standardizing Protocols

  • ANSI X.25
  • ARPAnet
  • ISO Open Systems Interconnect (OSI)

model

– Now widely used as a reference architecture – 7-layer model – Provides framework for specific protocols (such as IP, TCP, FTP, RPC, RSVP, …)

slide-8
SLIDE 8

ISO OSI Model

Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical

slide-9
SLIDE 9

ISO OSI Model

Data Link Physical Data Link Physical

  • Physical/Data Link layer networks: Ethernet, Token Ring, ATM

Examples

slide-10
SLIDE 10

ISO OSI Model

Network Data Link Physical Network Data Link Physical

  • Physical/Data Link layer networks: Ethernet, Token Ring, ATM
  • Network layer net: The Internet

Examples

slide-11
SLIDE 11

ISO OSI Model

Transport Network Data Link Physical Transport Network Data Link Physical

  • Physical/Data Link layer networks: Ethernet, Token Ring, ATM
  • Network layer net: The Internet
  • Transport layer net: TCP-based network

Examples

slide-12
SLIDE 12

ISO OSI Model

Presentation Session Transport Network Data Link Physical Presentation Session Transport Network Data Link Physical

  • Physical/Data Link layer networks: Ethernet, Token Ring, ATM
  • Network layer net: The Internet
  • Transport layer net: TCP-based network
  • Presentation/Session layer net: http/html, RPC, PVM, MPI

Examples

slide-13
SLIDE 13

ISO OSI Model

Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical

  • Physical/Data Link layer networks: Ethernet, Token Ring, ATM
  • Network layer net: The Internet
  • Transport layer net: TCP-based network
  • Presentation/Session layer net: http/html, RPC, PVM, MPI
  • Applications, e.g., WWW, window system, numerical algorithm

Examples

slide-14
SLIDE 14

ISO OSI & TCP/IP

X.25 X.25 ISO OSI Network ISO OSI Network ISO OSI TLI ISO OSI TLI ISO OSI Session ISO OSI Session

ISO OSI packet ISO OSI frame X.25 packet

slide-15
SLIDE 15

ISO OSI & TCP/IP

X.25 X.25 ISO OSI Network ISO OSI Network ISO OSI TLI ISO OSI TLI ISO OSI Session ISO OSI Session

ISO OSI packet ISO OSI frame X.25 packet

Ethernet Ethernet ARPAnet IP ARPAnet IP ARPAnet TCP ARPAnet TCP ISO OSI Session ISO OSI Session

ISO OSI packet IP frame Ethernet packet

slide-16
SLIDE 16

Low Level Protocols

  • Physical layer: Signaling technology
  • Data link layer: Frame management
  • All done in hardware
  • Examples

– Ethernet – Token ring – X.25 – ATM

  • Read pages 463-471
slide-17
SLIDE 17

Network Layer

  • Primary purpose is to combine networks
  • Internet protocol (IP) is dominant protocol
  • Creates an internet address space
  • Implements packet routing across networks

Host X Host X Host R Host R Host S Host S Host Y Host Y Network B Network C Network A

slide-18
SLIDE 18

Addressing & Routing

Host X Host X Host R Host R Host Y Host Y Network C Network A

3b4e87 3b4e62 3b4e55 3b621a 3b6209

  • Host X does not know how to send to Host Y
  • Can send a frame to Host R for forwarding
  • What should it tell Host R?
slide-19
SLIDE 19

Addressing & Routing

Host X Host X Host R Host R Host Y Host Y Network C Network A

  • Host X does not know how to send to Host Y
  • Can send a frame to Host R for forwarding
  • What should it tell Host R?
  • Internet address spans all machines

3b4e87 3b4e62 3b4e55 3b621a 3b6209 128.123.234.033 128.123.234.188 128.229.244.006 128.229.244.109 128.123.234.063

To: 128.229.244.006 From: 128.123.234.033 Network Layer data

slide-20
SLIDE 20

Addressing & Routing

Host X Host X Host R Host R Host Y Host Y Network C Network A

  • Host X does not know how to send to Host Y
  • Can send a frame to Host R for forwarding
  • What should it tell Host R?
  • Internet address spans all machines
  • Send encapsulated packet to Host R with Host Y

3b4e87 3b4e62 3b4e55 3b621a 3b6209 128.123.234.033 128.123.234.188 128.229.244.006 128.229.244.109 128.123.234.063

To: 3b4e55 From: 3b4e87 To: 128.229.244.006 From: 128.123.234.033 Network Layer data

slide-21
SLIDE 21

Addressing & Routing

Host X Host X Host R Host R Host Y Host Y Network C Network A

  • Host X does not know how to send to Host Y
  • Can send a frame to Host R for forwarding
  • What should it tell Host R?
  • Internet address spans all machines
  • Send encapsulated packet to Host R with Host Y

3b4e87 3b4e62 3b4e55 3b621a 3b6209 128.123.234.033 128.123.234.188 128.229.244.006 128.229.244.109 128.123.234.063

Host S Host S Network B

slide-22
SLIDE 22

Addressing & Routing

Host X Host X Host R Host R Host Y Host Y Network C Network A

  • Host X does not know how to send to Host Y
  • Can send a frame to Host R for forwarding
  • What should it tell Host R?
  • Internet address spans all machines
  • Send encapsulated packet to Host R with Host Y
  • Data Link frame is received by Host Y

3b4e87 3b4e62 3b4e55 3b621a 3b6209 128.123.234.033 128.123.234.188 128.229.244.006 128.229.244.109 128.123.234.063

To: 3b621a From: ... To: 128.229.244.006 From: 128.123.234.033 Network Layer data

Network B

slide-23
SLIDE 23

More on the Network Layer

  • Implements internet addressing & routing
  • ARPAnet IP protocol is dominant --

underlies the Internet

  • Intermediate hosts are called gateways

– Connected to two or more networks – Runs IP routing software – nag is a gateway for the teaching lab – Read pages 471-477

slide-24
SLIDE 24

Transport Layer

  • Provides yet another address extension

– IP references only networks and hosts – Transport layer adds ports -- logical endpoints – Address form is <net, host, port>

  • Two primary protocols (both from ARPAnet)

– User Datagram Protocol (UDP)

  • User-space interface to IP packets
  • No guarantee that packet will be delivered

– Transmission Control Protocol (TCP)

  • Provides a stream-oriented interface to the network
  • Reliable delivery
slide-25
SLIDE 25

Communication Ports

  • Global name for a “mailbox”
  • Will be many ports at one <net, host>

P P P P

Transport Layer Network Layer Low Layers

Machine X

<net, host>

slide-26
SLIDE 26

Communication Ports

  • Global name for a “mailbox”
  • Will be many ports at one <net, host>
  • Each port can be bound to an address

P P P P

Transport Layer Network Layer Low Layers

Machine X

<net, host>

slide-27
SLIDE 27

BSD Sockets

  • Sockets are comm ports in BSD UNIX
  • Semantics resemble pipes (files)
  • Bidirectional
slide-28
SLIDE 28

BSD Sockets

  • Sockets are comm ports in BSD UNIX
  • Semantics resemble pipes (files)
  • Bidirectional

int socket(int addressFamily, int socketType, int protocolNo)

s

s = socket(…)

slide-29
SLIDE 29

BSD Sockets (cont)

  • Once a socket has been created, it can be

bound to an internet port

P

s

slide-30
SLIDE 30

BSD Sockets (cont)

  • Once a socket has been created, it can be

bound to an internet port

int bind(int skt, struct sockadrr *addr, int addrLength)

  • Example code available on the web page

P

s

slide-31
SLIDE 31

UDP

  • Datagram (“connectionless”) service

– Similar to disk I/O level of service

  • Logically associated with an IP packet &

Data Link frame (but not physically)

  • Best-effort delivery of datagrams, but:

– Datagram may be dropped (lost) – Datagrams may be delivered out of order

  • Efficient, relative to TCP
slide-32
SLIDE 32

Using UDP

/* Set up a socket to talk to the server */ skt = socket(AF_INET, SOCK_DGRAM, 0); host = gethostbyname(remoteHostName); bzero(&remote, sizeof(remote)); remote.sin_family = host->h_addrtype; remote.sin_port = htons(remotePort); bcopy(host->h_addr, &remote.sin_addr, host->h_length); /* Export the socket to a port (and IP address) */ host = gethostbyname(localHostName); bzero(&local, sizeof(local)); local.sin_family = host->h_addrtype; local.sin_port = htons(localPort); bcopy(host->h_addr, &local.sin_addr, host->h_length); if(bind(skt, &local, sizeof(local))) { printf("Bind error ... restart\n"); exit(1); } . . . sendto(s, outBuf, strlen(outBuf), 0, remote, sizeof(remote)); if((len = recv(s, inBuf, BUFLEN, 0)) > 0) {. . .}

slide-33
SLIDE 33

TCP

  • Connected (or virtual circuit) protocol
  • Interface allows programmer to read/write a

byte stream over the network

  • Byte stream is mapped into a series of

packets

– Reliable delivery – Each packet must be acknowledged – Effectively 2 packets per transmission

  • Must open/close a connection before use
slide-34
SLIDE 34

Using TCP -- Client

skt = socket(AF_INET, SOCK_STREAM, 0); host = gethostbyname(serverHostName); bzero(&listener, sizeof(listener)); listener.sin_family = host->h_addrtype; listener.sin_port = htons(port); bcopy(host->h_addr, &listener.sin_addr, host->h_length); if(connect(skt, &listener, sizeof(listener))) { printf("Connect error ... restart\n"); printf("(Must start Server end first)\n"); exit(1); }; . . . write(s, outBuf, BUFLEN); if((len = read(s, inBuf, BUFLEN)) > 0) {. . .}

slide-35
SLIDE 35

Using TCP -- Server

skt = socket(AF_INET, SOCK_STREAM, 0); /* Produce an inet address */ host = gethostbyname(serverHostName); bzero(&listener, sizeof(listener)); listener.sin_family = host->h_addrtype; listener.sin_port = htons(port); bcopy(host->h_addr, &listener.sin_addr, host->h_length); if(bind(skt, &listener, sizeof(listener))) { printf("Bind error ... restart\n"); exit(1); } listen(skt, BACKLOG); /* Listen for a request */ newSkt = accept(skt, &client, &clientLen); if (fork() == 0) { close(skt); /* Child doesn't need listener socket */ . . . } close(newSkt); /* Parent doesn't need the new socket */ if((len = read(s, inBuf, BUFLEN)) > 0) { . . .} write(s, outBuf, BUFLEN);

slide-36
SLIDE 36

Client-Server Paradigm

  • Making a connection in TCP is an example
  • f the client-server paradigm for distributed

computing

– Active component is the client

  • Runs autonomously
  • Decides when it wants to use server

– Passive component is the server

  • Persistent
  • Always waiting for a client to request service
  • Not a machine -- just software