Presentation is loading. Please wait.

Presentation is loading. Please wait.

An Introduction to Internetworking

Similar presentations


Presentation on theme: "An Introduction to Internetworking"— Presentation transcript:

1 An Introduction to Internetworking
Design and Prog. of Distributed Systems

2 Why distributed systems
- Share resources (devices & CPU) - Communicate people (by transmitting data)

3 We know already how computers communicate but...

4 ... how do programs communicate?
They need to establish a protocol ! - Who send the data first - What kind of data - How to react to the data

5 Remember this ?

6 The client-server paradigm (do you remember the WEB ?)
answer The web server program request THE INTERNET Web resources answer request The web client program

7 1- The server opens a channel and starts listening to requests.
A SERVER ? 1 THE INTERNET Web resources A CLIENT

8 2- A client who knows it, sends a request and waits for the answer
A SERVER 2 THE INTERNET Web resources 2 A CLIENT

9 3- The server, analyses the request and answers properly according to the protocol
A SERVER 3 THE INTERNET Web resources 3 This may involve the reading of a file A CLIENT

10 The channel which server and client use to communicate is called SOCKET
When a server wants to start listening it must create a socket bound to a port. The port is specified with a number. 4444 A SERVER 1 3333 A SERVER 2 A SERVER 3 5555 If a client wants to communicate with server 1 should try to communicate with computer through port 4444

11 Internet : two different ways to deliver a message to another application
Applications’ programmers decide on this according to their needs The UDP: User Defined Package: like writing a letter TCP or UDP

12 UDP: communication with datagrams
DATAGRAM: an independent, self-contained message sent over the internet whose arrival, arrival time and content are not guaranteed (like regular mail in some countries....) Once a server is listening, the client should create a datagram with the server’s address, port number and, the message A SERVER A CLIENT ? 4444 4444 message

13 Sending datagrams with UDP protocol
Then it should open a socket and send the datagram to the internet. The “routing algorithm” will find the way to the target computer A SERVER A CLIENT ? 3333 4444

14 Sending datagrams with UDP protocol
Before the datagram leaves the client, it receives the address of the originating computer and the socket number A SERVER A CLIENT ! 3333 4444

15 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 3333 4444

16 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 3333 4444 answer

17 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 3333 4444

18 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 ? 3333 4444

19 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 !!!! bla bla A SERVER bla A CLIENT bla 3333 4444

20 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

21 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 1st bla Sending bla bla bla Ack 1st bla Sending 2nd bla LOST !!! Sending 2nd bla again No confirmation !!! Ack 2nd bla

22 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 UDP TCP - Reliable - Complete - Valid in a certain period of time - No need of speed - not complete - fast - valid in a very short period of time

23 Mark with a + the applications that need TCP and with a = the applications that can use UDP
Video conference Web server and client Stock values every 5 seconds Temperature every second

24 The Multicast paradigm
PROG2 PROG1 PROG2 PROG2

25 How do we implement this video-conference ? (why the problems)
A firewall in the Chilean router does not let multicast packages go in for security reasons Rat, vic Rat, vic Rat, vic Router in chile Rat, vic A Tunnel makes computers in Accessnova and Waseda look like being in the same local network

26 Attending more than a client: The sequential server
A SERVER A CLIENT 4444 A CLIENT

27 During the conversation the server is not listening at the port 444
A CLIENT A SERVER A CLIENT 4444 A CLIENT

28 Only after the server is ready with the first client it can listen to the port 444 again
A CLIENT A SERVER A CLIENT 4444 A CLIENT

29 The service may be to transfer a file
The service may be to transfer a file. The user at the client should first send the filename A CLIENT A SERVER A CLIENT 4444 A CLIENT

30 What if the server has to wait too much for a client to type in a file name ?
A SERVER Timeout A CLIENT 4444 A CLIENT

31 Concurrent Servers: there are separate processes to attend the port and to transfer the file
A CLIENT A SERVER 4444 A CLIENT A CLIENT

32 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 CLIENT A SERVER 4444 A CLIENT A CLIENT

33 While the new process is serving the first client, the second client can contact the server at the port 4444 A CLIENT A SERVER 4444 A CLIENT A CLIENT

34 And the server creates another process
A CLIENT A SERVER 4444 A CLIENT A CLIENT

35 Now the third client contacts the server
A CLIENT A SERVER 4444 A CLIENT A CLIENT

36 And a third slave process or thread is created
A CLIENT A SERVER 4444 A CLIENT A CLIENT

37 Every layer has the illusion to be talking to the correspondent one in the other application
A CLIENT A SERVER The UDP: User Defined Package: like writing a letter Read write sequence 4444 UDP or TCP communication A CLIENT Internet frames and addresses A CLIENT electric pulses

38 There are now a lot of resources between the application and transport layer which make distributed programming much easier Libraries for distributed programming (middleware) RPC, CORBA, RMI

39 For example, the RMI mechanism in JAVA (similar to CORBA)
Other applications use and share this object (data) Creates and publishes a Remote Object


Download ppt "An Introduction to Internetworking"

Similar presentations


Ads by Google