SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Downloaden Sie, um offline zu lesen
Networking
TCP
      connection-based protocol that provides a
      reliable flow of data between two computers.
      TCP is based on a four-layered model.

                           HTTP, FTP – High level protocol

                           TCP, UDP – Open, maintain connection
                           IP – Transmits packet from one IP add to
                           another
                           IP – Physical equipment such as twisted
                           pair cables
Data transfer
     Ordered data transfer
     Retransmission of lost packets
     Error-free data transfer
     Flow control
     Congestion control
Java provides the java.net package to perform
system-independent network communication
Networking basics
     A computer generally has a single physical
connection available for the network.
Port
       The physical connection is numbered within a range of 0 to
65535, called Ports.
       Ranges from 0 to 1023 are reserved for HTTP, FTP …
       Data transmitted is accompanied with the destination
address and the port number.
URL
      Uniform Resource Locator
      a reference or an address to a resource on
Internet.
      Two parts:
URL
      Resource name contains:
           Host name
           File name
           Port number
What different?
     http://vn.yahoo.com:80/index.html
     http://vn.yahoo.com/index.html
     http://vn.yahoo.com/
URL
       Constructors:
             URL(String url)
             URL(String protocol, String host, String file)
             URL(String protocol, String host, int port,
String file)
             URL(URL baseURL, String relativeURL)
Methods of URL
    public String getHost()
    public String getFile()
    public String getPath()
    public final InputStream openStream()
Methods of InetAddress
     public String getHostAddress()
     public String getHostName()
     public static InetAddress getLocalHost()
     public static InetAddress getByName(String host)
URLConnection
      Abstract class represents the communication link
between an application and a URL.
      Used to read from and to write to the resource
referenced by the URL.
URLConnection
     Cannot instantiate a URLConnection obj directly.
     Create URLConnection obj by method
openConnection() of URL class
           . openConnection()
           . getInputStream()
           . getOutStream()
Socket
     one end-point of a two-way communication link
between two programs running on the network
Socket
    Socket(String host, int port)
          UnknowHostException
          OIException
Socket
    Retrieve the InputStream from the socket
    Retrieve the OutputStream from the socket
    Read from the InputStream
    Write the OutputStream
ServerSocket
        represents the server side.
        If the ServerSocket successful in binding to a
port, I can then wait and listen for client request

      public ServerSocket(int port) throws IOException
ServerSocket
    Steps:
             . Initiate ServerSocket obj
             . accept()
             . OutputStream
             . InputStream
UDP – User Datagram Protocol
       sent message, referred to as datagrams, to other
host
UDP – User Datagram Protocol
     Unreliable
     Not ordered
     Lightweight
     No congestion control
UDP
Time-sensitive applications often use UDP
      VoIp
      Online games
DatagramPacket
    create a datagram packet.
    Constructors:
    DatagramPacket(byte[], int)
    DatagramPacket(byte[], int, InetAddress, int)

          buf, length, address, port
DatagramSocket
      represents a socket for sending and receiving
datagram packets.

      Constructors:
      DatagramSocket(int)
      DatagramSocket(port, InetAddress)
Methods of DatagramSocket
    public void send(DatagramPacket p)
    public void receive(DatagramPacket p)
Methods of DatagramPackets
    public InetAddress getAddress()
    public int getPort()
    public byte[] getData()
    public void setData(byte[] data)
    public void setPort(int port)

Weitere ähnliche Inhalte

Was ist angesagt? (20)

IPC SOCKET
IPC SOCKETIPC SOCKET
IPC SOCKET
 
Networking in Java
Networking in JavaNetworking in Java
Networking in Java
 
Networking
NetworkingNetworking
Networking
 
Networking
NetworkingNetworking
Networking
 
Java networking
Java networkingJava networking
Java networking
 
Java Socket Programming
Java Socket ProgrammingJava Socket Programming
Java Socket Programming
 
Socket programming in Java (PPTX)
Socket programming in Java (PPTX)Socket programming in Java (PPTX)
Socket programming in Java (PPTX)
 
Socket programming-in-python
Socket programming-in-pythonSocket programming-in-python
Socket programming-in-python
 
Python networking
Python networkingPython networking
Python networking
 
Socket programming
Socket programmingSocket programming
Socket programming
 
28 networking
28  networking28  networking
28 networking
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
 
Networking & Socket Programming In Java
Networking & Socket Programming In JavaNetworking & Socket Programming In Java
Networking & Socket Programming In Java
 
Ipc
IpcIpc
Ipc
 
TCPIP
TCPIPTCPIP
TCPIP
 
IP Datagram Structure
IP Datagram StructureIP Datagram Structure
IP Datagram Structure
 
Network Programming in Java
Network Programming in JavaNetwork Programming in Java
Network Programming in Java
 
Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)
 
Java- Datagram Socket class & Datagram Packet class
Java- Datagram Socket class  & Datagram Packet classJava- Datagram Socket class  & Datagram Packet class
Java- Datagram Socket class & Datagram Packet class
 
Session 6
Session 6Session 6
Session 6
 

Andere mochten auch

Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017
Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017
Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017Wenni Meliana
 
ACC 626 - Forensics for IT
ACC 626 - Forensics for ITACC 626 - Forensics for IT
ACC 626 - Forensics for ITj9lai
 
Ne ctar openstack asia 2012 final
Ne ctar openstack asia 2012 finalNe ctar openstack asia 2012 final
Ne ctar openstack asia 2012 finalOpenCity Community
 
تمثيل البيانات بيانياً
تمثيل البيانات بيانياًتمثيل البيانات بيانياً
تمثيل البيانات بيانياًheshmat2010
 
Оскудение речи
Оскудение речиОскудение речи
Оскудение речиninaviktor
 
Con8837 leverage authorization to monetize content and media subscriptions ...
Con8837   leverage authorization to monetize content and media subscriptions ...Con8837   leverage authorization to monetize content and media subscriptions ...
Con8837 leverage authorization to monetize content and media subscriptions ...OracleIDM
 
Infographic - MSP AWS Migration
Infographic - MSP AWS MigrationInfographic - MSP AWS Migration
Infographic - MSP AWS MigrationCopperEgg
 
Plant Healthcare Client Report
Plant Healthcare Client ReportPlant Healthcare Client Report
Plant Healthcare Client Reportdavkearn
 
Englekirk Brochure
Englekirk BrochureEnglekirk Brochure
Englekirk Brochurekimtanouye
 
Gravitas info movie
Gravitas info movieGravitas info movie
Gravitas info movieMark Wagner
 
Track2 -何斌--openstack 在京东的应用实践
Track2 -何斌--openstack 在京东的应用实践Track2 -何斌--openstack 在京东的应用实践
Track2 -何斌--openstack 在京东的应用实践OpenCity Community
 
Caza del tesoro roma
Caza del tesoro romaCaza del tesoro roma
Caza del tesoro romaprofeitaliano
 
Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...
Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...
Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...Antwerp Management School
 
絕了,能把漢字寫成這樣
絕了,能把漢字寫成這樣絕了,能把漢字寫成這樣
絕了,能把漢字寫成這樣Danny Lin
 

Andere mochten auch (20)

Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017
Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017
Sk dirjen pendis nomor 3932 th 2016 madrasah k13 tp 2016 2017
 
ACC 626 - Forensics for IT
ACC 626 - Forensics for ITACC 626 - Forensics for IT
ACC 626 - Forensics for IT
 
Ne ctar openstack asia 2012 final
Ne ctar openstack asia 2012 finalNe ctar openstack asia 2012 final
Ne ctar openstack asia 2012 final
 
DIWALI
DIWALIDIWALI
DIWALI
 
تمثيل البيانات بيانياً
تمثيل البيانات بيانياًتمثيل البيانات بيانياً
تمثيل البيانات بيانياً
 
Оскудение речи
Оскудение речиОскудение речи
Оскудение речи
 
Сезон простуд вебинар2016
Сезон простуд вебинар2016Сезон простуд вебинар2016
Сезон простуд вебинар2016
 
Con8837 leverage authorization to monetize content and media subscriptions ...
Con8837   leverage authorization to monetize content and media subscriptions ...Con8837   leverage authorization to monetize content and media subscriptions ...
Con8837 leverage authorization to monetize content and media subscriptions ...
 
Infographic - MSP AWS Migration
Infographic - MSP AWS MigrationInfographic - MSP AWS Migration
Infographic - MSP AWS Migration
 
Plant Healthcare Client Report
Plant Healthcare Client ReportPlant Healthcare Client Report
Plant Healthcare Client Report
 
Celebrate Alice! 2011
Celebrate Alice! 2011Celebrate Alice! 2011
Celebrate Alice! 2011
 
Tutte le crociate e litanie
Tutte le crociate e litanieTutte le crociate e litanie
Tutte le crociate e litanie
 
Kkk1
Kkk1Kkk1
Kkk1
 
Englekirk Brochure
Englekirk BrochureEnglekirk Brochure
Englekirk Brochure
 
Gravitas info movie
Gravitas info movieGravitas info movie
Gravitas info movie
 
Network Layer
Network LayerNetwork Layer
Network Layer
 
Track2 -何斌--openstack 在京东的应用实践
Track2 -何斌--openstack 在京东的应用实践Track2 -何斌--openstack 在京东的应用实践
Track2 -何斌--openstack 在京东的应用实践
 
Caza del tesoro roma
Caza del tesoro romaCaza del tesoro roma
Caza del tesoro roma
 
Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...
Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...
Leiderschap tonen in duurzame ontwikkeling: hoe haalbaar is het? - Jan Beyne ...
 
絕了,能把漢字寫成這樣
絕了,能把漢字寫成這樣絕了,能把漢字寫成這樣
絕了,能把漢字寫成這樣
 

Ähnlich wie Networking

Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriyaIPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriyaVijiPriya Jeyamani
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagarNitish Nagar
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPTkamal kotecha
 
Socket Programming it-slideshares.blogspot.com
Socket  Programming it-slideshares.blogspot.comSocket  Programming it-slideshares.blogspot.com
Socket Programming it-slideshares.blogspot.comphanleson
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programmingelliando dias
 
Socket Programming
Socket  ProgrammingSocket  Programming
Socket Programmingleminhvuong
 
The Internet and World Wide Web
The Internet and World Wide WebThe Internet and World Wide Web
The Internet and World Wide Webwebhostingguy
 
Socket.io v.0.8.3
Socket.io v.0.8.3Socket.io v.0.8.3
Socket.io v.0.8.3Cleveroad
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project ReportKavita Sharma
 

Ähnlich wie Networking (20)

Unit 8 Java
Unit 8 JavaUnit 8 Java
Unit 8 Java
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Lecture25
Lecture25Lecture25
Lecture25
 
Sockets
SocketsSockets
Sockets
 
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriyaIPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
IPT Chapter 2 Web Services and Middleware - Dr. J. VijiPriya
 
Socket Programming - nitish nagar
Socket Programming - nitish nagarSocket Programming - nitish nagar
Socket Programming - nitish nagar
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Tcp/ip server sockets
Tcp/ip server socketsTcp/ip server sockets
Tcp/ip server sockets
 
Socket Programming it-slideshares.blogspot.com
Socket  Programming it-slideshares.blogspot.comSocket  Programming it-slideshares.blogspot.com
Socket Programming it-slideshares.blogspot.com
 
Os 2
Os 2Os 2
Os 2
 
Java networking
Java networkingJava networking
Java networking
 
Sockets
Sockets Sockets
Sockets
 
Java 1
Java 1Java 1
Java 1
 
Application Layer and Socket Programming
Application Layer and Socket ProgrammingApplication Layer and Socket Programming
Application Layer and Socket Programming
 
Socket Programming
Socket  ProgrammingSocket  Programming
Socket Programming
 
The Internet and World Wide Web
The Internet and World Wide WebThe Internet and World Wide Web
The Internet and World Wide Web
 
Socket.io v.0.8.3
Socket.io v.0.8.3Socket.io v.0.8.3
Socket.io v.0.8.3
 
Socket.io v.0.8.3
Socket.io v.0.8.3Socket.io v.0.8.3
Socket.io v.0.8.3
 
Mail Server Project Report
Mail Server Project ReportMail Server Project Report
Mail Server Project Report
 

Mehr von Tuan Ngo

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enTuan Ngo
 
Net framework
Net frameworkNet framework
Net frameworkTuan Ngo
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable typesTuan Ngo
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iteratorsTuan Ngo
 
13 collections
13   collections13   collections
13 collectionsTuan Ngo
 
11 exception handling
11   exception handling11   exception handling
11 exception handlingTuan Ngo
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegatesTuan Ngo
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexersTuan Ngo
 
10 namespace
10  namespace10  namespace
10 namespaceTuan Ngo
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces Tuan Ngo
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphismTuan Ngo
 
6 class and methods
6    class and methods6    class and methods
6 class and methodsTuan Ngo
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operatorsTuan Ngo
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructsTuan Ngo
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#Tuan Ngo
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data typesTuan Ngo
 

Mehr von Tuan Ngo (20)

Introduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 enIntroduction of cg program for portal 20120424 en
Introduction of cg program for portal 20120424 en
 
Net framework
Net frameworkNet framework
Net framework
 
15 anonymous methods, partial types and nullable types
15   anonymous methods, partial types and nullable types15   anonymous methods, partial types and nullable types
15 anonymous methods, partial types and nullable types
 
14 generics and iterators
14   generics and iterators14   generics and iterators
14 generics and iterators
 
13 collections
13   collections13   collections
13 collections
 
11 exception handling
11   exception handling11   exception handling
11 exception handling
 
12 events and delegates
12   events and delegates12   events and delegates
12 events and delegates
 
9 properties & indexers
9   properties & indexers9   properties & indexers
9 properties & indexers
 
10 namespace
10  namespace10  namespace
10 namespace
 
8 abstract classes and interfaces
8   abstract classes and interfaces 8   abstract classes and interfaces
8 abstract classes and interfaces
 
7 inheritance and polymorphism
7   inheritance and polymorphism7   inheritance and polymorphism
7 inheritance and polymorphism
 
5 arrays
5   arrays5   arrays
5 arrays
 
6 class and methods
6    class and methods6    class and methods
6 class and methods
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operators
 
4 c# programming constructs
4   c# programming constructs4   c# programming constructs
4 c# programming constructs
 
1 get started with c#
1   get started with c#1   get started with c#
1 get started with c#
 
2 variables and data types
2   variables and data types2   variables and data types
2 variables and data types
 
Jdbc 7
Jdbc 7Jdbc 7
Jdbc 7
 
Jdbc 6
Jdbc 6Jdbc 6
Jdbc 6
 
Jdbc 3
Jdbc 3Jdbc 3
Jdbc 3
 

Kürzlich hochgeladen

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Kürzlich hochgeladen (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Networking

  • 2. TCP connection-based protocol that provides a reliable flow of data between two computers. TCP is based on a four-layered model. HTTP, FTP – High level protocol TCP, UDP – Open, maintain connection IP – Transmits packet from one IP add to another IP – Physical equipment such as twisted pair cables
  • 3. Data transfer Ordered data transfer Retransmission of lost packets Error-free data transfer Flow control Congestion control
  • 4. Java provides the java.net package to perform system-independent network communication
  • 5. Networking basics A computer generally has a single physical connection available for the network.
  • 6. Port The physical connection is numbered within a range of 0 to 65535, called Ports. Ranges from 0 to 1023 are reserved for HTTP, FTP … Data transmitted is accompanied with the destination address and the port number.
  • 7. URL Uniform Resource Locator a reference or an address to a resource on Internet. Two parts:
  • 8. URL Resource name contains: Host name File name Port number
  • 9. What different? http://vn.yahoo.com:80/index.html http://vn.yahoo.com/index.html http://vn.yahoo.com/
  • 10. URL Constructors: URL(String url) URL(String protocol, String host, String file) URL(String protocol, String host, int port, String file) URL(URL baseURL, String relativeURL)
  • 11. Methods of URL public String getHost() public String getFile() public String getPath() public final InputStream openStream()
  • 12. Methods of InetAddress public String getHostAddress() public String getHostName() public static InetAddress getLocalHost() public static InetAddress getByName(String host)
  • 13. URLConnection Abstract class represents the communication link between an application and a URL. Used to read from and to write to the resource referenced by the URL.
  • 14. URLConnection Cannot instantiate a URLConnection obj directly. Create URLConnection obj by method openConnection() of URL class . openConnection() . getInputStream() . getOutStream()
  • 15. Socket one end-point of a two-way communication link between two programs running on the network
  • 16. Socket Socket(String host, int port) UnknowHostException OIException
  • 17. Socket Retrieve the InputStream from the socket Retrieve the OutputStream from the socket Read from the InputStream Write the OutputStream
  • 18. ServerSocket represents the server side. If the ServerSocket successful in binding to a port, I can then wait and listen for client request public ServerSocket(int port) throws IOException
  • 19. ServerSocket Steps: . Initiate ServerSocket obj . accept() . OutputStream . InputStream
  • 20. UDP – User Datagram Protocol sent message, referred to as datagrams, to other host
  • 21. UDP – User Datagram Protocol Unreliable Not ordered Lightweight No congestion control
  • 22. UDP Time-sensitive applications often use UDP VoIp Online games
  • 23. DatagramPacket create a datagram packet. Constructors: DatagramPacket(byte[], int) DatagramPacket(byte[], int, InetAddress, int) buf, length, address, port
  • 24. DatagramSocket represents a socket for sending and receiving datagram packets. Constructors: DatagramSocket(int) DatagramSocket(port, InetAddress)
  • 25. Methods of DatagramSocket public void send(DatagramPacket p) public void receive(DatagramPacket p)
  • 26. Methods of DatagramPackets public InetAddress getAddress() public int getPort() public byte[] getData() public void setData(byte[] data) public void setPort(int port)