SlideShare a Scribd company logo
1 of 29
Download to read offline
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

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

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

Ip address
Ip addressIp address
Ip address
 
4. Understanding Internet Protocol.pptx
4. Understanding Internet Protocol.pptx4. Understanding Internet Protocol.pptx
4. Understanding Internet Protocol.pptx
 
MVA slides lesson 4
MVA slides lesson 4MVA slides lesson 4
MVA slides lesson 4
 
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

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 

Recently uploaded (20)

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 

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