Networking Forums

Networking Forums > Computer Networking > Linux Networking > About send packet with BROADCAST addr? Who can help me.

Reply
Thread Tools Display Modes

About send packet with BROADCAST addr? Who can help me.

 
 
bighead_csu@hotmail.com
Guest
Posts: n/a

 
      06-04-2006, 10:52 AM
Hello, every body, I'm a newbie in linux network programming.
When I want to write a program that implement a request ip addr from
DHCP+ server, I encounter a problem.

According to the packet that I captured from the Carrier's Login
utility, I need to send a UDP packet, with broadcast dest addr, and 0
src addr.
But when I configure the eth0's address as 0, i can't send out a
packet.

Does anyone know what's the problem is, and how to slove it?

Thanks.

 
Reply With Quote
 
 
 
 
Tauno Voipio
Guest
Posts: n/a

 
      06-04-2006, 04:59 PM
(E-Mail Removed) wrote:
> Hello, every body, I'm a newbie in linux network programming.
> When I want to write a program that implement a request ip addr from
> DHCP+ server, I encounter a problem.
>
> According to the packet that I captured from the Carrier's Login
> utility, I need to send a UDP packet, with broadcast dest addr, and 0
> src addr.
> But when I configure the eth0's address as 0, i can't send out a
> packet.
>
> Does anyone know what's the problem is, and how to slove it?


Why? There are already good DHCP client daemons.

You cannot reliably send an UDP packet with sender address
of 0.0.0.0 (as required by DHCP) without using raw sockets.

I'd recommend to tackle simpler network programming tasks first.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
Alex
Guest
Posts: n/a

 
      06-05-2006, 01:35 AM
Thanks for your help.

The reason that need to write this program is that the Carrier use a
mechnism called DHCP+ Authentication to control the access to Internet.
DHCP+ extends DHCP, and the Carrier only provide Windows version and
redhat version of DHCP+ Client. But I'm using Debian.

According your advice, should I encapsulate IP header by myself?

Tauno Voipio wrote:
> (E-Mail Removed) wrote:
> > Hello, every body, I'm a newbie in linux network programming.
> > When I want to write a program that implement a request ip addr from
> > DHCP+ server, I encounter a problem.
> >
> > According to the packet that I captured from the Carrier's Login
> > utility, I need to send a UDP packet, with broadcast dest addr, and 0
> > src addr.
> > But when I configure the eth0's address as 0, i can't send out a
> > packet.
> >
> > Does anyone know what's the problem is, and how to slove it?

>
> Why? There are already good DHCP client daemons.
>
> You cannot reliably send an UDP packet with sender address
> of 0.0.0.0 (as required by DHCP) without using raw sockets.
>
> I'd recommend to tackle simpler network programming tasks first.
>
> --
>
> Tauno Voipio
> tauno voipio (at) iki fi


 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      06-05-2006, 05:50 AM
Alex wrote:
> Tauno Voipio wrote:
>
>>(E-Mail Removed) wrote:
>>
>>>Hello, every body, I'm a newbie in linux network programming.
>>>When I want to write a program that implement a request ip addr from
>>>DHCP+ server, I encounter a problem.
>>>
>>>According to the packet that I captured from the Carrier's Login
>>>utility, I need to send a UDP packet, with broadcast dest addr, and 0
>>>src addr.
>>>But when I configure the eth0's address as 0, i can't send out a
>>>packet.
>>>
>>>Does anyone know what's the problem is, and how to slove it?

>>
>>Why? There are already good DHCP client daemons.
>>
>>You cannot reliably send an UDP packet with sender address
>>of 0.0.0.0 (as required by DHCP) without using raw sockets.
>>
>>I'd recommend to tackle simpler network programming tasks first.
>>


(-- top-posting corrected, TV --)

> Thanks for your help.
>
> The reason that need to write this program is that the Carrier use a
> mechnism called DHCP+ Authentication to control the access to Internet.
> DHCP+ extends DHCP, and the Carrier only provide Windows version and
> redhat version of DHCP+ Client. But I'm using Debian.
>
> According your advice, should I encapsulate IP header by myself?


Get the sources of a working DHCP daemon, e.g. DHCPCD,
read it and modify to accept the extras.

Yes, you do need to build the whole DHCPDISCOVER packet yourself
to create the correct addresses into it.

I assume that you know what's in the extras of the ISP.

Check once more that the necessary changes cannot be done
with DHCP options. Many clients already existing are capable
of handling the options.

For reference, read and understand the DHCP RFCs (RFC 1541 and RFC 2131
and associated RFCs) before continuing with the project.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux box doesn't send tcp ACK in handshake when receiving SYN/ACK toa broadcast address Adam Linux Networking 3 06-11-2011 12:10 PM
How to send out a packet urgently? Bill Unruh Linux Networking 8 11-28-2007 06:13 PM
Does anyone know how to send UDP packet through HTTP proxy? feiman Linux Networking 2 02-12-2007 09:15 PM
multicast broadcast addr innocent Linux Networking 1 04-05-2005 06:15 PM
How to send a packet to wake on lan steve Windows Networking 0 02-12-2004 02:30 PM



1 2 3 4 5 6 7 8 9 10 11