0% found this document useful (0 votes)
26 views30 pages

Basic Concept of Networking

Distributed programming allows programs to be executed across multiple computers connected through a network. It involves basic networking concepts like local area networks (LANs) and wide area networks (WANs) that connect computers within an organization or across large geographical areas. Multithreading is a technique where multiple threads can exist within one process to allow concurrent execution of tasks to improve responsiveness and make use of multicore systems. Common applications that use multithreading include those with graphical user interfaces (GUIs) and network-based programs that need to handle incoming data asynchronously.

Uploaded by

tikowanaasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views30 pages

Basic Concept of Networking

Distributed programming allows programs to be executed across multiple computers connected through a network. It involves basic networking concepts like local area networks (LANs) and wide area networks (WANs) that connect computers within an organization or across large geographical areas. Multithreading is a technique where multiple threads can exist within one process to allow concurrent execution of tasks to improve responsiveness and make use of multicore systems. Common applications that use multithreading include those with graphical user interfaces (GUIs) and network-based programs that need to handle incoming data asynchronously.

Uploaded by

tikowanaasu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Distributed Programming

Basic concept of networking

Week 4

Program Studi Teknik Informatika


Fakultas Teknik – Universitas Surabaya
What is Networking??

• growth of number & power of computers is driving


need for interconnection
• also seeing rapid integration of voice, data, image &
video technologies
• two broad categories of communications networks:
– Local Area Network (LAN)
– Wide Area Network (WAN)
Wide Area Networks
• span a large geographical area
• cross public rights of way
• rely in part on common carrier circuits
• alternative technologies used include:
– circuit switching
– packet switching
– frame relay
– Asynchronous Transfer Mode (ATM)
Local Area Networks

• smaller scope
– Building or small campus
• usually owned by same organization as attached devices
• data rates much higher
• switched LANs, eg Ethernet
• wireless LANs
The Internet

• Internet evolved from ARPANET


– first operational packet network
– applied to tactical radio & satellite nets also
– had a need for interoperability
– led to standardized TCP/IP protocols
Internet Work
Web Servers & Web
Browsers
http://www.google.comlsearch?q=lyu
www.google.com

Browsers
Web servers

www.uu.se Internet
http://www.uu.se/

www.w3c.org

File system of http://www.w3c.org/Protocols/Activity.html


www.w3c.org Protocols

Activity.html
7
OSI LAYER
1

Simple Client-Server
TCP and UDP
TCP (Connection-Oriented)
TCP Connection Establishment – solution
three way handshake

6-
31

(a)TCP connection establishment in the normal


case.
(b) Call collision.
TCP Connection Release –
design options and issue (1)
■ Two release method: asymmetric and
symmetric

■ Asymmetric release issue: possibility of


losing data
TCP Connection Release –
design options and issue (2)

■ Twoarmy issue
□No protocol can work
□One side should always take more risk
TCP Connection Release – solution
•Three way handshake + timeout
• Host 1 Host
2

• Start Timer Start Timer


TCP Flow Control – design
issue Speed of data sending is critical

□ □ Too slow – type example


Too fast:
■ network congestion or ■ waste of network

■ receiving side overload resource or receiving


memory
TCP application examples
■ When to use TCP:
□When an application need a reliable transport

■ Examples
□ File Transfer Protocol : FTP (21)
□ Secure Shell: SSH (22)
□ Teletype Network: TELNET (23)
□ Simple Mail Transfer Protocol: SMTP (25)
□ Hypertext Transfer Protocol: HTTP (80)
UDP (Connection-less)
UDP Properties
■ UDP provides an unreliable datagram service
□Packets may be lost or delivered out of order
□Message split into datagrams, user sends datagrams
as packets on network layer
□No buffer at either sending or receiving side
□Unreliable but fast
□Full duplex
□Application must deal with lost packets
UDP Application Examples
■ When to use UDP
□ Reduce the requirement of computer resources
□ The checking scheme has provided completely by the application
program
□ When using the Multicast or Broadcast to transfer
□ The transmission of Real-time packets
■ Examples
□ Trivial File Transfer Protocol , TFTP
□ Simple Network Management Protocol , SNMP
□ Dynamic Host Configuration Protocol , DHCP
□ Domain Name System , DNS
TCP vs. UDP

TCP UDP
connection-oriented connectionless
confirmed service unconfirmed service

(header 20 bytes) (header 8 bytes)


flow control no flow control
Multithreading
What is
Multithreading?
Multithreading is similar to multi-processing.

A multi-processing Operating System can run


several processes at the same time
Each process has its own address/memory space
The OS's scheduler decides when each process
is executed
Only one process is actually executing at any
given time. However, the system appears to be
running several programs simultaneously
What is
Multithreading?
Separate processes to not have access to each
other's memory space
Many OSes have a shared memory system so
that processes can share memory space

• In a multithreaded application, there are several


points of execution within the same memory
space.
• Each point of execution is called a thread
• Threads share access to memory
Why use
Multithreading?
In a single threaded application, one thread of
execution must do everything
If an application has several tasks to perform,
those tasks will be performed when the thread
can get to them.
A single task which requires a lot of processing
can make the entire application appear to be
"sluggish" or unresponsive.
Why use
Multithreading?
• In a multithreaded application, each task can be
performed by a separate thread
If one thread is executing a long process, it does not
make the entire application wait for it to finish.

• If a multithreaded application is being executed on a


system that has multiple processors, the OS may
execute separate threads simultaneously on separate
processors.
What Kind of Applications
Use Multithreading?
Any kind of application which has distinct tasks
which can be performed independently
Any application with a GUI.
Threads dedicated to the GUI can delegate the
processing of user requests to other threads.
Any application which requires asynchronous
response
Data can arrive from the network at any time.
In a multithreaded system, a thread can be
dedicated to listening for data on the network
port
How does it all
work?
Each thread is given its own "context“. A thread's
context includes virtual registers and its own calling
stack
The "scheduler" decides which thread executes at
any given time
The scheduler maintains a list of ready threads (the
run queue) and a list of threads waiting for input
(the wait queue)
Each thread has a priority. The scheduler typically
schedules between the highest priority threads in
the run queue
Control of
Multithreading
We will implement multithreading in
Java Programming

But, we must know about how to


controlling multithreading. In next
chapter, after we implementation
TCP & UDP, we will deep discuss
about controlling this multithreaded
program
QUESTION??
PLEASE REMEMBER THIS CONCEPT AND THEORY :D

You might also like