SlideShare a Scribd company logo
CHAPTER 2 :
Internet Addressing & Data Stream
By :
Mr. Asyran Zarizi Bin Abdullah
Socket Programming
• Socket is a IPC (Inter Process Communication)
facility for network application.
• To make socket communicate with other
socket, so it need unique address as a
identifier.
• Socket Address contain IP Address and Port
Number. Example : 192.168.20.12 : 8080
IP Address Port Number
What is IP ?
W2-1-2, Kuates Staff
Politeknik Muadzam Shah,
26700, Pahang D.M
W2-1-2, Kuates Staff
Politeknik Muadzam
Shah,
26700, Pahang D.M
PC A
(Source)
PC B
(Destination)
172.168.2.3 10.10.10.34
An Analogy
HERE WE KNOW THE IMPORTANT IS…
Internet Addressing
• IP is stand for Internet Protocol.
• IP is an unique ID.
• It use for communicate between 1 point to
another point in network.
• Public & Private
• IPv4 has 32 bits , example : 192.168.32.12
but IP Address is running out….
Quiz :
What is the solution for
ipv4 issues?
Quiz :
What is the solution for
ipv4 issues?
Answer : ipv6
What is this??
This is IPV4 
4,294,672,96
340,282,366,920,938,463,463,
374,607,431,768,211,456
340 Undecillion!!!
Internet Addressing in JAVA
• Java is a capable programming language that is
capable to support networked environment
which support most popular protocol available
• Java API that support internet addressing is :-
– InetAddress
• There are two subclasses under it
– Inet4Address
– Inet6Address
– An InetAddress object is capable to store IP address or
Domain name which later used for communication
address or translation between the form available.
IP Addresses & Hostname
• Java.net.InetAddress class
– Represents a single IP Address
– Performs transparent DNS lookups
• Java.net.UnknownHostException class
– Thrown if DNS system can`t find IP address for
specific host
InetAddress class
• Creating an InetAddress object is as follow:-
• Some of the useful methods within InetAddress class
– getHostName()
• It return the host domain name in String format
– getHostAddress()
• It return the IP address in String format
– getLocalHost()
• It return InetAddress object with local computer address information
with its host name
– getByName()
• It return InetAddress object of a destination computer containing its
address and host name
getByName example
getHostName example
getHostAddress example
getLocalHost example
Socket & Protocol

More Related Content

What's hot

Java networking
Java networkingJava networking
Java networking
Arati Gadgil
 
Internet protocols
Internet protocolsInternet protocols
Internet protocols
Rohit Saini
 
Internet protocol (ip)
Internet protocol (ip)Internet protocol (ip)
Internet protocol (ip)
junnubabu
 
Internet protocol
Internet protocol Internet protocol
Internet protocol
Bint Javed
 
Skype and icq referat final - copy
Skype and icq referat   final - copySkype and icq referat   final - copy
Skype and icq referat final - copyMatej Kostroš
 
Loopback address
Loopback addressLoopback address
Loopback address
CEC Landran
 
Python network programming
Python   network programmingPython   network programming
Python network programming
Learnbay Datascience
 
what is Private and publis ip address
what is Private and publis ip addresswhat is Private and publis ip address
what is Private and publis ip address
Amit Kumar , Jaipur Engineers
 
Network Programming Assignment Help
Network Programming Assignment HelpNetwork Programming Assignment Help
Network Programming Assignment Help
HelpWithAssignment.com
 
Session 2 Tp 2
Session 2 Tp 2Session 2 Tp 2
Session 2 Tp 2githe26200
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
Jayesh Chauhan
 
Socket Programming w/ C# - IK
Socket Programming w/ C# - IKSocket Programming w/ C# - IK
Socket Programming w/ C# - IK
Ilgın Kavaklıoğulları
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
Lakshay Khandal Luck
 
IPv6 Addressing Architecture
IPv6 Addressing ArchitectureIPv6 Addressing Architecture
IPv6 Addressing Architecture
Shreehari Dhat
 
Ip address.
Ip address.Ip address.
Ip address.
Saravanan R
 
Types of ip address classes
Types of ip address classesTypes of ip address classes
Types of ip address classes
greatbury
 
Multiuser chat application using java
Multiuser chat application using javaMultiuser chat application using java
Multiuser chat application using java
asifnoman240
 
Osi model layers
Osi model layersOsi model layers
Osi model layers
Anis Mizi
 
IP Address
IP AddressIP Address
IP Address
Rahul P
 

What's hot (20)

Java networking
Java networkingJava networking
Java networking
 
Internet protocols
Internet protocolsInternet protocols
Internet protocols
 
Internet protocol (ip)
Internet protocol (ip)Internet protocol (ip)
Internet protocol (ip)
 
Internet protocol
Internet protocol Internet protocol
Internet protocol
 
Skype and icq referat final - copy
Skype and icq referat   final - copySkype and icq referat   final - copy
Skype and icq referat final - copy
 
Loopback address
Loopback addressLoopback address
Loopback address
 
Python network programming
Python   network programmingPython   network programming
Python network programming
 
what is Private and publis ip address
what is Private and publis ip addresswhat is Private and publis ip address
what is Private and publis ip address
 
Network Programming Assignment Help
Network Programming Assignment HelpNetwork Programming Assignment Help
Network Programming Assignment Help
 
Session 2 Tp 2
Session 2 Tp 2Session 2 Tp 2
Session 2 Tp 2
 
Internet Protocol
Internet ProtocolInternet Protocol
Internet Protocol
 
Socket Programming w/ C# - IK
Socket Programming w/ C# - IKSocket Programming w/ C# - IK
Socket Programming w/ C# - IK
 
Internet protocol
Internet protocolInternet protocol
Internet protocol
 
IPv6 Addressing Architecture
IPv6 Addressing ArchitectureIPv6 Addressing Architecture
IPv6 Addressing Architecture
 
Ip address.
Ip address.Ip address.
Ip address.
 
Ip address
Ip addressIp address
Ip address
 
Types of ip address classes
Types of ip address classesTypes of ip address classes
Types of ip address classes
 
Multiuser chat application using java
Multiuser chat application using javaMultiuser chat application using java
Multiuser chat application using java
 
Osi model layers
Osi model layersOsi model layers
Osi model layers
 
IP Address
IP AddressIP Address
IP Address
 

Similar to Chapter 2 : Inet Address & Data Stream

Ip address
Ip addressIp address
Ip address
Robin Sedeqi
 
MVA slides lesson 4
MVA slides lesson 4MVA slides lesson 4
4. Understanding Internet Protocol.pptx
4. Understanding Internet Protocol.pptx4. Understanding Internet Protocol.pptx
4. Understanding Internet Protocol.pptx
Robertohtirolhsconce
 
Basics about IP address, DNS and DHCP.
Basics about IP address, DNS and DHCP.Basics about IP address, DNS and DHCP.
Basics about IP address, DNS and DHCP.
abhishek bhandare
 
Internetworking
InternetworkingInternetworking
Internetworking
Mahendhirakumar C
 
183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)
MdJiarulIslam
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
kamal kotecha
 
Microsoft Offical Course 20410C_05
Microsoft Offical Course 20410C_05Microsoft Offical Course 20410C_05
Microsoft Offical Course 20410C_05
gameaxt
 
ffuyu yguyguyg.pptx
ffuyu yguyguyg.pptxffuyu yguyguyg.pptx
ffuyu yguyguyg.pptx
vishweshbhat4
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
TheGodfather HA
 
Ip addressing upload
Ip addressing uploadIp addressing upload
Ip addressing upload
Debasis Dwibedy
 
Unit 2 : Internet Address
Unit 2 : Internet AddressUnit 2 : Internet Address
Unit 2 : Internet Address
Chandan Gupta Bhagat
 
Ip address and subnet masking final
Ip address and subnet masking finalIp address and subnet masking final
Ip address and subnet masking final
NeerajBhardwaj57
 
Ip and mac adress
Ip and mac adressIp and mac adress
Ip and mac adress
sheikhparvez4
 
Module 1 networking basics-2
Module 1   networking basics-2Module 1   networking basics-2
Module 1 networking basics-2
Ankit Dubey
 
Tcp ip protocol
Tcp ip protocol Tcp ip protocol
Tcp ip protocol saurav-IT
 
2.2.1.4 internet address amrizah
2.2.1.4 internet address amrizah2.2.1.4 internet address amrizah
2.2.1.4 internet address amrizahhazirma
 
Lesson 4
Lesson 4Lesson 4
Lesson 4
MdAlifKhanRifat
 

Similar to Chapter 2 : Inet Address & Data Stream (20)

Ip address
Ip addressIp address
Ip address
 
MVA slides lesson 4
MVA slides lesson 4MVA slides lesson 4
MVA slides lesson 4
 
4. Understanding Internet Protocol.pptx
4. Understanding Internet Protocol.pptx4. Understanding Internet Protocol.pptx
4. Understanding Internet Protocol.pptx
 
Basics about IP address, DNS and DHCP.
Basics about IP address, DNS and DHCP.Basics about IP address, DNS and DHCP.
Basics about IP address, DNS and DHCP.
 
Internetworking
InternetworkingInternetworking
Internetworking
 
183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)183492595 md.jiarul islam(CSE 318)
183492595 md.jiarul islam(CSE 318)
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Microsoft Offical Course 20410C_05
Microsoft Offical Course 20410C_05Microsoft Offical Course 20410C_05
Microsoft Offical Course 20410C_05
 
ffuyu yguyguyg.pptx
ffuyu yguyguyg.pptxffuyu yguyguyg.pptx
ffuyu yguyguyg.pptx
 
IPv4 Addressing
 IPv4 Addressing   IPv4 Addressing
IPv4 Addressing
 
Ip addressing upload
Ip addressing uploadIp addressing upload
Ip addressing upload
 
Unit 2 : Internet Address
Unit 2 : Internet AddressUnit 2 : Internet Address
Unit 2 : Internet Address
 
Ip address and subnet masking final
Ip address and subnet masking finalIp address and subnet masking final
Ip address and subnet masking final
 
Ip and mac adress
Ip and mac adressIp and mac adress
Ip and mac adress
 
Module 1 networking basics-2
Module 1   networking basics-2Module 1   networking basics-2
Module 1 networking basics-2
 
Ccna1v3 mod09
Ccna1v3 mod09Ccna1v3 mod09
Ccna1v3 mod09
 
Tcp ip protocol
Tcp ip protocol Tcp ip protocol
Tcp ip protocol
 
2.2.1.4 internet address amrizah
2.2.1.4 internet address amrizah2.2.1.4 internet address amrizah
2.2.1.4 internet address amrizah
 
Lesson 4
Lesson 4Lesson 4
Lesson 4
 
Ccna1v3 Mod09
Ccna1v3 Mod09Ccna1v3 Mod09
Ccna1v3 Mod09
 

Recently uploaded

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
Jheel Barad
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Po-Chuan Chen
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 

Recently uploaded (20)

"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 

Chapter 2 : Inet Address & Data Stream

  • 1. CHAPTER 2 : Internet Addressing & Data Stream By : Mr. Asyran Zarizi Bin Abdullah
  • 2. Socket Programming • Socket is a IPC (Inter Process Communication) facility for network application. • To make socket communicate with other socket, so it need unique address as a identifier. • Socket Address contain IP Address and Port Number. Example : 192.168.20.12 : 8080 IP Address Port Number
  • 4. W2-1-2, Kuates Staff Politeknik Muadzam Shah, 26700, Pahang D.M W2-1-2, Kuates Staff Politeknik Muadzam Shah, 26700, Pahang D.M PC A (Source) PC B (Destination) 172.168.2.3 10.10.10.34 An Analogy
  • 5. HERE WE KNOW THE IMPORTANT IS…
  • 6. Internet Addressing • IP is stand for Internet Protocol. • IP is an unique ID. • It use for communicate between 1 point to another point in network. • Public & Private • IPv4 has 32 bits , example : 192.168.32.12 but IP Address is running out….
  • 7. Quiz : What is the solution for ipv4 issues?
  • 8. Quiz : What is the solution for ipv4 issues? Answer : ipv6
  • 9.
  • 13.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Internet Addressing in JAVA • Java is a capable programming language that is capable to support networked environment which support most popular protocol available • Java API that support internet addressing is :- – InetAddress • There are two subclasses under it – Inet4Address – Inet6Address – An InetAddress object is capable to store IP address or Domain name which later used for communication address or translation between the form available.
  • 23. IP Addresses & Hostname • Java.net.InetAddress class – Represents a single IP Address – Performs transparent DNS lookups • Java.net.UnknownHostException class – Thrown if DNS system can`t find IP address for specific host
  • 24. InetAddress class • Creating an InetAddress object is as follow:- • Some of the useful methods within InetAddress class – getHostName() • It return the host domain name in String format – getHostAddress() • It return the IP address in String format – getLocalHost() • It return InetAddress object with local computer address information with its host name – getByName() • It return InetAddress object of a destination computer containing its address and host name