
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture was delivered by Dr. Ram Sai at Jaypee University of Engineering and Technology for Computers and Network Programming course. It includes: Network, Programming, Protocol, Socket, Addresses, Independence, Wrapper, Socket, User, Datagram, Tcp, Ip
Typology: Slides
1 / 32
This page cannot be seen from the preview
Don't miss anything!

























-^
Provides
a^ connectionless
service
-^
Application
writes
a^ message
to
a^ UDP
socket,
which
is^
then
-^
Encapsulated
in^
a^ UDP
datagram
-^
Further
encapsulated
as^
an^
IP^ datagram
-^
Then
sent
to^
its^
destination
-^
There
is^
no
guarantee
that
-^
A^ UDP
datagram
will
ever
reach
its
final
destination
-^
Order
will
be
preserved
across
the
network
-^
A^ UDP
socket
can
send
a^ datagram
to
a^ given
server
and
then
immediately
send
next
datagram
to
another
from
the
same
socket
-^
A^ UDP
server
can
receive
five
datagrams
in^
a^ row
on
a^ single
UDP
socket,
each
from
five
different
clients
-^
UDP
lacks
reliability
,^ sequence
numbers,
RTT
estimation,
timeouts,
or
retransmissions
Source
Port
Destination
Port
Length
Checksum
Bit^
0
16
31
TCP
Connection
Establishment
Three
‐Way
Handshake
-^
Server
must
be
prepared
to
accept
connection
(passive
open)^ –
socket,
bind,
listen
-^
Client
calls
connect
(active
open)
segment
is^
sent
telling
the
server
the
initial
sequence
number
of
client
Normally,
there
is^
no
data
sent
with
the
it^
just
contains
an
header,
a^ TCP
header,
and
possible
options
-^
Server
must
ACK
the
client’s
SYN
and
also
send
its
own
SYN
to
the
client
Server
sends
its
SYN and
the
ACK of
the
client’s
SYN in
a^
single
statement
-^
Client
must
ACK
the
server’s
SYN
-^
-^
-^
-^
Window
Scale
option
Maximum
window
size
that
either
can
advertise
is
(because
of
bit
field
in
header)
Larger
window
size
is^
required
to
obtain
the
maximum
throughput
in
high
speed
networks
or
in
long
delay
path
(satellite
links)
Window
scale
option
specifies
that
advertise
window
in
the
header
must
be
scaled
(left
shifted)
by
bits,
providing
a^
maximum
window
of
almost
one
gigabyte
x^10
Both
end
systems
must
support
this
option
for
the
window
scale
to
be
used
on
a^ connection
socket
option
is^
used
to
effect
this
option
client
server
close
close (active close) connect
returns
(passive close)^ read
returns
0
FIN
M ack
N+ 1 ack
+M (^1)
Figure 2.
Packets exchanged when a TCP connection is closed.
FIN
N
in
step
one
can
be
sent
with
data
Normally
four
segments
are
required
for
closing
the
connection,
but
sometimes
it^
can
be
lesser
Segments
in
step
and
are
both
from
the
end
performing
the
passive
close
and
could
be
combined
into
one
segment
occupies
byte
of
sequence
number
space
just
like
therefore,
the
of
each
is^
the
sequence
number
of
the
plus
one
Between
step
and
it^ is
possible
for
data
to
flow
from
the
end
doing
the
passive
close
to
the
end
doing
the
active
close
-^
This
is^
called
half
‐close
Often
the
client
performs
the
active
close,
but
with
some
protocols
the
server
performs
the
active
close
TCP
State
Transition^ Diagram
19
These
states
can
be
displayed
by
netstat
The
operation
of
TCP
with
regard
to
connection
establishment
and
connection
termination
can
be
specified
with
a^
state
transition
diagram.
There
are
11
different
states
defined
for
a^
connection
and
the
rules
of
TCP
dictate
the
transitions
from
one
state
to
another,
based
on
the
current
state
and
the
segment
received
in
that
state.
For
example,
if
an
application
performs
an
active
open
in
the
CLOSED
state,
TCP
sends
a^
SYN
and
the
new
state
is
SYN_SENT.
If
TCP
next
receives
a^
SYN
with
an
ACK,
it
sends
an
ACK
and
the
new
state
is
ESTABLISHED.
This
final
state
is
where
most
data
transfer
occurs.