Download presentation
Presentation is loading. Please wait.
Published byAbagail Adcock Modified over 9 years ago
1
Introduction to Java Networking Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-6
2
Slide - 2 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Networking Topics Network Protocols in Java: TCP UDP Multicast Threaded and Non-Threaded examples Remote Method Invocation (RMI)
3
Slide - 3 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng A Short History of Java Networking (1/3) The Dark Ages: C/C++ Networking and the Need for Change Before Java, simple network connectivity required lots of code. C/C++ provided many, many choices/options for networking Good for C programmers. Most programmers did not use all these options.
4
Slide - 4 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng A Short History of Java Networking (2/3) Java 1.0 Basic networking capability with high level abstraction of URL handlers. Low level choices were missing (e.g., connection timeouts.) Raw socket classes were final--java.net.Socket and java.net.ServerSocket could not be extended. “One shot” implementations with java.net.SocketImpl allowed only one implementation in each VM.
5
Slide - 5 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng A Short History of Java Networking (3/3) JDK 1.1 (the big leap) Added four common socket options. Allowed raw data manipulations within high-level abstractions. Removed final designations. Added multicast connections (previously limited to LAN and/or external native calls). JDK 1.2 (a second big leap) Addition of fine-grained Java Security Model. ability to control processes/connections/ports with very fine granular control over details. Added functionality to APIs.
6
Slide - 6 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Competing Networking Models: OSI vs. Internet Whose Kung Fu is Better? Two competing models are used to describe networking Open Systems Interconnection (OSI) architecture Internet Architecture Open Systems Interconnection Standard partitions network connectivity into seven layers. published by OSI and International Telecommunications Union (ITU) in series of “X dot” standards: X.25, X.400, etc. Internet Architecture Standard also known as “TCP/IP architecture” after its two key protocols evolved from packet-switched ARPANET of DoD Internet Engineering Task Force (IETF) maintenance.
7
Slide - 7 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng OSI in Action
8
Slide - 8 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Internet Architecture Model
9
Slide - 9 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Internet Architecture Model (1/2)
10
Slide - 10 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Internet Architecture Model (2/2)
11
Slide - 11 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Network Protocols in Java (1/3)
12
Slide - 12 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Basic Terminology: IP Address (2/3)
13
Slide - 13 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Basic Terminology: Ports (3/3)
14
Slide - 14 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng The java.net.* Package
15
Slide - 15 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Address Representations
16
Slide - 16 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Converting IP Numbers to String
17
Slide - 17 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Other InetAddress Services public boolean isMulticastAddress(); static InetAddress[] getAllByName(String host); Determines all the IP addresses of a host, given the host's name. static InetAddress getByName(String host); Determines the IP address of a host, given the host's name.
18
Slide - 18 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Sockets: Constructors
19
Slide - 19 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Sockets: Simple Usage
20
Slide - 20 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng TCP/UDP Connections Distinguished
21
Slide - 21 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Reading and Writing from Sockets (1/2) Sockets in Java are full duplex--meaning that they can both send and receive information. A good example of this feature is an echo client. The echo service listens to Port 7, and simply returns or ‘echoes back’ all information received from the client. An echo client, therefore, has to be able to send and receive over the same socket. Let’s look at an echo client written by Sun....
22
Slide - 22 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng Reading and Writing from Sockets (2/2)
23
Slide - 23 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng ServerSockets (1/3)
24
Slide - 24 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng ServerSockets (2/3)
25
Slide - 25 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng ServerSockets (3/3)
26
Slide - 26 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng
27
Slide - 27 OOP Lecture 2004 Dr. –Ing. Ir. Kalamullah Ramli, M.Eng The End QUESTIONS & COMMENTS ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.