Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Seth Vishambhar Nath Institute of Engineering &

Technology
Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow, Uttar Pradesh Approved by
AICTE, New Delhi
Lucknow-Barabanki Highway, Safedabad, Barabanki (U.P.) - 225003 Website:
http://www.svn.ac.in

Experiment-6

Aim: Socket programming using UDP and TCP (e.g., simple DNS, data & time client/server, echo
client/server, iterative & concurrent servers)

Basics:

1. Hostname and port: are used to specify transport endpoints.

2. Socket: the communication object.

3. TCP properties: reliable, connection-oriented, byte-stream, connection established before


application-level protocols exchange information, two-way communication.

4. UDP properties: unreliable, packet-switched, packet data, no connection overhead, application-


level protocols exchange information immediately, two-way communication.

A socket connection is a 4-tuple -- (Host A, Port A, Host B, Port B) -- uniquely defining the connection.

Fig. no
alwaysPlease
shown in below the
correct it. fig.,
Computer Network Lab SVNIET, Barabanki
Page 1
Seth Vishambhar Nath Institute of Engineering &
Technology
Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow, Uttar Pradesh Approved by
AICTE, New Delhi
Lucknow-Barabanki Highway, Safedabad, Barabanki (U.P.) - 225003 Website:
http://www.svn.ac.in
TCP client/server communication flow

Client/Server Architecture- McGraw-Hill Series

Computer Network Lab SVNIET, Barabanki


Page 2
Seth Vishambhar Nath Institute of Engineering &
Technology
Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow, Uttar Pradesh Approved by
AICTE, New Delhi
Lucknow-Barabanki Highway, Safedabad, Barabanki (U.P.) - 225003 Website:
http://www.svn.ac.in

TCP Server communication model(UDP figure):

Client/Server Architecture- McGraw-Hill Series

Computer Network Lab SVNIET, Barabanki


Page 3
Seth Vishambhar Nath Institute of Engineering &
Technology
Affiliated to Dr. A.P.J. Abdul Kalam Technical University, Lucknow, Uttar Pradesh Approved by
AICTE, New Delhi
Lucknow-Barabanki Highway, Safedabad, Barabanki (U.P.) - 225003 Website:
http://www.svn.ac.in

Socket programming boils down to two systems communicating with one another. Generally, network
communication comes in two flavors: Transport Control Protocol (TCP) and User Datagram Protocol
(UDP). TCP and UDP are used for different purposes and both have unique constraints.

 TCP is relatively simple and reliable protocol that enables a client to make a connection to a
server and the two systems to communicate. In TCP, each entity knows that its communication
payloads have been received.

 UDP is a connectionless protocol and is good for scenarios where you do not necessarily
need every packet to arrive at its destination, such as media streaming.

Computer Network Lab SVNIET, Barabanki


Page 4

You might also like