Prepared By E.Musa Alyaman1 Chapter 3 Internet Addressing.

Slides:



Advertisements
Similar presentations
19.1 Chapter 19 Network Layer: Logical Addressing Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Advertisements

Advanced Java Programming Unit One: Networking Gareth Lee Department of Electrical and Electronic Engineering, University of Western Australia John Morris.
Classifying Network Addressing
Chapter 19 Network Layer: Logical Addressing Stephen Kim.
Introduction to Java Networking Lecturer: Kalamullah Ramli Electrical Engineering Dept. University of Indonesia Session-6.
IP Addressing. TCP/IP addresses -Addressing in TCP/IP is specified by the Internet Protocol (IP) -Each host is assigned a 32-bit number -Called the IP.
Jan Java Networking TCP Yangjun Chen Dept. Business Computing University of Winnipeg.
Basic Socket Programming with Java. What is a socket?  Generally refers to a stream connecting processes running in different address spaces (across.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
Internet Programming In Java. References Java.sun.com Java552 Many of the programs shown.
COMP1681 / SE15 Introduction to Programming
Client/Server In Java An Introduction to TCP/IP and Sockets.
Internet Addressing. Introduction The Internet is a vast collection of machines and devices spread out across the world. There is an important need to.
28-Jun-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you.
Networking Support In Java Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
Prepared By E.Musa Alyaman1 Networking Theory Chapter 1.
15-Jul-15 Basic Protocols. 2 Sockets Sockets, or ports, are a very low level software construct that allows computers to talk to one another When you.
Networking java.net package, which provides support for networking. Its creators have called Java “programming for the Internet.” Socket :- A network socket.
Layering and the TCP/IP protocol Suite  The TCP/IP Protocol only contains 5 Layers in its networking Model  The Layers Are 1.Physical -> 1 in OSI 2.Network.
Socket Programming -What is it ? -Why bother ?. Basic Interface for programming networks at transport level It is communication end point Used for inter.
CS4273: Distributed System Technologies and Programming I Lecture 5: Java Socket Programming.
Computer Networks  Network - A system of computers interconnected in order to share information.  Data transmission - consists of sending and receiving.
 Socket  The combination of an IP address and a port number. (RFC 793 original TCP specification)  The name of the Berkeley-derived application programming.
Import java.net.*; import java.io.*; public class LowPortScanner { public static void main(String[] args) { String host = "localhost"; if (args.length.
DBI Representation and Management of Data on the Internet.
1 CSCD 330 Network Programming Winter 2015 Some Material in these slides from J.F Kurose and K.W. Ross All material copyright Lecture 6 Application.
Part 3: Internetworking Internet architecture, addressing, encapsulation, reliable transport and the TCP/IP protocol suite.
Chapter 18 IP: Internet Protocol Addresses
Chapter 4, slide: 1 CS 372 – introduction to computer networks* Friday July 23, 2010 Announcements: r Midterms are graded. r Lab 4 is posted. Acknowledgement:
Network Layer: Logical Addressing. Address Space Notations Classful Addressing Classless Addressing Network Address Translation (NAT) Topics Discussed.
1 A TCP/IP Application Programming Perspective Chris Greenhalgh G53ACC.
WAN the internet and protocol  Lesson Objective: Understand the main terminology about networks.  Learning Outcome: Understand the different types of.
Spring/2002 Distributed Software Engineering C:\unocourses\4350\slides\DefiningThreads 1 RMI.
Object Oriented Programming in Java Lecture 16. Networking in Java Concepts Technicalities in java.
Java Sockets Programming
What is TCP/IP? TCP/IP is the communication protocol for communication between computers on the Internet. TCP/IP stands for Transmission Control Protocol.
IP1 The Underlying Technologies. What is inside the Internet? Or What are the key underlying technologies that make it work so successfully? –Packet Switching.
Chapter 5 IPv4 Address.
IP addresses IPv4 and IPv6. IP addresses (IP=Internet Protocol) Each computer connected to the Internet must have a unique IP address.
Chapter 18 IP: Internet Protocol Addresses. Internet protocol software used to make the internet appear to be a single, seamless communication system.
By Vivek Dimri. Basic Concepts on Networking IP Address – Protocol – Ports – The Client/Server Paradigm – Sockets The Java Networking Package – The InetAddress.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Inetaddress Class When establishing a connection across the Internet, addresses.
Connection Technologies and IP Addressing CONNECTING TO THE INTERNET.
Agenda Socket Programming The OSI reference Model The OSI protocol stack Sockets Ports Java classes for sockets Input stream and.
IP ADDRESSES Lecture 6: Network Architectures. IP address  address (IP address) is a numerical label assigned to each device (e.g., computer, printer)
Advance Computer Programming Networking Basics – explores the java.net package which provides support for networking. – Also Called “programming for the.
INTERNET PROTOCOL ADDRESS AND SUBNET MASK KAAN EREN.
Object Oriented Programming Lecture 2: BallWorld.
Windows Vista Configuration MCTS : Advanced Networking.
Network Programming. These days almost all devices.
Network Programming Communication between processes Many approaches:
Advanced Java Programming Unit One: Networking
4.3 Network Layer Logical Addressing
OSI Model IP address.
Data Communication and Networking CISCO – Discovery 1
Topic: Network programming
Network Programming Introduction
DNS Server is…? 2CP – C Lee Kyu Don.
NETWORK PROGRAMMING CNET 441
An IPv4 address is a 32-bit address that uniquely and universally defines the connection of a device (for example, a computer or a router) to the Internet.
An Introduction to TCP/IP and Sockets
Network Programming Introduction
Java Network Programming
IPV4 Address & subnet masks
Networking.
Networking for Home and Small Businesses – Chapter 5
Network Addressing.
Part IV Network layer 10. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Layering and the TCP/IP protocol Suite
Presentation transcript:

Prepared By E.Musa Alyaman1 Chapter 3 Internet Addressing

Prepared By E.Musa Alyaman2 Chapter 3 Outline Hosts Internet addresses Next Generation Internet IPv4 Class A,B and C addresses Domain Name System (DNS) Creating InetAddresses Java 1.4 Added Methods Getter Methods Address Types Object Methods Chapter 3 Highlights

Prepared By E.Musa Alyaman3 Hosts Devices connected to the Internet are called hosts Most hosts are computers, but hosts also include routers, printers, fax machines,etc.

Prepared By E.Musa Alyaman4 Internet addresses Every host on the Internet is identified by a unique, four-byte Internet Protocol (IP) address. This is written in dotted quad format like where each byte is an unsigned integer between 0 and 255. There are about four billion unique IP addresses, but they aren’t very efficiently allocated

Prepared By E.Musa Alyaman5 Next Generation Internet The solution is IPv6 which uses 128 bit addresses Improves services such as multicasting and secure communication Not yet widely deployed by ISPs Well written Java software should move to IPv6 without modification/recompilation this is one benefit of abstracted APIs

Prepared By E.Musa Alyaman6 IPv4 Each 32 bit IP number consists of two components: –The network address The unique international address of the network –The host address The unique address of a specific host in the net There are three classes of network address denoted class ‘A’, ‘B’ and ‘C’

Prepared By E.Musa Alyaman7 Class A,B and C addresses Class A Class B Class C Network Address Byte Host Address Byte

Prepared By E.Musa Alyaman8 Domain Name System (DNS) Numeric addresses are mapped to names like or mail.msn.com by DNS. Each site runs domain name server software that translates names to IP addresses and vice versa DNS is a distributed system

Prepared By E.Musa Alyaman9 IP Addresses and Java Java has a class java.net.InetAddress which abstracts network addresses Serves three main purposes: –Encapsulates an address –Performs name lookup (converting a host name into an IP address) –Performs reverse lookup (converting the address into a host name)

Prepared By E.Musa Alyaman10 Creating InetAddresses There are no public InetAddress() constructors. Arbitrary addresses may not be created. All addresses that are created must be checked with DNS

Prepared By E.Musa Alyaman11 Ways to create InetAddress objects public static InetAddress getByName(String host) throws UnknownHostException public static InetAddress[ ] getAllByName(String host) throws UnknownHostException public static InetAddress getLocalHost() throws UnknownHostException

Prepared By E.Musa Alyaman12 Java 1.4 Added Methods Java 1.4 adds two more factory methods that do not check their addresses with the local DNS server. The first creates an InetAddress object with an IP address and no hostname. The second creates an InetAddress object with an IP address and a hostname. public static InetAddress getByAddress(byte[ ] address) throws UnknownHostException public static InetAddress getByAddress(String hostName, byte[] address) throws UnknownHostException

Prepared By E.Musa Alyaman13 Getter Methods They return the hostname as a string and the IP address as both string and a byte array public String getHostName() public byte[ ] getAddress() public String getHostAddress()

Prepared By E.Musa Alyaman14 Address Types Public boolean isAnyLocalAddress() Public boolean isLoopbackAddress() Public boolean isLinkLocalAddress() Public boolean isSiteLocalAddress() Public boolean isMulticastAddress() Public boolean isMCGloabl() Public boolean isMCNodeLocal(( Public boolean isMCLinkLocal() Public boolean isMCSiteLocal() Public boolean isMCOrgLocal()

Prepared By E.Musa Alyaman15 Object Methods Public boolean equals (Object o) Public int hashCode () Public String toString ()

Prepared By E.Musa Alyaman16 Inet4Address and Inet6Address Public final class Inet4Address extends InetAddress Public final class Inet6Address extends InetAddress

Prepared By E.Musa Alyaman17 Using InetAddress objects import java.net.InetAddress; import java.net.UnknownHostExcepion; public static void main(String[] args) { try { InetAddress inet1 = InetAddress.getByName("asp.ee.uwa.edu.au"); System.out.println( "HostAddress=" + inet1.getHostAddress()); InetAddress inet2 = InetAddress.getByName(" "); System.out.println("HostName=" + inet2.getHostName()); if (inet1.equals(inet2)) System.out.println("Addresses are equal"); } catch (UnknownHostException uhe) { uhe.printStackTrace(); }

Prepared By E.Musa Alyaman18 Chapter Highlights In this chapter, you have learned: About the Domain Name System (DNS) and domain name suffixes (such as.com) About the structure of an IP address and the various classes of IP addresses About the InetAddress class and its various methods