The InetAddress Class A class for storing and managing internet addresses (both as IP numbers and as names). The are no constructors but “class factory”

Slides:



Advertisements
Similar presentations
TCP/IP MODEL Maninder Kaur
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
CCNA – Network Fundamentals
Intermediate TCP/IP TCP Operation.
Guide to TCP/IP, Third Edition
Advanced Java Programming: programming of distributed application using TCP/IP Santiago, Aug Nelson Baloian,
Content Introduction TCP Clients Iterative TCP Servers Concurent TCP Servers UDP Multicasting
Advanced Java Programming: programming of distributed application using TCP/IP Tokyo, Jan. Feb Nelson Baloian, Roberto Konow.
Universidad de Chile - Tupper 2007, Santiago - Fono: Fax: Módulo 9: Desarrollo de Aplicaciones.
Socket Programming.
1 Java Networking – Part I CS , Spring 2008/9.
Java Socket Support Presentation by: Lijun Yuan Course Number: cs616.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
An Introduction to Internetworking. Why distributed systems - Share resources (devices & CPU) - Communicate people (by transmitting data)
Administrativo Clases 2 veces a la semana : –Ma – Vi 12:00 Sin Clase auxiliar.
An Introduction to Internetworking. Algorithm for client-server communication with UDP (connectionless) A SERVER A CLIENT Create a server-socket (listener)and.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
What Is TCP/IP? The large collection of networking protocols and services called TCP/IP denotes far more than the combination of the two key protocols.
Programming for information communication systems Programming of distributed application over TCP/IP networks Yerevan, Sept.- Oct Nelson Baloian,
What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host IP treats a computer as an endpoint of communication Best.
Process-to-Process Delivery:
TRANSPORT LAYER T.Najah Al-Subaie Kingdom of Saudi Arabia Prince Norah bint Abdul Rahman University College of Computer Since and Information System NET331.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Lecture 2 TCP/IP Protocol Suite Reference: TCP/IP Protocol Suite, 4 th Edition (chapter 2) 1.
1 Chapter Client-Server Interaction. 2 Functionality  Transport layer and layers below  Basic communication  Reliability  Application layer.
Jaringan Komputer Dasar OSI Transport Layer Aurelio Rahmadian.
TCP/IP Yang Wang Professor: M.ANVARI.
TCP/IP: Basics1 User Datagram Protocol (UDP) Another protocol at transport layer is UDP. It is Connectionless protocol i.e. no need to establish & terminate.
Huda AL_Omairl - Network 71 Protocols and Network Software.
Jozef Goetz, Application Layer PART VI Jozef Goetz, Position of application layer The application layer enables the user, whether human.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 OSI Transport Layer Network Fundamentals – Chapter 4.
TCP/IP TCP/IP LAYERED PROTOCOL TCP/IP'S APPLICATION LAYER TRANSPORT LAYER NETWORK LAYER NETWORK ACCESS LAYER (DATA LINK LAYER)
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 26.
CSP Implementing a network 1 Implementing a network Lecturer: Smilen Dimitrov Cross-sensorial processing – MED7.
Fall 2005 By: H. Veisi Computer networks course Olum-fonoon Babol Chapter 6 The Transport Layer.
1. I NTRODUCTION TO N ETWORKS Network programming is surprisingly easy in Java ◦ Most of the classes relevant to network programming are in the java.net.
1 Networking Chapter Distributed Capabilities Communications architectures –Software that supports a group of networked computers Network operating.
Chapter 15 – Part 2 Networks The Internal Operating System The Architecture of Computer Hardware and Systems Software: An Information Technology Approach.
Transport Layer COM211 Communications and Networks CDA College Theodoros Christophides
Networking Basics CCNA 1 Chapter 11.
Lecture 4 Overview. Ethernet Data Link Layer protocol Ethernet (IEEE 802.3) is widely used Supported by a variety of physical layer implementations Multi-access.
Advanced UNIX programming Fall 2002, lecture 16 Instructor: Ashok Srinivasan Acknowledgements: The syllabus and power point presentations are modified.
The Client Server Model And Software Design
1. Layered Architecture of Communication Networks: TCP/IP Model
Reading TCP/IP Protocol. Training target: Read the following reading materials and use the reading skills mentioned in the passages above. You may also.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
1 Kyung Hee University Chapter 11 User Datagram Protocol.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
McGraw-Hill Chapter 23 Process-to-Process Delivery: UDP, TCP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
1 Network Communications A Brief Introduction. 2 Network Communications.
Process-to-Process Delivery:
UDP: User Datagram Protocol. What Can IP Do? Deliver datagrams to hosts – The IP address in a datagram header identify a host – treats a computer as an.
The Transport Layer Implementation Services Functions Protocols
Last Class: Introduction
Chapter 3 Internet Applications and Network Programming
TCP Transport layer Er. Vikram Dhiman LPU.
NET323 D: Network Protocols
NET323 D: Network Protocols
Process-to-Process Delivery:
An Introduction to Internetworking
An Introduction to Internetworking
Administrativo Clases 1 vez a la semana : Sin Ayudantia
Process-to-Process Delivery: UDP, TCP
Computer Networks Protocols
Tokyo, Feb Nelson Baloian, Teaching assistant: Roberto Konow
Transport Layer 9/22/2019.
Presentation transcript:

The InetAddress Class A class for storing and managing internet addresses (both as IP numbers and as names). The are no constructors but “class factory” –InetAddress n = InetAddress.getLocalHost() –InetAddress n = InetAddress.getByName(nombre) The most important methods: –String nombre = n.getHostName() –String direccion = n.getHostAddress() See the example InetExample.java & Names.java

Why distributed systems - Share resources - Communicate people - Performance, scalability - Fault tolerant systems

We know already how computers communicate but...

... 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

Every layer has the illusion of talking to the same one located at the other host A SERVER A CLIENT 4444 The UDP: User Defined Package: like writing a letterRead write sequence UDP or TCP communication Internet frames and addresses electric pulses

Decisions when Developing a Distributed System Which service from the transport layer are we going to use (TCP, UDP, or a middleware) Software architecture: replicated, centralized Communications architecture: centralized, networked Server design: concurrent, iterative, stateless, with state Etc…

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

Nowadays there is a lot of middleware which make distributed programming much easier Libraries for distributed programming (middleware) RPC, CORBA, RMI

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

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

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

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

Why Client/Server ? It is a communication protocol model (listener/caller) TCP/IP does not provide any mechanism which would start running a program in a computer when a message arrives. A program must be executing BEFORE the message arrives in order to establish a communication (daemons). Is there really no other mean to communicate ? –Multicasting (but the sender does not know who is receiving and in this case there is no dialogue) What are the protocol ports of a server machine ? –It is a virtual address inside the machine at a server listening to client requirements asking for a certain service. In most Unix machines there are “well known ports” which are associated to a server program providing a service trough a protocol. Port number and protocol should be well known.

Protocols for Communication Parameterized client applications –Generalizing the application scope. For example: Unix telnet can be used for requesting other services: try telnet host 7, telnet host 13 y telnet host 80) When designing client applications include parameters to fully specify machine and port to which the application should communicate trough its implemented protocol. Servers with or without Connection –The modalities connectionless style and connection-oriented style depend on the protocol type we use for connecting to a certain machine. In the TCP/IP world we have the TCP (connection oriented) and UDP (without connection) protocols

TCP or UDP Protocol: decision at the transport level What does it means for the programmer/designer: –By choosing one or the other protocol for establishing a connection between machines the programmer/designer decides about the reliability and speed of the communication. TCP provides high reliability: data are only sent if the communication was established. An underlying protocol is responsible for retranslating, ordering, eliminating duplicate packages UDP reflects just what the internet does with the packages: best effort delivery, no checking. –Also the programming style is quite different : With TCP the data is sent a flow (of bytes, in principle) which can be written, read as if they were stored in a file. With UDP the programmer must assemble the package and send it to the internet without knowing if it will arrive its pretended destination

When to use one or another Considerations –TCP imposes a much higher load to the network than UDP (almost 6 times) –We can expect high package loss when the information travels trough many routers. –Inside a LAN UDP communications may be reliable is there is not much traffic. Although with some congestion we can expect some packages to be lost inside the LAN In general, it is recommended especially for beginners (but also to skilled programmers) to use only TCP to develop distributed applications. Not only it is more reliable but the programming style is also simpler. UDP is normally used if the application needs to implement hardware supported broadcasting or multicasting, or if the application cannot tolerate the overload of TCP

The channel which server and client use to communicate (either int TCP or UDP) is called SOCKET A SERVER 1 When a server wants to start listening it must create a socket bound to a port. The port is specified with a number. A SERVER 2 A SERVER If a client wants to communicate with server 1 should try to communicate with computer through port 4444

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....) A SERVER A CLIENT message 4444 Once a server is listening, the client should create a datagram with the server’s address, port number and, the message ?

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 ?

Before the datagram leaves the client, it receives the address of the originating computer and the socket number A SERVER A CLIENT ! 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 ?

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 answer ?

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 ?

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 ?

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 bla

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

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 !!!

The Window for improving efficiency The transmitter will handle a set of not acknowledged packets Sending 1st bla Ack 1st bla Sending 2nd bla Ack 2nd bla Sending 3rd bla Ack 3rd bla

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 certain period of time - No need of speed UDP TCP - not complete info - fast - valid in a very short period of time - history not important

Mark with a + the applications to use TCP and with a = those to use UDP Video conference Temperature every second Web server and client Stock values every 5 seconds