an introduction to internetworking

39
An Introduction to Internetworking

Upload: alan-parsons

Post on 31-Dec-2015

39 views

Category:

Documents


1 download

DESCRIPTION

An Introduction to Internetworking. Design and Prog. of Distributed Systems. Why distributed systems. - Share resources (devices & CPU) - Communicate people (by transmitting data). We know already how computers communicate but. ... how do programs communicate?. PROG1. PROG2. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: An Introduction to Internetworking

An Introduction to Internetworking

Page 2: An Introduction to Internetworking

Why distributed systems

- Share resources (devices & CPU)- Communicate people (by transmitting data)

Page 3: An Introduction to Internetworking

We know already how computers communicate but...

Page 4: An Introduction to Internetworking

... how do programs communicate?

PROG1 PROG2

They need to establish a protocol !

- Who send the data first- What kind of data- How to react to the data

Page 5: An Introduction to Internetworking

Remember this ?

Page 6: An Introduction to Internetworking

The client-server paradigm(do you remember the WEB ?)

The web server program

Webresources

request

answer

THE INTERNET

requestanswer

The web client program

Page 7: An Introduction to Internetworking

1- The server opens a channel and starts listening to requests.

A SERVER

Webresources

THE INTERNET

A CLIENT

1 ?

Page 8: An Introduction to Internetworking

2- A client who knows it, sends a request and waits for the answer

A SERVER

Webresources

THE INTERNET

A CLIENT

2

2

Page 9: An Introduction to Internetworking

3- The server, analyses the request and answers properly according to the

protocol

A SERVER

Webresources

THE INTERNET

A CLIENT

3

3

This may involve the reading of a file

Page 10: An Introduction to Internetworking

The channel which server and client use to communicate is called SOCKET

A SERVER 1

When a server wants to start listening it must create a socketbound to a port. The port is specified with a number.

A SERVER 2

A SERVER 3

www.thisserver.jp

4444

3333

5555

If a client wants to communicate with server 1 should try to communicate with computer www.thisserver.jp through port 4444

Page 11: An Introduction to Internetworking

Internet : two different ways to deliver a message to another application

The UDP: User Defined Package: like writing a letter

TCP or UDP

Applications’ programmers decide on this according to their needs

Page 12: An Introduction to Internetworking

UDP: communication with datagramsDATAGRAM: an independent, self-contained message sent over the internet whose arrival, arrival time and content are not guaranteed (like regular mail in some countries....)

A SERVER A CLIENT

4444

www.waseda1.jp

www.waseda1.jp

message

4444

Once a server is listening, the client should create a datagramwith the server’s address, port number and, the message

www.waseda2.jp

?

Page 13: An Introduction to Internetworking

Sending datagrams with UDP protocol

Then it should open a socket and send the datagramto the internet. The “routing algorithm” will find the way to the target computer

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

?

Page 14: An Introduction to Internetworking

Before the datagram leaves the client, it receives the address of the originating computer and the socket number

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

!

Sending datagrams with UDP protocol

Page 15: An Introduction to Internetworking

Sending datagrams with UDP protocol

After the datagram is sent, the client computer may start hearing at the port created for sending the datagram if an answer from the server is expected

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

?

Page 16: An Introduction to Internetworking

Sending datagrams with UDP protocol

The server can extract the client’s address and port number to create another datagram with the answer

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

answer

?

Page 17: An Introduction to Internetworking

Sending datagrams with UDP protocol

Finally is sends the datagram with the answer to the “client”. When a datagram is sent there is no guarantee that it will arrive to the destination. If you want reliable communication you should provide a checking mechanism, or use ...

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

?

Page 18: An Introduction to Internetworking

TCP: communication with data flow

With TCP a communication channel between both computers is built and a reliable communication is established between both computers. This allows to send a data flow rather tan datagrams.

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

?

Page 19: An Introduction to Internetworking

TCP: communication with data flow

After the client contacts the server, a reliable channel is established. After this, client and server may begin sending data through this channel. The other should be reading this data: They need a protocol !!!!

A SERVER A CLIENT

4444

www.waseda1.jp

3333

www.waseda2.jp

bla bla bla bla

Page 20: An Introduction to Internetworking

TCP: How is reliability achieved ?The internet itself works only with the datagram paradigm. Internet frames are may “get lost” (destroyed): For every frame delivered carrying a part of the data flow there is a confirmation!

Sending bla bla bla Sending 1st bla

Ack 1st bla

Sending 2nd bla

Ack 2nd bla

Sending 3rd bla

Ack 3rd bla

Page 21: An Introduction to Internetworking

What if a message get lost ?The server waits a certain amount of time. If it does not receive any confirmation it sends the message again.

Sending bla bla bla

Sending 1st bla

Ack 1st bla

Sending 2nd bla

Sending 2nd bla again

Ack 2nd bla

No confirmation !!!

LOST !!!

Page 22: An Introduction to Internetworking

When do programmers should use UDP or TCP ?

- TCP generates 6 times more traffic than UDP- It is also slower to send and receive the messages

- Reliable- Complete

- Valid in a certainperiod of time

- No need of speed

UDP TCP

- not complete- fast- valid in a very short period of time

Page 23: An Introduction to Internetworking

Mark with a + the applications that need TCP and with a = the applications that

can use UDP

E-Mail Video conference

Temperature every second

Web server and client

Stock values every 5 seconds

Page 24: An Introduction to Internetworking

The Multicast paradigm

PROG1

PROG2

PROG2

PROG2

Page 25: An Introduction to Internetworking

How do we implement this video-conference ? (why the problems)

Rat, vic

Rat, vic

Rat, vic

Rat, vicRouter in chile

A Tunnel makes computersin Accessnova and Waseda look like being in the same local network

A firewall in the Chilean routerdoes not let multicast packagesgo in for security reasons

Page 26: An Introduction to Internetworking

Attending more than a client: The sequential server

A SERVERA CLIENT

A CLIENT

A CLIENT

4444

Page 27: An Introduction to Internetworking

During the conversation the server is not listening at the port 444

A SERVERA CLIENT

A CLIENT

A CLIENT

4444

Page 28: An Introduction to Internetworking

Only after the server is ready with the first client it can listen to the

port 444 again

A SERVERA CLIENT

A CLIENT

A CLIENT

4444

Page 29: An Introduction to Internetworking

The service may be to transfer a file. The user at the client should first

send the filename

A SERVERA CLIENT

A CLIENT

A CLIENT

4444

Page 30: An Introduction to Internetworking

What if the server has to wait too much for a client to type in a file

name ?

A SERVERA CLIENT

A CLIENT

A CLIENT

4444

Timeout

Page 31: An Introduction to Internetworking

Concurrent Servers: there are separate processes to attend the port

and to transfer the file

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

Page 32: An Introduction to Internetworking

After the client contacts the server, the server creates another process to attend the client and keeps listening to the port

4444 for another

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

Page 33: An Introduction to Internetworking

While the new process is serving the first client, the second client can contact the

server at the port 4444

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

Page 34: An Introduction to Internetworking

And the server creates another process

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

Page 35: An Introduction to Internetworking

Now the third client contacts the server

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

Page 36: An Introduction to Internetworking

And a third slave process or thread is created

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

Page 37: An Introduction to Internetworking

Every layer has the illusion to be talking to the correspondent one in the other

application

A SERVER

A CLIENT

A CLIENT

A CLIENT

4444

The UDP: User Defined Package: like writing a letterRead write sequence

UDP or TCP communication

Internet frames and addresses

electricpulses

Page 38: An Introduction to Internetworking

There are now a lot of resources between the application and transport layer

which make distributed programming much easier

Libraries for distributedprogramming (middleware)

RPC, CORBA, RMI

Page 39: An Introduction to Internetworking

For example, the RMI mechanism in JAVA (similar to CORBA)

Creates and publishesa Remote Object

Other applications use and share this object (data)