Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Slides Java Networking With Channels Reactive Programming and Virtual Threads Networking Terminology

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Slides Java Networking With Channels Reactive Programming and Virtual Threads Networking Terminology

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

What Is Networking?

Networking is the foundation of modern communications.


A network is a system of computers and other devices connected together, so that
they communicate with each other, to exchange data and share resources.
Networking refers to how the connected computers communicate.
This can be done over the internet, or over a local area network, which is just a
collection of devices, connected together in one physical location.

COMPLETE JAVA MASTERCLASS


Networking Terminology
Why is networking important in software
development?
Important reasons for networking:
• Data Communication, allowing applications to exchange data in real-time,
between users and systems.
• Distributed Systems, allowing applications to be deployed across many servers.
• Foundational for Internet and Cloud Computing.
• Enables Remote Access, and Control, to distributed systems.
• Enables communication between applications, through the use of APIs and Web
Services.

COMPLETE JAVA MASTERCLASS


Networking Terminology
Private Network (Intranet)

Computers may also communicate across a private network, also known as an


intranet.
In fact, that's where networking actually began, and intranets are still common
today in business.

COMPLETE JAVA MASTERCLASS


Networking Terminology
The Host

A host refers to any hardware device capable of participating in network


communication.
A common networking configuration that you've probably heard of is client server.
This means that one or more hosts on the network are acting as servers, and the
other hosts are clients that connect to the server.

COMPLETE JAVA MASTERCLASS


Networking Terminology
What's a client?

Clients are end-user devices or applications, that request services or resources from
servers.
They initiate communication with the servers, and rely on them, to fulfill specific
requests.

COMPLETE JAVA MASTERCLASS


Networking Terminology
What's a server?

Servers are usually powerful computers or software applications, that provide


services or resources to clients.
They listen for incoming requests from clients, process those requests, and respond
with the appropriate data or action.

COMPLETE JAVA MASTERCLASS


Networking Terminology
What's a client-server model?

Communication between the user's devices, and servers responding to their


requests, is called the client-server model.
This is a very common networking model, used in many different applications,
including web applications, email, file sharing and gaming.
Web browsing is a classic example, where the web browser (the client) sends
requests to web servers, and the servers respond by sending back web pages,
images, or other resources.

COMPLETE JAVA MASTERCLASS


Networking Terminology
Client-server applications can run on a single host

As I mentioned, you can have a client server interaction on the same host.
For example, the MySQL database comes with software we've been using called
MySQL Workbench.
The workbench is the client, and it connects to the MySQL database server on that
local host.
It could also connect remotely to another server if needed as well.

COMPLETE JAVA MASTERCLASS


Networking Terminology
How do the client and server communicate?

Clients and Servers communicate through several layers of protocols.


The lowest level is the network layer, which uses addresses to facilitate network
communication.
On top of this, is the data transport layer.

COMPLETE JAVA MASTERCLASS


Networking Terminology
The Port

When data arrives at the one physical connection to the network, it gets routed to
the target application through a port.
Each application that needs data from the network is assigned a port.
This includes clients connecting to a server, that's on the same machine.
When data arrives, the port number is used to route the data, for the specific
application that's waiting for it.
A port number is a positive integer between 0 and 65535.

COMPLETE JAVA MASTERCLASS


Networking Terminology
The IP Address

Every host connected to the Internet also has a unique IP address, including yours.
IP stands for Internet Protocol.
This describes the destination, or where the data is supposed to go in the network,
and it does it with an IP address.

COMPLETE JAVA MASTERCLASS


Networking Terminology
IPv4 vs. IPv6

IPv4 stands for Internet Protocol Version 4, and IPv6 stands for Internet Protocol
Version 6.
Once upon a time, there were only IPv4 addresses.
IPv4 uses a 32-bit address scheme, that allows for over 4 billion unique addresses.
Now that we've got computers, tablets, game consoles, smart TVs, smartphones,
smart appliances, four billion IP addresses wasn't really enough, and so IPv6 was
born.

COMPLETE JAVA MASTERCLASS


Networking Terminology
IPv6

IPv6 uses a 128-bit address scheme, which allows for many more IP addresses, than
IPv4 does.
Many Internet Service Providers, provide both IPv4 and IPv6 addresses to their
customers.
This ensures compatibility with older and newer technologies.
For example, new routers support IPv6, but if you're hanging onto an older router, it
may not. Or your ISP may only provide IPv4 addresses. Or you just have it
configured that way. As is the case for me, here.

COMPLETE JAVA MASTERCLASS


Networking Terminology
How do the client and server communicate?
The data transfer layer provides different protocols for transferring data.
In this section, I'll cover the TCP and UDP protocols.
These two protocols are still widely used by client server applications.
Feature Transmission Control Protocol (TCP) - 1974 User Datagram Protocol (UDP) - 1980
Connection Type Connection-oriented Connectionless

Reliability Highly reliable Unreliable

Category Stream of Data Datagram (or Data Packet)

Error Checking Yes No

Overhead Higher Lower

Speed Slower Faster

online gaming, streaming media, voice/video


Use Cases Web browsing, email, file transfer
over IP, real-time data feeds

COMPLETE JAVA MASTERCLASS


Networking Terminology
TCP/IP

TCP IP describes both the networking and data transport layers used.
It refers to using the TCP protocol for transferring data, over a network of IP
addresses.
Two applications running on the same host can still use TCP IP to communicate with
each other.
When the client and server are on the same host, usually the IP address, 127.0.0.1,
which is also referred to as the local host, is used to identify the host.

COMPLETE JAVA MASTERCLASS


Networking Terminology
Networking packages

Java Networking types can be split roughly


into two groups, low level APIs, which
work with sockets and network addresses,
and high level API types, that abstract
connectivity, with the use of such types as
URLs, Http Connections, and Http Clients.
In addition, the java.nio package offers an
alternative communication mechanism, in
the form of channels.
When using the low level API, you have to
be more aware of networking concepts.

COMPLETE JAVA MASTERCLASS


Networking Terminology
Sockets

When using the low level networking API, you'll use sockets to establish
connections, send requests, and receive responses.
A socket is one end point of the two-way connection.
The client will have a socket, and the server will also have a socket.
When you have multiple clients connecting to the same server, they'll use the same
port, but each client will have its own socket.
You'll use the Socket class for the client socket, and the ServerSocket class for the
server socket.

COMPLETE JAVA MASTERCLASS


Networking Terminology
Overview

Since we're talking about networking, we're going to have to write two applications
to demonstrate how to do networking coding.
One application will be the server, and the other will be the client.

COMPLETE JAVA MASTERCLASS


Networking Terminology

You might also like