Subject: [arch-d] UDP Client-Server Behavior

From: deepak rajaram <[email-masked]>
Date: Mon, 21 Nov 2011 04:01:18 -0800 (PST)

Hi,

There are two questions on UDP sessions

1> I would like to know if there is any way to send a message to a UDP client "from" a server for disconnecting the session.
While i do realize that a ICMP message could be sent by a server during port scan, That would be only on the server side. is there a possibility that a server could send out a message to the client  to close the session?

For Eg:
-- A client tries to establish a session with source port x(on client) to a destination port y on a server 
-- The server should reply to x with some message for informing the client to disconnect the session

2> Is there any limit on the number of bytes to be sent on a UDP socket, i have seen implementations where, a single byte data will disconnect the session, can this logic be used to achive the above point?

Eg: 
A Server sends a 1 byte data to client and the client closes the session?
or
A Client sends a 1 byte data and the sever closes the UDP session?

Regards,
Deepak

---

From: Joe Touch <[email-masked]>
Date: Mon, 21 Nov 2011 08:47:56 -0800

> -- The server should reply to x with some message for informing the client to disconnect the session

UDP is connectionless and includes only demultiplexing information; it has no signaling. There are two options:

1) send an application message that indicates the association has ended

2) send an ICMP error that the port is no longer reachable

(2) might legitimately be interpreted as terminating all application sessions to that UDP port, though - it's not source port/destination port specific.

(1) is the only safe option

> A Client sends a 1 byte data and the sever closes the UDP session?\

There should be no limit to the number of bytes sent on a UDP socket; each SEND call is supposed to emit a separate UDP message that is completely unrelated to any other at the transport layer. 

An *application* can decide that an application-layer association is terminated when it receives a specific number of bytes or a specific response, but that's at the application layer.

Overall, it seems like you're expecting TCP-like semantics from UDP.

Joe

---

From: deepak rajaram <[email-masked]>
Date: Tue, 22 Nov 2011 06:16:59 -0800 (PST)

Hi Joe,
Thanks a lot for the reply,

Regarding option 1: "send an application message that indicates the association has ended"
If my understanding is correct, "All" available UDP clients should be in a position to interpret this message(session termination message) sent from my server, which might not be possible, is there any other generic way by which i could achieve this , which would allow the user to use "any" available UDP client??

________________________________
 From: Joe Touch <[email-masked]>
To: deepak rajaram <[email-masked]> 
Cc: "[email-masked]" <[email-masked]> 
Sent: Monday, November 21, 2011 10:17 PM
Subject: Re: [arch-d] UDP Client-Server Behavior

Joe

---

From: Randall Gellens <[email-masked]>
Date: Tue, 22 Nov 2011 10:50:29 -0800

At 6:16 AM -0800 11/22/11, deepak rajaram wrote:

Hi Joe,

Regarding option 1: "send an
application message that indicates the association has
ended"

If my understanding is correct,
"All" available UDP clients should be in a position to
interpret this message(session termination message) sent from my
server, which might not be possible, is there any other generic way by
which i could achieve this , which would allow the user to use
"any" available UDP client??

What is a "session" in this case?

What is a UDP client in this case?

Where are these UDP clients coming from?

What are these UDP clients doing with the UDP?

From: Joe Touch
<[email-masked]>

Cc: "[email-masked]"
<[email-masked]>

> 1> I would like to know if there is any way to send a message
to a UDP client "from" a server for disconnecting the
session.

> While i do realize that a ICMP message could be sent by a server
during port scan, That would be only on the server side. is there a
possibility that a server could send out a message to the client
to close the session?

> -- A client tries to establish a session with source port x(on
client) to a destination port y on a server

> -- The server should reply to x with some message for informing
the client to disconnect the session

UDP is connectionless and includes only demultiplexing information; it
has no signaling. There are two options:

1) send an application message that indicates the association has
ended

(2) might legitimately be interpreted as terminating all application
sessions to that UDP port, though - it's not source port/destination
port specific.

> 2> Is there any limit on the number of bytes to be sent on a
UDP socket, i have seen implementations where, a single byte data will
disconnect the session, can this logic be used to achive the above
point?

> A Client sends a 1 byte data and the sever closes the UDP
session?\

There should be no limit to the number of bytes sent on a UDP socket;
each SEND call is supposed to emit a separate UDP message that is
completely unrelated to any other at the transport layer.

An *application* can decide that an application-layer association is
terminated when it receives a specific number of bytes or a specific
response, but that's at the application layer.

Overall, it seems like you're expecting TCP-like semantics from
UDP.

Joe

_______________________________________________

Architecture-discuss mailing list

[email-masked]

https://www.ietf.org/mailman/listinfo/architecture-discuss

--

Randall Gellens

Opinions are personal;    facts are
suspect;    I speak for myself only

-------------- Randomly selected tag: ---------------

Reading Proust is like bathing in someone else's dirty water.

--Alexander Woollcott

---

From: Joe Touch <[email-masked]>
Date: Tue, 22 Nov 2011 11:04:29 -0800

Hi, Deepak,

On 11/22/2011 6:16 AM, deepak rajaram wrote:
> If my understanding is correct, "All" available UDP clients should be in
> a position to interpret this message(session termination message) sent
> from my server, which might not be possible, is there any other generic
> way by which i could achieve this , which would allow the user to use

TCP clients can connect to any TCP server, and TCP CLOSE indicates the 
end of a connection.

UDP is a *message* protocol, not a connection protocol. There is no 
state at the UDP layer to terminate, since none is ever established. The 
state of a session has meaning only at the application layer, and so is 
application-specific. There is no such thing as a universal UDP session 
terminator.

If the difference isn't apparent, you need to seek a textbook, not this 
mailing list.

Joe

> ------------------------------------------------------------------------
> *From:* Joe Touch <[email-masked]>
> *To:* deepak rajaram <[email-masked]>
> *Cc:* "[email-masked]" <[email-masked]>
> *Sent:* Monday, November 21, 2011 10:17 PM
> *Subject:* Re: [arch-d] UDP Client-Server Behavior
>
>
>  > 1> I would like to know if there is any way to send a message to a
> UDP client "from" a server for disconnecting the session.
> possibility that a server could send out a message to the client to
> close the session?
>  >
>  > For Eg:
>  > 2> Is there any limit on the number of bytes to be sent on a UDP
> socket, i have seen implementations where, a single byte data will
> disconnect the session, can this logic be used to achive the above point?
>  >
>  > Eg:

---

From: deepak rajaram <[email-masked]>
Date: Tue, 22 Nov 2011 23:32:46 -0800 (PST)

Hi Joe,

I do understand the difference, however, i have seen some implementations where, if a "single byte" data is sent to a UDP port, it was treated as a session terminator and all possible clients/connections were terminated. I guess , like you said earlier, a TCP like semantics is tried here for UDP.

In my previous mail, what i meant by 
UDP Server: A machine in which has a particular UDP service is running on a port to which UDP clients could send messages
UDP Client: Nothing but an application used to send messages to the UDP port on the server

Thanks a lot for your replies.

Regards,
Deepak

Sent: Wednesday, November 23, 2011 12:34 AM
 
Hi, Deepak,

Joe

>  > Hi,
>  >
>  > There are two questions on UDP sessions
>  >
>  > 1> I would like to know if there is any way to send a message to a
>  > While i do realize that a ICMP message could be sent by a server
>  >
>  > For Eg:
>  > -- A client tries to establish a session with source port x(on
>  > -- The server should reply to x with some message for informing the
> client to disconnect the session
>
>  > 2> Is there any limit on the number of bytes to be sent on a UDP
>  >
>  > Eg:
>  > A Server sends a 1 byte data to client and the client closes the session?
>  > or
>  > A Client sends a 1 byte data and the sever closes the UDP session?\
>

---

From: Joe Touch <[email-masked]>
Date: Wed, 23 Nov 2011 10:46:22 -0800

Deepak,

On 11/22/2011 11:32 PM, deepak rajaram wrote:
> Hi Joe,
>
> I do understand the difference, however, i have seen some
> implementations where, if a "single byte" data is sent to a UDP port, it
> was treated as a session terminator and all possible clients/connections
> were terminated. I guess , like you said earlier, a TCP like semantics
> is tried here for UDP.

That works only for those *applications* that decide that a single byte 
UDP *means* "terminate". That's not defined by UDP, nor is it even a 
convention among UDP application designers.

Note also that UDP messages, unlike TCP data, need not be delivered in 
order, and could be lost in the network. So even for apps that 'agree' 
on its meaning, it could end up dis-associating applications prematurely 
or not at all.

Joe

> *Sent:* Wednesday, November 23, 2011 12:34 AM
>  > *From:* Joe Touch <[email-masked] <mailto:[email-masked]>>
>  > *To:* deepak rajaram <[email-masked] <mailto:[email-masked]>>
>  > *Cc:* "[email-masked]
> <mailto:[email-masked]>" <[email-masked]
> <mailto:[email-masked]>>

---

From: Randall Gellens <[email-masked]>
Date: Wed, 23 Nov 2011 11:33:34 -0800

At 11:32 PM -0800 11/22/11, deepak rajaram wrote:

I do understand the difference, however,
i have seen some implementations where, if a "single byte"
data is sent to a UDP port, it was treated as a session terminator and
all possible clients/connections were terminated. I guess , like you
said earlier, a TCP like semantics is tried here for UDP.

More specifically, that is application-level semantics.  UDP
just sends data, there is no connection, no session, no initiation, no
termination.  An application that uses UDP can define its own
semantics which could include a message to terminate (for example, a
particular data pattern, such as "END" or xFFFF or x0000, or
even a particular size, such as the one-byte example you gave,
although that does seem a bit limiting since it prevents you from
using one-byte messages for anything else, but that's all up to
you).

In my previous mail, what i meant
by

UDP Server: A machine in which has a
particular UDP service is running on a port to which UDP clients
could send messages

UDP Client: Nothing but an application
used to send messages to the UDP port on the server

What I was getting at in my questions is what are these UDP
clients and where do they come from?  Presumably they are
something specific to the application and hence they can do any
special application-level semantics you want.

Thanks a lot for your
replies.

Regards,

Deepak

From: Joe Touch
<[email-masked]>

Hi, Deepak,

On 11/22/2011 6:16 AM, deepak rajaram wrote:

> Regarding option 1: "send an application message that
indicates the

> association has ended"

> "any" available UDP client??

TCP clients can connect to any TCP server, and TCP CLOSE indicates
the

end of a connection.

UDP is a *message* protocol, not a connection protocol. There is
no

state at the UDP layer to terminate, since none is ever established.
The

state of a session has meaning only at the application layer, and so
is

application-specific. There is no such thing as a universal UDP
session

terminator.

If the difference isn't apparent, you need to seek a textbook, not
this

mailing list.

Joe

> possibility that a server could send out a message to the client
to

ended

UDP.

--

Randall Gellens

-------------- Randomly selected tag: ---------------

If you lend someone $20, and never see that person again,

it was probably worth it.