1. S.NO. PROGRAM NAME REMARK
1.
What is the network.
2.
Overview of OSI model.
3.
Define the IP & IPv4
Why IP address
4.
IP header , IPv4 range
5.
What is the socket ,
Type of socket
6.
Write the socket program .
2. 1. What is the networks ?
A collection of two or more computers interconnected by the
telephone lines, co-axial cable, satellite links, radio and microwave
transmission and some other communication techniques. A
computer network is a group of computers that are connected
together and that communicate with one another for a common
purpose.
Although the computer industry is young compared to anther
industries (e.g., automobiles air transportation), computer have
made spectacular progress in a short time. During the first two
decades of their extrinsic, computer system highly centralized,
usually a single large room. A medium size company or university
might have had one or two computers, while large instructions had
at most a few dozen. The idea that with in 20 years equally powerful
computers smaller than postage stamps would be mass produced by
the millions was pure science fiction.
The merging of computers & communications has had a profound
influence on the way computer systems are organized. The concept
of the computer center as a room with a large computer to which
users bring their work for processing is now totally obsolete. The old
model of single computer serving all of the organizations
computational needs has been replaced by one in which a large
number of separate but interconnected computers do the job. These
systems are called computer networks.
3.
4. 1 .Overview of OSI model ?
The Open Systems Interconnection model (OSI model) is
a conceptual model that characterize standardizes
thecommunication functions of a telecommunication or
computing system without regard to their underlying internal
structure and technology. Its goal is the interoperability of
diverse communication systems with standard protocols.
The Seven Layers of the OSI Model
5.
6.
7.
8. 2. Define the IPv4 ?
Internet Protocol Characteristics
Operates at network layer of OSI
Connectionlessprotocol
Packets treated independently
Hierarchical addressing
Best-effort delivery
No data-recovery features
Why IP Addresses?
They uniquelyidentify each device on an IP
network.
Every host (computer, networking device,
peripheral) must have a uniqueaddress.
Host ID:
– Identifies the individual host
– Is assigned by organizationsto individual
devices
10. IP Address Ranges
Class A addresses begin with 0xxx, or 1 to 126 decimal.
Class B addresses begin with 10xx, or 128 to 191 decimal.
Class C addresses begin with 110x, or 192 to 223 decimal.
Class D addresses begin with 1110, or 224 to 239 decimal.
Class E addresses begin with 1111, or 240 to 254 decimal.
*127 (01111111) is a Class A address reserved for loopback
testing and cannot be assigned to a network.
11. What is the socket ?
A network socket is one endpoint in a communication flow
between two programs running over a network.
Sockets allow communication between two different
processes on the same or different machines.
A Unix Socket is used in client-server application framework.
A server is a process that performs some functions on
request from a client. Most of the application-level protocols
like FTP, SMTP, and POP3 make use of sockets to establish
connection between client & server and then for exchanging
data.
If everything goes well, the server accepts the connection
12. SocketTypes
There are four types of sockets available to the users. The
first two are most commonly used and the last two are
rarely used.
Stream Sockets − Delivery in a networked environment
is guaranteed. If you send through the stream socket
three items "A, B, C", they will arrive in the same order
− "A, B, C". These sockets use TCP (Transmission Control
Protocol) for data transmission. If delivery is impossible,
the sender receives an error indicator. Data records do
not have any boundaries.
Datagram Sockets − Delivery in a networked
environment is not guaranteed. They're connectionless
because you don't need to have an open connection as
in Stream Sockets − you build a packet with the
destination information and send it out.
13. Raw Sockets − These provide users access to the underlying
communication protocols, which support socket
abstractions. These sockets are normally datagram oriented,
though their exact characteristics are dependent on the
interface provided by the protocol. Raw sockets are not
intended for the general user; they have been provided
mainly for those interested in developing new
communication protocols, or for gaining access to some of
the more cryptic facilities of an existing protocol.
Sequenced Packet Sockets − They are similar to a
stream socket, with the exception that record
boundaries are preserved.
14. WAP to implement Chat server using Socket Programming.
using System;
using System.Collections.Generic;
usingSystem.ComponentModel;
usingSystem.Data;
usingSystem.Drawing;
usingSystem.Linq;
usingSystem.Text;
usingSystem.Threading.Tasks;
usingSystem.Windows.Forms;
usingSystem.Net.Sockets;
using System.Net;
namespaceSocketProgramming
{
publicpartialclassForm1: Form
{
Socketskt;
EndPointclientep, remoteep;
public Form1()
{
InitializeComponent();
skt = newSocket(AddressFamily.InterNetwork,
SocketType.Dgram, ProtocolType.Udp);
skt.SetSocketOption(SocketOptionLevel.Socket,SocketOptio
nName.ReuseAddress,true);
textBox1.Text = callerip();