Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to play around with networks. I can see the following information of my pc.

# ifconfig
em1       Link encap:Ethernet  HWaddr B8:CA:3A:89:EE:F1  
          inet addr:136.170.195.17  Bcast:136.170.195.255  Mask:255.255.252.0
          inet6 addr: fe80::baca:3aff:fe89:eef1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2451527 errors:0 dropped:0 overruns:0 frame:0
          TX packets:465326 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:348889561 (332.7 MiB)  TX bytes:308284135 (294.0 MiB)
          Interrupt:20 Memory:f7e00000-f7e20000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:186285 errors:0 dropped:0 overruns:0 frame:0
          TX packets:186285 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:44085804 (42.0 MiB)  TX bytes:44085804 (42.0 MiB)

p3p1      Link encap:Ethernet  HWaddr CC:B2:55:BA:B6:A4  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Now, I want to broadcast a data over network. So, that I can check on the other pc's whether they received my message or not? How can I do so? How can I experiment by sending data over broadcast address? What is the utility to send data over broadcast address? This is actually to clear my fundamentals.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Use http://www.dest-unreach.org/socat/, both for sending and receiving. Look at the examples page for inspiration ( http://www.dest-unreach.org/socat/doc/socat.html#EXAMPLES ):

socat - UDP4-DATAGRAM:224.255.0.1:6666,bind=:6666,ip-add-membership=224.255.0.1:eth0 transfers data from stdin to the specified multicast address using UDP. Both local and remote ports are 6666. Tells the interface eth0 to also accept multicast packets of the given group. Multiple hosts on the local network can run this command, so all data sent by any of the hosts will be received by all the other ones. Note that there are many possible reasons for failure, including IP-filters, routing issues, wrong interface selection by the operating system, bridges, or a badly configured switch.

share|improve this answer
    
How about netstat? How can I do so with netstat? –  dexterous_stranger Feb 11 at 8:37
    
netstat is for showing the stats of the network, hence the name. it's not for moving data. did you mean "netcat"? –  akira Feb 11 at 8:40
    
Does netcat broadcast the data? –  dexterous_stranger Feb 11 at 8:45
1  
linux.die.net/man/1/nc –  akira Feb 11 at 8:46

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.