0% found this document useful (0 votes)
12 views4 pages

Network Programming Course Overview

This document provides an overview of network programming concepts including: 1. Describing key components of network protocols and socket programming methods for communication across networks. 2. Explaining the client-server model where servers provide services and clients make requests, with examples like websites, databases, and applications. 3. Detailing how URLs identify resources on networks and how TCP and UDP protocols establish connections or send datagrams respectively for reliable or unreliable transmission.

Uploaded by

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

Network Programming Course Overview

This document provides an overview of network programming concepts including: 1. Describing key components of network protocols and socket programming methods for communication across networks. 2. Explaining the client-server model where servers provide services and clients make requests, with examples like websites, databases, and applications. 3. Detailing how URLs identify resources on networks and how TCP and UDP protocols establish connections or send datagrams respectively for reliable or unreliable transmission.

Uploaded by

Randy Tabaog
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Integrative Programming and Technologies 1

1
Network Programming

Module 05 Network Programming

Course Learning Outcomes:


1. Describe the key components of Network Protocols
2. Describe network management and protection techniques.
3. Describe socket programming methods.
4. Describe Inter-process communication systems.

Background

There are many issues that arise when doing network programming which do not appear
when doing single program applications. However, JAVA makes networking applications simple due
to the easy-to-use libraries. In general, applications that have components running on different
machines are known as distributed applications ... and usually they consist of client/server
relationships.

Network Programming involves writing programs that communicate with other programs
across a computer network.
A server is an application that provides a "service" to various clients who request the
service.

There are many client/server scenarios in real life:


 Bank tellers (server) provide a service for the account owners (client)
 Waitresses (server) provide a service for customers (client)
 Travel agents (server) provide a service for people wishing to go on vacation (client)

In some cases, servers themselves may become clients at various times example is the travel
agents will become clients when they phone the airline to make a reservation or contact a hotel to
book a room. In the general networking scenario, everybody can either be a client or a server at any
time. This is known as peer-to-peer computing. In terms of writing java applications it is similar to
having many applications communicating among one another.

Course Module
Integrative Programming and Technologies 1
2
Network Programming

Reading Files from the Internet


A Uniform Resource Locator (i.e., URL) is a reference (or address) to a resource over a network (e.g.,
on the Internet).
So, a URL can be used to represent the "location" of a webpage or web-based application. A URL is
really just a String that represents the name of a resource ... which can be files, databases,
applications, etc. A resource name consists of a host machine name, filename, port number, and
other information.
http:// is the protocol identifier which indicates the protocol that will be used to obtain the
resource. The remaining part is the resource name, and its format depends on the protocol used to
access it.
A URL resource name may generally contain:
 A Host Name - The name of the machine on which the resource lives.
[Link]
 A Port # (optional) - The port number to which to connect.
[Link]
 A Filename - The pathname to the file on the machine.
[Link]

Client/Server Communications
Many companies today sell services or products. In addition, there are a large number of
companies turning towards E-business solutions and various kinds of web-server/database
technologies that allow them to conduct business over the internet as well as over other networks.
Such applications usually represent a client/server scenario in which one or more servers serve
multiple clients.
A server is any application that provides a service and allows clients to communicate with it.
A client is any application that requests a service from a server.
The client typically "uses" the service and then displays results to the user. Normally,
communication between the client and server must be reliable (no data can be dropped or missing):
The TCP protocol, mentioned earlier, provides reliable point-to-point communication. Using
TCP the client and server must establish a connection in order to communicate. To do this, each
program binds a socket to its end of the connection. A socket is one endpoint of a two way
communication link between 2 programs running on the network. A socket is bound to a port
number so that the TCP layer can identify the application to which the data is to be sent. It is similar
to the idea of plugging the two together with a cable.
The port number is used as the server's location on the machine that the server application
is running. So if a computer is running many different server applications on the same physical
machine, the port number uniquely identifies the particular server that the client wishes to
communicate with:

Course Module
Integrative Programming and Technologies 1
3
Network Programming

The client and server may then each read and write to the socket bound to its end of the connection.

Datagram Sockets

Recall that with the datagram protocol (i.e., UDP) there is no direct socket connection
between the client and the server. That is, packets are received "in seemingly random order" from
different clients. It is similar to the way email works. If the client requests or server responses are
too big, they are broken up into multiple packets and sent one packet at a time. The server is not
guaranteed to receive the packets all at once, nor in the same order nor is it guaranteed to receive
all the packets.
The same client-server application, but by now using DatagramSockets and
DatagramPackets. Once again, the server will be in a infinite loop accepting messages, although
there will be no direct socket connection to the client. We will be setting up a buffer (i.e., an array of
bytes) which will be used to receive incoming requests.
Each message is sent as a packet. Each packet contains:
 the data of the message (i.e., the message itself)
 the length of the message (i.e., the number of bytes)
 the address of the sender (as an InetAddress)
 the port of the sender

References and Supplementary Materials


Books and Journals
1. Unix Network Programming (2016) The Sockets Networking API, Volumes 1, by W
Richard Stevens, Bill Fenner, Andrew M. Rudoff, published by Addison-Wesley (UNP)

2. Information Storage and Management: Storing, Managing, and Protecting Digital


Information in Classic, Virtualized, and Cloud Environments, Second Edition, EMC
Education Services, 2012

Online Supplementary Reading Materials


1. Network Programming
[Link]
Online Instructional Videos
1. [Link]

Course Module
Integrative Programming and Technologies 1
4
Network Programming

Course Module

Common questions

Powered by AI

Client-server architectures enable E-business solutions by facilitating the reliable exchange of services and information over the internet. The crucial components include servers that host services or resources, clients that request these services, and reliable communication protocols like TCP for ensuring data integrity during transmission . These architectures allow businesses to operate online by using web-server and database technologies to handle multiple client requests efficiently, contributing to the seamless conduct of digital transactions .

Port numbers are selected to identify and differentiate server applications running on the same machine. They are significant because they allow multiple networking applications to operate concurrently on a single device by assigning a unique identifier to each one . This unique port number ensures that data sent over the network reaches the intended server application by specifying the exact endpoint to which the server app is bound. Without this differentiation, data packets may be misrouted, leading to communication errors between clients and servers.

The educational resources that can supplement learning in network programming include books such as "Unix Network Programming" by W. Richard Stevens, Bill Fenner, and Andrew M. Rudoff, and "Information Storage and Management" by EMC Education Services . Additionally, online supplementary materials, such as instructional videos and courses available at specific URLs, offer practical and theoretical insights into network programming concepts . These resources provide both foundational information and advanced discussion on network technologies and techniques.

Peer-to-peer computing decentralizes the traditional client-server model by allowing all nodes within a network to function as both clients and servers. This means any node can request services and provide services to others simultaneously, creating an equitable network distribution . Potential benefits include increased reliability due to redundancy, better utilization of resources as each node shares its capabilities, and enhanced scalability as the load is distributed across multiple nodes rather than centralized servers. Additionally, it reduces the dependence on central servers, mitigating single points of failure.

TCP and UDP differ mainly in their approach to data transmission reliability and order. TCP (Transmission Control Protocol) provides reliable point-to-point communication, ensuring that data is transmitted without loss or alteration, and in the correct sequence by establishing a connection between client and server via sockets and port numbers . In contrast, UDP (User Datagram Protocol) does not guarantee delivery or order, as it lacks a connection-oriented architecture. Data sent over UDP may arrive out of order or not at all, akin to sending mail without tracking . This makes TCP suitable for applications where reliability is critical, while UDP is appropriate for scenarios where speed is prioritized over accuracy, such as live streaming.

URLs (Uniform Resource Locators) play a crucial role in accessing network resources by serving as addresses that identify the location of a resource on the internet. A URL typically includes components such as the protocol identifier (e.g., http://), the host machine name (e.g., www.apple.com), an optional port number (e.g., :80), and the file path on the host machine (e.g., /ipad/index.html). These components collectively allow the retrieval of resources such as web pages or databases across networks.

Companies may prefer TCP over UDP for their E-business solutions due to TCP's reliability, ordered data transmission, and error-checking features, which are critical for business transactions involving sensitive or crucial information. E-business solutions typically require the secure and accurate transfer of data, and TCP's ability to establish a connection and ensure all data packets are correctly received and sequenced makes it more suited for such applications . UDP, lacking these assurances, may lead to data loss or corruption, which is unacceptable in a business context where data integrity is paramount.

Java simplifies the development of networking applications by providing easy-to-use libraries that abstract much of the complexity involved in network programming. These libraries offer built-in classes and methods that handle networking operations, such as creating sockets, establishing connections, and transmitting data . This significantly reduces the amount of code developers need to write and mitigates common networking issues that typically arise in distributed application environments.

Network programming involves challenges that are not present in single applications, primarily due to the distributed nature of such systems. These challenges include managing data transmission across networks, ensuring data integrity and order using appropriate protocols, handling concurrent connections, and dealing with potential network failures or delays . Unlike single applications, network programs must coordinate multiple components running on different machines, requiring robust error handling and synchronization mechanisms.

Datagram sockets, unlike regular sockets used in TCP connections, do not establish a direct connection between clients and servers. They utilize UDP, which sends packets independently over the network . This communication methodology results in less reliable data exchange as packets may arrive out of order, be duplicated, or even lost, similar to sending individual letters by mail without assurance of delivery or sequence. In contrast, regular sockets used with TCP guarantee ordered and reliable delivery of data between the client and server due to the connection-oriented nature of the protocol .

You might also like