Subject: data packet length in l2tp

From: "S.Rajesh Kumar" <[email-masked]>
Date: Thu, 8 Jun 2000 14:31:05 -0700 (PDT)

L2tp data packets may or may not have a length field.
In the absence of a length field, how does an implementation
working over say BSD 4.3 udp sockets, find the length of a
data packet? And then read in a complete packet?

An approach of reading in avp by avp (since length of each avp
element is specified) sounds pretty slow....

Thanks
Rajesh

---

From: Bill Palter <[email-masked]>
Date: Thu, 08 Jun 2000 15:45:59 -0700

> element is specified) sounds pretty slow....

  UDP is record based, the read should give you the entire message....

--
Bill Palter ([email-masked])

---

From: James Carlson <[email-masked]>
Date: Thu, 8 Jun 2000 20:49:01 -0400 (EDT)

> data packet? And then read in a complete packet?

The return value from read() will be the length of the packet.

> element is specified) sounds pretty slow....

Besides slow, it wouldn't work.  Reading from a datagram socket is
destructive.  If you don't ask for the whole packet the first time,
the rest is just discarded.

-- 
James Carlson                                  <[email-masked]>
"PPP Design and Debugging" --- http://people.ne.mediaone.net/carlson/ppp

---

From: "W. Mark Townsley" <[email-masked]>
Date: Thu, 22 Jun 2000 17:37:56 -0400

> element is specified) sounds pretty slow....

I assume you are referring to L2TP control packets, not data packets,
since you mention reading in AVPs.

L2TP Control packets always have a length field.