Docsity

Network Programming: Understanding Clients, Servers, and Protocols, Slides of Advanced Computer Programming

Partial preview of the text

Download Network Programming: Understanding Clients, Servers, and Protocols and more Slides Advanced Computer Programming in PDF only on Docsity!

IT355: Internet Technologies &

Programming

Chapter 01: Introduction

What is Network Programming?

  • (^) Network programs: Programs that use network in some

way to do their work.

  • (^) Send data across a network
  • (^) Provide services over a network
  • (^) Receive data over a network
  • (^) Invoke services across a network
  • (^) Network programming is the discipline of designing and

implementing network programs that communicate across

networks.

Why Network Programming?

  • (^) Sharing of information
    • (^) stock quote, airline schedule, ...
  • (^) Parallel and distributed computing
  • (^) Application services
    • (^) client-server applications, Ecommerce, chat room, multiplayer network games, ...
  • (^) Collaborative computing
    • (^) desktop conferencing, webcast, ...
    • (^) peer-to-peer applications

Java Networking

  • (^) Java supports network programming from the earliest

release in a platform-independent way. (“the language of

the Internet”)

  • (^) New Java networking APIs provide high-level object

models and function libraries that hide most of the low-

level details

TCP/IP Suite

Creating a Network Application

  • (^) write programs that
    • (^) run on (different) end systems
    • (^) communicate over network
    • (^) e.g., web server software communicates with browser software
  • (^) No need to write software for

network-core devices

  • (^) Network-core devices do not run user applications applicatio n transport network data link physical applicatio n transport network data link physical applicatio n transport network data link physical

Client-Server Architecture

  • (^) server:
    • (^) always-on host
    • (^) permanent IP address
    • (^) server farms for scaling
  • (^) clients:
    • (^) communicate with server
    • (^) may be intermittently connected
    • (^) may have dynamic IP addresses
    • (^) do not communicate directly with each other client/server

Servers

  • (^) In a client/server network, the server runs a service, or

process, sometimes called a server daemon.

  • (^) Like most services, daemons typically run in the

background and are not under an end user's direct

control.

  • (^) When a daemon "hears" a request from a client, it

exchanges appropriate messages with the client, as

required by its protocol, and proceeds to send the

requested data to the client in the proper format

Hybrid of Client-Server and P2P

  • (^) Skype
    • (^) voice-over-IP P2P application
    • (^) centralized server: finding address of remote party:
    • (^) client-client connection: direct (not through server)
  • (^) Instant messaging
    • (^) chatting between two users is P2P
    • (^) centralized service: client presence detection/location
      • (^) user registers its IP address with central server when it comes online
      • (^) user contacts central server to find IP addresses of buddies

Processes Communication

  • (^) Process: program running

within a host.

  • (^) within same host, two

processes communicate

using inter-process

communication (defined

by OS).

  • (^) processes in different

hosts communicate by

exchanging messages

  • (^) Client process: process

that initiates

communication

  • (^) Server process: process

that waits to be

contacted

  • (^) Note: applications with

P2P architectures have

client processes & server

processes

Sockets

Addressing Processes

• To receive messages, process must have

identifier

• Host device has unique 32-bit IP address

Q: does IP address of host suffice for identifying

the process?

A: No, many processes can be running on same

host

Application Layer Protocol Defines

  • (^) Types of messages

exchanged,

  • (^) e.g., request, response
  • (^) Message syntax:
  • (^) what fields in messages

& how fields are

delineated

  • (^) Message semantics
    • (^) meaning of information

in fields

  • (^) Rules for when and how

processes send & respond

to messages

  • (^) Public-domain protocols:
    • (^) defined in RFCs
    • (^) allows for

interoperability

  • (^) e.g., HTTP, SMTP
  • (^) Proprietary protocols:
  • (^) Do not necessarily

confirm to RFCs

  • (^) e.g., Skype

Internet Transport Protocols Services

  • (^) TCP service:
    • (^) connection-oriented: setup required between client and server processes
    • (^) reliable transport between sending and receiving process
    • (^) flow control: sender won’t overwhelm receiver
    • (^) congestion control: throttle sender when network overloaded
    • (^) does not provide: security
      • (^) UDP service:
        • (^) unreliable data transfer

between sending and

receiving process

  • (^) does not provide:

connection setup,

reliability, flow control,

congestion control, or

security