0% found this document useful (0 votes)
106 views7 pages

System & Network Programming: Experiment 1

This document provides an introduction to network programming and key concepts such as packets, hosts, channels, networks, servers, clients, network addresses, protocols, ports, connections, and associations. It describes client-server models and connection-oriented and connection-less scenarios. The document also discusses network layers in the OSI model and how sockets provide an interface between the upper application layers and the transport layer.

Uploaded by

Muhham Waseem
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)
106 views7 pages

System & Network Programming: Experiment 1

This document provides an introduction to network programming and key concepts such as packets, hosts, channels, networks, servers, clients, network addresses, protocols, ports, connections, and associations. It describes client-server models and connection-oriented and connection-less scenarios. The document also discusses network layers in the OSI model and how sockets provide an interface between the upper application layers and the transport layer.

Uploaded by

Muhham Waseem
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
You are on page 1/ 7

System & Network Programming

Experiment 1

CLO-3: Use modern tools and languages.


CLO-4: Build the projects of varying complexities.
CLO-5: Demonstrate the implementation of problem solving process.
CLO-6: Work individually as well as in teams.
CLO-7: Demonstrate a unique solution that exhibits originality of idea
INTRODUCTION TO NETWORK PROGRAMMING LAB

NETWORKING BASICS

Computer networking is the engineering discipline concerned with communication


between computer systems or devices.
It is the practice of linking computing devices together with hardware and software that
supports data communications across these devices.

KEY CONCEPTS AND TERMS


Packet A message or data unit that is transmitted between communicating processes.
Host: A computer system that is accessed by a user working at a remote location. It is
the remote process with which a process communicates. It may also be referred as Peer.
Channel: Communication path created by establishing a connection between endpoints.
Network A group of two or more computer systems linked together
Server: In computer networking, a server is a computer designed to process requests
and deliver data to other computers over a local network or the Internet.

• Iterative servers: This server knows ahead of time about how long it takes to
handle each request & server process handles each request itself.

• Concurrent servers: The amount of work required to handle a request is


unknown, so the server starts another process to handle each request.
Client: A Client is an application that runs on a personal computer or workstation and
relies on a server to perform some operations.

Network Address: Network addresses give computers unique identities they can use to
communicate with each other. Specifically, IP addresses and MAC addresses are used
on most home and business networks.

Protocols: A Protocol is a convention or standard rules that enables and controls the
connection, communication and data transfer between two computing endpoints.

Port An interface on a computer to which you can connect a device. It is a "logical


connection place" and specifically, using the Internet's protocol, TCP/IP.
A port is a 16-bit number, used by the host-to-host protocol to identify to which higher
level protocol or application program (process) it must deliver incoming messages.

PORTS RANGE
Well-known ports 1-1023
Ephemeral ports 1024-5000
User-defined ports 5001-65535

Connection: It defines the communication link between two processes.


Association: Association is used for 5 tuple that completely specifies the two processes
that make up a connection. A 5-tuple refers to a set of five different values that comprise
a Transmission Control Protocol/Internet Protocol (TCP/IP) connection.

{Protocol, local-address, local-process, foreign-address, foreign- process} The


local address and foreign address specify the network ID & Host-ID of the local host and
the foreign host in whatever format is specified by protocol suite.

The local process and foreign process are used to identify the specific processes on each
system that are involved in a connection. We also define Half association as either
{ protocol, local-address, local process} or { protocol, local-address, local process}
which specify each half of a connection. This half association is called a Socket or
transport address.

OSI Model
A common way to describe the layers in a network is to use the International Organization
for Standardization (ISO) open systems interconnection (OSI) model for computer
communications. This is a seven-layer model, which we show in Figure below along with
the approximate mapping to the Internet protocol suite.
We consider the bottom two layers of the OSI model as the device driver and networking
hardware that are supplied with the system. The network layer is handled by the IPv4
and IPv6 protocols. The transport layers that we can choose from are TCP and UDP
Layers in OSI model and Internet protocol suite.

The upper three layers of the OSI model are combined into a single layer called the
application. This is the Web client (browser) or whatever application we are using. With
the Internet protocols, there is rarely any distinction between the upper three layers of the
OSI model.

The sockets programming interfaces are interfaces from the upper three layers (the
"application") into the transport layer. The sockets provide the interface from the upper
three layers of the OSI model into the transport layer. There are two reasons for this
design:
• The upper three layers handle all the details of the application and know little about
the communication details. The lower four layers know little about the application,
but handle all the communication details: sending data, waiting for
acknowledgments, and so on.
• The second reason is that the upper three layers often form what is called a user
process while the lower four layers are normally provided as part of the operating
system (OS) kernel.
CLIENT-SERVER MODEL
Network applications can be divided into two process: a Client and a Server, with a
communication link joining the two processes.

Normally, from Client-side it is one-one connection. From the Server Side, it is many-one
connection.
The standard model for network applications is he Client-Server model. A Server is a
process that is waiting to be contacted by a Client process so that server can do
something for the client.
Typical BSD Sockets applications consist of two separate application level processes;
one process (the client) requests a connection and the other process (the server)
accepts it.

Socket functions for elementary TCP client/server in Connection-oriented Scenario

The server process creates a socket, binds an address to it, and sets up a mechanism
(called a listen queue) for receiving connection requests. The client process creates a
socket and requests a connection to the server process.
Once the server process accepts a client process's request and establishes a connection,
full-duplex (two-way) communication can occur between the two sockets.

Socket functions for elementary TCP client/server in Connection-less Scenario

Connection-less communication is related to the postal system. It does not include any
connection establishment and connection termination. Connection-less Service does not
give the guarantee of reliability. Connectionless communication there is no need to
establish connection between source (sender) and destination (receiver). But in
connection-oriented communication connection must established before data transfer.

You might also like