LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 05-19-2009, 09:00 AM   #1
kumar_bst
Member
 
Registered: Jul 2007
Posts: 36
Blog Entries: 1

Rep: Reputation: 15
Packet formarion and MAC modification in C programme


Hi All,

I am writing a programme to autoconfigure a network element. The element has different ip address than the subnet. Suppose the element has address like 61.10.1.5, where as the subnet, it attached to, address is 192.160.10.0.

I want to send a multicast packet into the subnet it belongs to, but I can't able to send any data using either raw socket or any udp socket.

Kindly help me.

Thaking you in advance.

With best regards,

Amit

Last edited by kumar_bst; 05-19-2009 at 10:11 PM.
 
Old 05-20-2009, 09:59 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,078

Rep: Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713
Quote:
Originally Posted by kumar_bst View Post
Hi All,

I am writing a programme to autoconfigure a network element. The element has different ip address than the subnet. Suppose the element has address like 61.10.1.5, where as the subnet, it attached to, address is 192.160.10.0.

I want to send a multicast packet into the subnet it belongs to, but I can't able to send any data using either raw socket or any udp socket.

Kindly help me.
Not sure how we can "kindly help you"....you don't post anything of your code, or what problems/errors you're getting, or tell us anything about your version/distro of Linux.
 
Old 06-16-2009, 10:54 AM   #3
kumar_bst
Member
 
Registered: Jul 2007
Posts: 36
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Thanks for reply. I got the solution.
 
Old 06-16-2009, 02:43 PM   #4
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 15,078

Rep: Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713Reputation: 2713
Quote:
Originally Posted by kumar_bst View Post
Thanks for reply. I got the solution.
Great...since you came here for help, how about helping the rest of the community, and posting the solution?
 
Old 05-13-2010, 11:12 AM   #5
kumar_bst
Member
 
Registered: Jul 2007
Posts: 36
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Wink

Quote:
Originally Posted by TB0ne View Post
Great...since you came here for help, how about helping the rest of the community, and posting the solution?
I am really sorry for late.

You need to form the ethernet packet by hand [of course, dont use your hand , but write code to prepare the packet, instead of linux kernel to prepare for you] . the destination address will be the broadcast address of the subnet and source will be yours. then send using the raw socket.

hope, it will work.
 
  


Reply

Tags
multicast, socket


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting MAC address from Ethernet packet in C++ eljofi Programming 9 10-13-2013 03:21 AM
get MAC address after packet mangling shuperb Linux - Networking 1 02-15-2008 10:39 AM
How can I send a packet to mac address ... tobiasw Linux - Networking 8 10-22-2006 05:54 PM
Packet filter using MAC Address aashish.verma Linux - Networking 1 05-30-2006 08:41 AM
packet capture and modification mimithebrain Programming 5 03-13-2006 10:00 PM


All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration