Discussion:
DHCP paket size udhcp 0.9.9-pre
Jim Wright
2006-11-18 00:54:46 UTC
Permalink
please take a look at this thread
http://forum.bsr-clan.de/ftopic8253.html ( in english)
we need a smaller paketsize for udhcpd, it sends 590 bytes f?r DHCP
discover
and a DHCP Server / DHCP relay drops all pakets bigger than 576 bytes.
still figured out that the problem is located at "PADDING" there is
a lot of
unused stuff inside with blows up paket size unnecessarily.
Hey, I'm new to Busybox, and am running OpenWRT, and have run into
this issue, my ISP is dropping the oversized packets from udhcp.
According to the above thread this issue is resolved in DD-WRT now,
but my non-expert snooping doesn't show that this fix has made its
way into busybox yet. Any updates?
Bernhard Fischer
2006-11-18 12:55:57 UTC
Permalink
Post by Jim Wright
please take a look at this thread
http://forum.bsr-clan.de/ftopic8253.html ( in english)
we need a smaller paketsize for udhcpd, it sends 590 bytes f?r DHCP
discover
and a DHCP Server / DHCP relay drops all pakets bigger than 576 bytes.
still figured out that the problem is located at "PADDING" there is
a lot of
unused stuff inside with blows up paket size unnecessarily.
Hey, I'm new to Busybox, and am running OpenWRT, and have run into
this issue, my ISP is dropping the oversized packets from udhcp.
According to the above thread this issue is resolved in DD-WRT now,
but my non-expert snooping doesn't show that this fix has made its
way into busybox yet. Any updates?
I don't recall to have seen a patch and an explanation on the busybox
list concerning this issue.

Also, AFAICT, you're better off to use the version of udhcpd that comes
with busybox as opposed to the standalone project since the latter is
basically not maintained, currently, while the version in busybox is.

The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.

Thanks,
Bernhard
Denis Vlasenko
2006-11-18 19:55:25 UTC
Permalink
Post by Bernhard Fischer
Post by Jim Wright
Hey, I'm new to Busybox, and am running OpenWRT, and have run into
this issue, my ISP is dropping the oversized packets from udhcp.
According to the above thread this issue is resolved in DD-WRT now,
but my non-expert snooping doesn't show that this fix has made its
way into busybox yet. Any updates?
I don't recall to have seen a patch and an explanation on the busybox
list concerning this issue.
Also, AFAICT, you're better off to use the version of udhcpd that comes
with busybox as opposed to the standalone project since the latter is
basically not maintained, currently, while the version in busybox is.
The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.
I just checked. We emit correctly sized packets.
--
vda
Jim Wright
2006-11-18 20:46:06 UTC
Permalink
Post by Denis Vlasenko
Post by Bernhard Fischer
The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.
From what I can tell, this was from the busybox version.
Post by Denis Vlasenko
I just checked. We emit correctly sized packets.
Are these correctly sized packets now less than 576 bytes? I tested
here with Busybox 1.0 and 1.2.1, packet sizes from both versions were
590 bytes, which is causing these packets to be discarded by my ISP.
Denis Vlasenko
2006-11-20 01:16:32 UTC
Permalink
Post by Jim Wright
Post by Denis Vlasenko
Post by Bernhard Fischer
The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.
From what I can tell, this was from the busybox version.
Post by Denis Vlasenko
I just checked. We emit correctly sized packets.
Are these correctly sized packets now less than 576 bytes? I tested
here with Busybox 1.0 and 1.2.1, packet sizes from both versions were
590 bytes, which is causing these packets to be discarded by my ISP.
Okay. udhcpc sends packets using this code
(the only place where I see sendto() in udhcp subdirectory):

int udhcp_raw_packet(struct dhcpMessage *payload,
uint32_t source_ip, int source_port,
uint32_t dest_ip, int dest_port, uint8_t *dest_arp, int ifindex)
{
int fd;
int result;
struct sockaddr_ll dest;
struct udp_dhcp_packet packet;
...
result = sendto(fd, &packet, sizeof(struct udp_dhcp_packet), 0,
(struct sockaddr *) &dest, sizeof(dest));

Checking that sizeof:

#include <netinet/udp.h>
#include <netinet/ip.h>

struct dhcpMessage {
uint8_t op;
uint8_t htype;
uint8_t hlen;
uint8_t hops;
uint32_t xid;
uint16_t secs;
uint16_t flags;
uint32_t ciaddr;
uint32_t yiaddr;
uint32_t siaddr;
uint32_t giaddr;
uint8_t chaddr[16];
uint8_t sname[64];
uint8_t file[128];
uint32_t cookie;
uint8_t options[308]; /* 312 - cookie */
};

struct udp_dhcp_packet {
struct iphdr ip;
struct udphdr udp;
struct dhcpMessage data;
};

#include <stdio.h>

int main() {
printf("%d\n", sizeof(struct udp_dhcp_packet));
return 0;
}

# gcc t.c
# ./a.out
576

Works for me.

But I am going to add compile-time check for that anyway.
--
vda
Denis Vlasenko
2006-11-20 01:16:32 UTC
Permalink
Post by Jim Wright
Post by Denis Vlasenko
Post by Bernhard Fischer
The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.
From what I can tell, this was from the busybox version.
Post by Denis Vlasenko
I just checked. We emit correctly sized packets.
Are these correctly sized packets now less than 576 bytes? I tested
here with Busybox 1.0 and 1.2.1, packet sizes from both versions were
590 bytes, which is causing these packets to be discarded by my ISP.
Okay. udhcpc sends packets using this code
(the only place where I see sendto() in udhcp subdirectory):

int udhcp_raw_packet(struct dhcpMessage *payload,
uint32_t source_ip, int source_port,
uint32_t dest_ip, int dest_port, uint8_t *dest_arp, int ifindex)
{
int fd;
int result;
struct sockaddr_ll dest;
struct udp_dhcp_packet packet;
...
result = sendto(fd, &packet, sizeof(struct udp_dhcp_packet), 0,
(struct sockaddr *) &dest, sizeof(dest));

Checking that sizeof:

#include <netinet/udp.h>
#include <netinet/ip.h>

struct dhcpMessage {
uint8_t op;
uint8_t htype;
uint8_t hlen;
uint8_t hops;
uint32_t xid;
uint16_t secs;
uint16_t flags;
uint32_t ciaddr;
uint32_t yiaddr;
uint32_t siaddr;
uint32_t giaddr;
uint8_t chaddr[16];
uint8_t sname[64];
uint8_t file[128];
uint32_t cookie;
uint8_t options[308]; /* 312 - cookie */
};

struct udp_dhcp_packet {
struct iphdr ip;
struct udphdr udp;
struct dhcpMessage data;
};

#include <stdio.h>

int main() {
printf("%d\n", sizeof(struct udp_dhcp_packet));
return 0;
}

# gcc t.c
# ./a.out
576

Works for me.

But I am going to add compile-time check for that anyway.
--
vda

Jim Wright
2006-11-18 20:46:06 UTC
Permalink
Post by Denis Vlasenko
Post by Bernhard Fischer
The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.
From what I can tell, this was from the busybox version.
Post by Denis Vlasenko
I just checked. We emit correctly sized packets.
Are these correctly sized packets now less than 576 bytes? I tested
here with Busybox 1.0 and 1.2.1, packet sizes from both versions were
590 bytes, which is causing these packets to be discarded by my ISP.
Denis Vlasenko
2006-11-18 19:55:25 UTC
Permalink
Post by Bernhard Fischer
Post by Jim Wright
Hey, I'm new to Busybox, and am running OpenWRT, and have run into
this issue, my ISP is dropping the oversized packets from udhcp.
According to the above thread this issue is resolved in DD-WRT now,
but my non-expert snooping doesn't show that this fix has made its
way into busybox yet. Any updates?
I don't recall to have seen a patch and an explanation on the busybox
list concerning this issue.
Also, AFAICT, you're better off to use the version of udhcpd that comes
with busybox as opposed to the standalone project since the latter is
basically not maintained, currently, while the version in busybox is.
The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.
I just checked. We emit correctly sized packets.
--
vda
Jim Wright
2006-11-18 00:54:46 UTC
Permalink
please take a look at this thread
http://forum.bsr-clan.de/ftopic8253.html ( in english)
we need a smaller paketsize for udhcpd, it sends 590 bytes f?r DHCP
discover
and a DHCP Server / DHCP relay drops all pakets bigger than 576 bytes.
still figured out that the problem is located at "PADDING" there is
a lot of
unused stuff inside with blows up paket size unnecessarily.
Hey, I'm new to Busybox, and am running OpenWRT, and have run into
this issue, my ISP is dropping the oversized packets from udhcp.
According to the above thread this issue is resolved in DD-WRT now,
but my non-expert snooping doesn't show that this fix has made its
way into busybox yet. Any updates?
Bernhard Fischer
2006-11-18 12:55:57 UTC
Permalink
Post by Jim Wright
please take a look at this thread
http://forum.bsr-clan.de/ftopic8253.html ( in english)
we need a smaller paketsize for udhcpd, it sends 590 bytes f?r DHCP
discover
and a DHCP Server / DHCP relay drops all pakets bigger than 576 bytes.
still figured out that the problem is located at "PADDING" there is
a lot of
unused stuff inside with blows up paket size unnecessarily.
Hey, I'm new to Busybox, and am running OpenWRT, and have run into
this issue, my ISP is dropping the oversized packets from udhcp.
According to the above thread this issue is resolved in DD-WRT now,
but my non-expert snooping doesn't show that this fix has made its
way into busybox yet. Any updates?
I don't recall to have seen a patch and an explanation on the busybox
list concerning this issue.

Also, AFAICT, you're better off to use the version of udhcpd that comes
with busybox as opposed to the standalone project since the latter is
basically not maintained, currently, while the version in busybox is.

The mail you cite above sounds like it's using the standalone version
and not the busybox version. Please clarify.

Thanks,
Bernhard
Loading...