SlideShare a Scribd company logo
1 of 45
Download to read offline
CHAPTER 1 :
Network Theory & Java Overview
By :
Mr. Asyran Zarizi Bin Abdullah
Objective
The end of this course you be able to :
1) Understand about network environment
2) Knowing the TCP/IP & OSI layer
3) Understand about security issues in
network.
At the end of this course…..
I UNDERSTAND SIR !
BLURR………!!
What is a NETWORK ?
Before that we must know how
communication in previous time
• Burung merpati
• Api asap
“Networking is a concept of connecting two or
more computing devices together so that we
can share resources like printer, scanner,
memory”
How network communicate?
• Connect, share and transferring data from
1point to another point.
• LAN – MAN - WAN
• Wired and Wireless
• P2P and Client server
Network Communication
• Using 2 network model.
a) OSI Model
b) TCP/IP Model
OSI Model
OSI MODEL
TCP/IP Model
TCP/IP Model
Application layer is responsible for performing
encoding, encryption etc.
Transport layer provide service of courier. In
real life whenever we want to send a packet to
another place, we go to courier shop and give
them packet with address. Transport layer is
the courier for communication.
Internet layer determine the path how to
route the packet to target destination. In
above example once packet is given to courier
company, then on wards courier send that
packet through some transport ( car, bus or
truck). Now driver has to decide which way to
go in order to reach destination. So internet
layer perform that work.
Protocol and Port Number
• Represent as a logical/virtual door for
incoming and outgoing packet
• Basically an application or service will bind
with 1 port for its usage.
• There are 65,535 port available in any
computers
– 1 – 1023 are reserved for System Operations
– 1024 – 65,535 are available for others
Protocol and Port Number
• Port number: It is unique identification value
represents residing position of a server in the
computer. It is four digit +ve number.
• Default port number for major protocol that is
useful to know
– Port 80
– Port 21/22
– Port 433
– Port 23
– Port 25
Protocol and Port Name
• Port Name: It is a valid user defined name to
know about client system, the default port name
for any local computer is localhost.
• Default port for major protocol that is useful to
know
– Port 80 = Http
– Port 21/22 = FTP
– Port 433 = Https
– Port 23 = Telnet
– Port 25 = SMTP
Firewall
• Firewall can be either software or hardware
to filter incoming and outgoing transmission
for access.
• Firewall is a network access control device
that is designed to deny all traffic except that
which is explicitly allowed.
Internet
(Untrusted)
Attack
Packet
Log File
Attacker
Internet
Border
FirewallHardene
d Server
Hardened
Client PC
Passed Packet
(Ingress)
Dropped Packet
(Ingress)
Passed Packet
(Egress)
Internal Corporate
Network (Trusted)
Proxy
• Proxy Server is a middle man between a client
computer and the network (usually internet)
which has the function to disguise
transmission from client
What is a SOCKET ?
Socket is a mechanisms of communication that use to exchange data
with program in same machine or different machine
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
SOCKET = IP Add + Port No
Socket Operation
• Socket can do some operation below :
1) Send data
2) Receive data
3) Close connection
4) Listen on input data
5) Connection to remote machine
6) Connect from remote machine on specific port
Network Socket Program
• A network program can send and receive
information/data.
• General technology that use by network
program is
a) Chat Application
b) Multiplayer Games
c) Peer‐to‐peer Application
Socket Element
1) Protocol
2) Local IP (Private IP)
3) Local Port
4) Remote IP
5) Remote Port
IP Protocol Suite
Socket to Socket Communication
Socket Type
• 2 type of socket that usually use :
1) Socket Local = AF_UNIX
2) Socket Networking = AF_INET
• Socket Stream = SOCK_STREAM
• Socket Datagram = SOCK_DGRAM
Example :
Socket Network Socket Datagram Protocol
JAVA Overview
JAVA Overview
• JAVA is a programming language created by Sun Microsystem to
fully utilized Object Oriented Programming in software
development. Currently this language intellectual property (IP) is
owned by Oracle
• It require Java Development Kit (JDK) to be installed before
development could be started.
• As a developer, text editor could be used to form the source code or
any IDE that support JAVA can be a very good choice
– Eclipse
– Jcreator
– NetBeans
• Java support Network programming by certain network library
which simplified a lot of development compared to C++.
Overview
• In Networking application mainly two
programs are running one is Client program
and another is Server program.
• In Core java Client program can be design
using Socket class and Server program can be
design using ServerSocket class.
• Both Socket and ServerSocket classes are
predefined in java.net package
Java Packages
• Java.net = TCP/IP networking
• Java.io = I/O Streams & Utilities
• Java.rmi = Remote Invocation
• Java.security = Security Policies
• Java.lang = Threading classes
*java.net.ServerSocket = use for Server Connection
*java.net.Socekt = use for Client Connection
JAVA API
• Socket programming use Java API component to
develop socket programming application.
• Java API is a group of library that use for develop
programed.
• J2SE was ready with java.net package that contain
classes and interface that provide API
(Application Programming Interface)
– Low level (Socket, ServerSocket, DatagramSocket)
– High Level (URL, URLConnection)
Connection-Oriented &
Connectionless Socket
• A socket programming construct can make use
of either the UDP (User Datagram Protocol) or
TCP (Transmission Control Protocol).
• Sockets that use UDP for transport are known
as datagram sockets, while sockets that use
TCP are termed stream sockets.
UDP & TCP
• UDP = User Datagram Protocol ,
• TCP = Transmission Control Protocol.
TCP Sockets
• Java.net.ServerSocket class
– Use for server program
– Local port to listen for initial connection
– Can be bound to local IP for multi-homed
machines
• Java.net.Socket class
– Use for client program
– Combines socket with socket option (timeout,
linger, keep alive, no delay)
UDP Sockets
• Java.net.DatagramSocket class
– Java makes no distinction between client/server
for UDP sockets.
– Can be bound to both a local port & local IP
address
Issues in JAVA language
• Java Network Programming will exhibit this
issues. Some of them are:-
a) Unable to access with low level network device
b) Network security issues
• Firewall preventing access for your application
• Proxy may interfere with the inert function of your
application
Sample of Java Program
Sample of Java Program
•To be continue….

More Related Content

What's hot

Advance Java-Network Programming
Advance Java-Network ProgrammingAdvance Java-Network Programming
Advance Java-Network Programmingashok hirpara
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theoryMukesh Tekwani
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket ProgrammingMousmi Pawar
 
Socket programming or network programming
Socket programming or network programmingSocket programming or network programming
Socket programming or network programmingMmanan91
 
A Short Java Socket Tutorial
A Short Java Socket TutorialA Short Java Socket Tutorial
A Short Java Socket TutorialGuo Albert
 
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 classRuchi Maurya
 
Python Sockets
Python SocketsPython Sockets
Python Socketspythontic
 
Socket programming-in-python
Socket programming-in-pythonSocket programming-in-python
Socket programming-in-pythonYuvaraja Ravi
 
Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket basedMukesh Tekwani
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in JavaTushar B Kute
 
Basic Networking in Java
Basic Networking in JavaBasic Networking in Java
Basic Networking in Javasuraj pandey
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPTkamal kotecha
 

What's hot (20)

Java socket programming
Java socket programmingJava socket programming
Java socket programming
 
Advance Java-Network Programming
Advance Java-Network ProgrammingAdvance Java-Network Programming
Advance Java-Network Programming
 
Tcp/ip server sockets
Tcp/ip server socketsTcp/ip server sockets
Tcp/ip server sockets
 
Java networking programs - theory
Java networking programs - theoryJava networking programs - theory
Java networking programs - theory
 
Networking in java
Networking in javaNetworking in java
Networking in java
 
java networking
 java networking java networking
java networking
 
Networking Java Socket Programming
Networking Java Socket ProgrammingNetworking Java Socket Programming
Networking Java Socket Programming
 
Socket programming or network programming
Socket programming or network programmingSocket programming or network programming
Socket programming or network programming
 
A Short Java Socket Tutorial
A Short Java Socket TutorialA Short Java Socket Tutorial
A Short Java Socket Tutorial
 
Java Networking
Java NetworkingJava Networking
Java Networking
 
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
 
Python Sockets
Python SocketsPython Sockets
Python Sockets
 
Socket programming-in-python
Socket programming-in-pythonSocket programming-in-python
Socket programming-in-python
 
Sockets
SocketsSockets
Sockets
 
Java 1
Java 1Java 1
Java 1
 
Java networking programs socket based
Java networking programs socket basedJava networking programs socket based
Java networking programs socket based
 
Network programming in Java
Network programming in JavaNetwork programming in Java
Network programming in Java
 
Basic Networking in Java
Basic Networking in JavaBasic Networking in Java
Basic Networking in Java
 
Network programming in java - PPT
Network programming in java - PPTNetwork programming in java - PPT
Network programming in java - PPT
 
Java networking
Java networkingJava networking
Java networking
 

Similar to Chap 1 Network Theory & Java Overview

chapter-4-networking hjgjjgj did hfhhfhj
chapter-4-networking hjgjjgj did hfhhfhjchapter-4-networking hjgjjgj did hfhhfhj
chapter-4-networking hjgjjgj did hfhhfhjAmitDeshai
 
WIFI MODEM Part-22
WIFI MODEM Part-22WIFI MODEM Part-22
WIFI MODEM Part-22Techvilla
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration TestingMohammed Adam
 
98 366 mva slides lesson 8
98 366 mva slides lesson 898 366 mva slides lesson 8
98 366 mva slides lesson 8suddenven
 
Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxByte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxRockyBhai46825
 
OOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptxOOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptxTanzila Kehkashan
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshopNitesh Malviya
 
Network protocols and Java programming
Network protocols and Java programmingNetwork protocols and Java programming
Network protocols and Java programmingdifatta
 
Lecture Notes- Network Services - Copy.pptx
Lecture Notes- Network Services - Copy.pptxLecture Notes- Network Services - Copy.pptx
Lecture Notes- Network Services - Copy.pptxSaqibAhmedKhan4
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process CommunicationAbhishek Sagar
 
Security defined routing_cybergamut_v1_1
Security defined routing_cybergamut_v1_1Security defined routing_cybergamut_v1_1
Security defined routing_cybergamut_v1_1Joel W. King
 
Basic Foundation For Cybersecurity
Basic Foundation For CybersecurityBasic Foundation For Cybersecurity
Basic Foundation For CybersecurityMohammed Adam
 
Cisco Certified Network Associate
Cisco Certified Network AssociateCisco Certified Network Associate
Cisco Certified Network AssociateSumit K Das
 

Similar to Chap 1 Network Theory & Java Overview (20)

chapter-4-networking hjgjjgj did hfhhfhj
chapter-4-networking hjgjjgj did hfhhfhjchapter-4-networking hjgjjgj did hfhhfhj
chapter-4-networking hjgjjgj did hfhhfhj
 
Ports and protocols
Ports and protocolsPorts and protocols
Ports and protocols
 
WIFI MODEM Part-22
WIFI MODEM Part-22WIFI MODEM Part-22
WIFI MODEM Part-22
 
Basic network training2
Basic network training2Basic network training2
Basic network training2
 
Network Penetration Testing
Network Penetration TestingNetwork Penetration Testing
Network Penetration Testing
 
98 366 mva slides lesson 8
98 366 mva slides lesson 898 366 mva slides lesson 8
98 366 mva slides lesson 8
 
MVA slides lesson 8
MVA slides lesson 8MVA slides lesson 8
MVA slides lesson 8
 
Byte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptxByte Ordering - Unit 2.pptx
Byte Ordering - Unit 2.pptx
 
28 networking
28  networking28  networking
28 networking
 
Application Protocol
Application Protocol Application Protocol
Application Protocol
 
OOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptxOOP Lecture 24-Network Programming-Part1.pptx
OOP Lecture 24-Network Programming-Part1.pptx
 
Null mumbai-iot-workshop
Null mumbai-iot-workshopNull mumbai-iot-workshop
Null mumbai-iot-workshop
 
Network protocols and Java programming
Network protocols and Java programmingNetwork protocols and Java programming
Network protocols and Java programming
 
Lecture Notes- Network Services - Copy.pptx
Lecture Notes- Network Services - Copy.pptxLecture Notes- Network Services - Copy.pptx
Lecture Notes- Network Services - Copy.pptx
 
Java
Java Java
Java
 
IP Security
IP SecurityIP Security
IP Security
 
Linux Inter Process Communication
Linux Inter Process CommunicationLinux Inter Process Communication
Linux Inter Process Communication
 
Security defined routing_cybergamut_v1_1
Security defined routing_cybergamut_v1_1Security defined routing_cybergamut_v1_1
Security defined routing_cybergamut_v1_1
 
Basic Foundation For Cybersecurity
Basic Foundation For CybersecurityBasic Foundation For Cybersecurity
Basic Foundation For Cybersecurity
 
Cisco Certified Network Associate
Cisco Certified Network AssociateCisco Certified Network Associate
Cisco Certified Network Associate
 

Recently uploaded

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 

Recently uploaded (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 

Chap 1 Network Theory & Java Overview

  • 1. CHAPTER 1 : Network Theory & Java Overview By : Mr. Asyran Zarizi Bin Abdullah
  • 2. Objective The end of this course you be able to : 1) Understand about network environment 2) Knowing the TCP/IP & OSI layer 3) Understand about security issues in network.
  • 3. At the end of this course…..
  • 6. What is a NETWORK ?
  • 7. Before that we must know how communication in previous time
  • 10.
  • 11. “Networking is a concept of connecting two or more computing devices together so that we can share resources like printer, scanner, memory”
  • 12. How network communicate? • Connect, share and transferring data from 1point to another point. • LAN – MAN - WAN • Wired and Wireless • P2P and Client server
  • 13. Network Communication • Using 2 network model. a) OSI Model b) TCP/IP Model
  • 17. TCP/IP Model Application layer is responsible for performing encoding, encryption etc. Transport layer provide service of courier. In real life whenever we want to send a packet to another place, we go to courier shop and give them packet with address. Transport layer is the courier for communication. Internet layer determine the path how to route the packet to target destination. In above example once packet is given to courier company, then on wards courier send that packet through some transport ( car, bus or truck). Now driver has to decide which way to go in order to reach destination. So internet layer perform that work.
  • 18. Protocol and Port Number • Represent as a logical/virtual door for incoming and outgoing packet • Basically an application or service will bind with 1 port for its usage. • There are 65,535 port available in any computers – 1 – 1023 are reserved for System Operations – 1024 – 65,535 are available for others
  • 19. Protocol and Port Number • Port number: It is unique identification value represents residing position of a server in the computer. It is four digit +ve number. • Default port number for major protocol that is useful to know – Port 80 – Port 21/22 – Port 433 – Port 23 – Port 25
  • 20. Protocol and Port Name • Port Name: It is a valid user defined name to know about client system, the default port name for any local computer is localhost. • Default port for major protocol that is useful to know – Port 80 = Http – Port 21/22 = FTP – Port 433 = Https – Port 23 = Telnet – Port 25 = SMTP
  • 21. Firewall • Firewall can be either software or hardware to filter incoming and outgoing transmission for access. • Firewall is a network access control device that is designed to deny all traffic except that which is explicitly allowed.
  • 22. Internet (Untrusted) Attack Packet Log File Attacker Internet Border FirewallHardene d Server Hardened Client PC Passed Packet (Ingress) Dropped Packet (Ingress) Passed Packet (Egress) Internal Corporate Network (Trusted)
  • 23. Proxy • Proxy Server is a middle man between a client computer and the network (usually internet) which has the function to disguise transmission from client
  • 24. What is a SOCKET ? Socket is a mechanisms of communication that use to exchange data with program in same machine or different machine
  • 25. 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
  • 26. SOCKET = IP Add + Port No
  • 27. Socket Operation • Socket can do some operation below : 1) Send data 2) Receive data 3) Close connection 4) Listen on input data 5) Connection to remote machine 6) Connect from remote machine on specific port
  • 28. Network Socket Program • A network program can send and receive information/data. • General technology that use by network program is a) Chat Application b) Multiplayer Games c) Peer‐to‐peer Application
  • 29. Socket Element 1) Protocol 2) Local IP (Private IP) 3) Local Port 4) Remote IP 5) Remote Port
  • 31. Socket to Socket Communication
  • 32. Socket Type • 2 type of socket that usually use : 1) Socket Local = AF_UNIX 2) Socket Networking = AF_INET • Socket Stream = SOCK_STREAM • Socket Datagram = SOCK_DGRAM Example : Socket Network Socket Datagram Protocol
  • 34. JAVA Overview • JAVA is a programming language created by Sun Microsystem to fully utilized Object Oriented Programming in software development. Currently this language intellectual property (IP) is owned by Oracle • It require Java Development Kit (JDK) to be installed before development could be started. • As a developer, text editor could be used to form the source code or any IDE that support JAVA can be a very good choice – Eclipse – Jcreator – NetBeans • Java support Network programming by certain network library which simplified a lot of development compared to C++.
  • 35. Overview • In Networking application mainly two programs are running one is Client program and another is Server program. • In Core java Client program can be design using Socket class and Server program can be design using ServerSocket class. • Both Socket and ServerSocket classes are predefined in java.net package
  • 36. Java Packages • Java.net = TCP/IP networking • Java.io = I/O Streams & Utilities • Java.rmi = Remote Invocation • Java.security = Security Policies • Java.lang = Threading classes *java.net.ServerSocket = use for Server Connection *java.net.Socekt = use for Client Connection
  • 37. JAVA API • Socket programming use Java API component to develop socket programming application. • Java API is a group of library that use for develop programed. • J2SE was ready with java.net package that contain classes and interface that provide API (Application Programming Interface) – Low level (Socket, ServerSocket, DatagramSocket) – High Level (URL, URLConnection)
  • 38. Connection-Oriented & Connectionless Socket • A socket programming construct can make use of either the UDP (User Datagram Protocol) or TCP (Transmission Control Protocol). • Sockets that use UDP for transport are known as datagram sockets, while sockets that use TCP are termed stream sockets.
  • 39. UDP & TCP • UDP = User Datagram Protocol , • TCP = Transmission Control Protocol.
  • 40. TCP Sockets • Java.net.ServerSocket class – Use for server program – Local port to listen for initial connection – Can be bound to local IP for multi-homed machines • Java.net.Socket class – Use for client program – Combines socket with socket option (timeout, linger, keep alive, no delay)
  • 41. UDP Sockets • Java.net.DatagramSocket class – Java makes no distinction between client/server for UDP sockets. – Can be bound to both a local port & local IP address
  • 42. Issues in JAVA language • Java Network Programming will exhibit this issues. Some of them are:- a) Unable to access with low level network device b) Network security issues • Firewall preventing access for your application • Proxy may interfere with the inert function of your application
  • 43. Sample of Java Program
  • 44. Sample of Java Program